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?