Whats the right API for making a locker request?

What’s the right API contract to make a locker request. I did try the one from the swagger but that’s not working for us, it only returns the auto-approval id. Please help.

curl --location --request POST 'https://dev.abdm.gov.in/cm/locker-requests/approve' \
--header 'Content-Type: application/json' \
--header 'X-Hip-Id: SBX_000324' \
--header 'X-Auth-Token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJ' \
--data-raw '{
    "subscription": {
        "requestId": "560f8e75-eaeb-463c-b48b-8c3c8a190771",
        "timestamp": "2022-06-08T06:21:02.587000",
        "subscription": {
            "purpose": {
                "text": "Self Requested",
                "code": "PATRQT",
                "refUri": "string"
            },
            "patient": {
                "id": "aajadata2000@sbx"
            },
            "hiu": {
                "id": "EKA_HIU"
            },
            "categories": [
                "LINK",
                "DATA"
            ],
            "period": {
                "from": "2021-06-07T05:45:19.159278767Z",
                "to": "2032-06-04T05:45:19.159278767Z"
            }
        }
    },
    "autoApproval": {
    "isApplicableForAllHIPs": true,
    "hiu": {
        "id": "EKA_HIU"
    },
    "includedSources": [
        {
            "hiTypes": [
                "OPConsultation",
                "ImmunizationRecord",
                "WellnessRecord",
                "Prescription",
                "DiagnosticReport",
                "DischargeSummary",
                "HealthDocumentRecord"
            ],
            "purpose": {
                "text": "Self Requested",
                "code": "PATRQT",
                "refUri": "string"
            },
            "period": {
                "from": "2021-06-07T05:45:19.159278767",
                "to": "2032-06-04T05:45:19.159278767"
            }
        }
    ],
    "excludedSources": null
},
    "authorization": {
        "requestId": "d174778d-5c07-473d-b1cc-e984479aafb1",
        "generatePerpetualToken": true
    }
}'

Response

The issue here is that it only return the auto-approval ids and not the subscription and authorization ids.

{
    "subscriptionId": null,
    "autoApprovalId": "b8ba7372-cac5-4f71-942a-e232a5217c0f",
    "authorizationId": null
}

Has anyone successfully integrated this API? I can see the API path having /approve so are there any API call that we need to call before calling this one?

Hi @sudo kindly refer to the workflow mentioned in the link.

https://sandbox.abdm.gov.in/docs/build_hl

Thanks

Hi @Ramandeep1

I have gone through the document.
I have shared the sample request too, please help us in validating the above request. As you can see in the response we are not able to get the subscription and authorization working with the above request.

We can get on a call if you need more clarity.

Thanks

Hi there.

any update?

Hi @sudo,
Could you find the issue?