Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. To integrate, host of audit-service module should be overwritten in helm chart.

  2. audit-service/log/v1/_createshould be added as the create endpoint for the config added.

  3. audit-service/log/v1/_searchshould be added as the search endpoint for the config added.

API Details

1. URI: The format of the API to be used to create audit logs using audit-service is as follows:  audit-service/log/v1/_create

...

Code Block
{
    "RequestInfo": {
        "apiId": "asset-services",
        "ver": null,
        "ts": null,
        "action": null,
        "did": null,
        "key": null,
        "msgId": "search with from and to values",
        "authToken": "83a1cfb3-6fde-4406-9ee1-622b3ecc7dab"
    },
    "AuditLogs": [
        {
            "userUUID": "11b0e02b-0145-4de2-bc42-c97b96264807",
            "module": "PGR",
            "tenantId": "pb.amritsar",
            "transactionCode": "PGR.CREATE",
            "changeDate": 1657104693726,
            "entityName": "eg_pgr_service",
            "objectId": "c8c901da-61e9-4cd5-89f7-7560997922b7",
            "keyValueMap": {
                "id": "89651651-841a-4b8c-a503-f5d4bb10f4d5",
                "tenantId": "pb.amritsar",
                "assemblyConstituency": "AMC",
                "applicationNumber": "c8c901da-61e9-4cd5-89f7-7560997922b7",
                "applicantId": null,
                "dateSinceResidence": 1590825279,
                "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                "lastModifiedBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                "createdTime": 1657104693312,
                "lastModifiedTime": 1657104693312
            },
            "operationType": "CREATE"
        },
        {
            "userUUID": "11b0e02b-0145-4de2-bc42-c97b96264807",
            "module": "PGR",
            "tenantId": "pb.amritsar",
            "transactionCode": "PGR.CREATE",
            "changeDate": 1657104693732,
            "entityName": "eg_pgr_address",
            "objectId": "c8c901da-61e9-4cd5-89f7-7560997922b7",
            "keyValueMap": {
                "id": "84cbe5d1-6ee8-4379-a0c4-0e2a5c94689d",
                "tenantId": "pb.amritsar",
                "doorNo": "1010",
                "latitude": null,
                "longitude": null,
                "buildingName": "Avigna Residence",
                "addressId": null,
                "addressNumber": "34 GA",
                "type": "RESIDENTIAL",
                "addressLine1": "KP Layout",
                "addressLine2": "",
                "landmark": "Petrol pump",
                "street": "12th Main",
                "city": "Amritsar",
                "locality": "New Amritsar Locality",
                "pincode": "143501",
                "detail": "",
                "registrationId": "89651651-841a-4b8c-a503-f5d4bb10f4d5"
            },
            "operationType": "CREATE"
        }
    ]
}

2. URI: The format of the API to be used to search audit logs using audit-service is as follows:  audit-service/log/v1/_search

Body: Body consists RequestInfo and search criteria is passed as query params.

Sample curl for search -

Code Block
curl --location --request POST 'https://dev.digit.org/audit-service/log/v1/_search?offset=0&limit=10&tenantId=pb.amritsar&objectId=c8c901da-61e9-4cd5-89f7-7560997922b7' \
--header 'Content-Type: application/json' \
--data-raw '{
    "RequestInfo": {
        "apiId": "asset-services",
        "ver": null,
        "ts": null,
        "action": null,
        "did": null,
        "key": null,
        "msgId": "search with from and to values",
        "authToken": "83a1cfb3-6fde-4406-9ee1-622b3ecc7dab"
    }
}'

Postman Collection - Audit Service Postman Collection