Not able to get consent data

Hi @IntegrationSupport,

I am trying to get the edit data for the consent, as shown in the below image.

The API (**https://dev.abdm.gov.in/cm/consent-requests/b2941f14-6084-4e41-b09d-01ba9a607a59
**) is not providing the care-contexts.
And,
The API (https://dev.abdm.gov.in/cm/consent-requests/b2941f14-6084-4e41-b09d-01ba9a607a59/consent-artefacts) is giving this response

{
“error”: {
“code”: 1416,
“message”: “Cannot find the consent artefact”
}
}

How can I get this information?

@IntegrationSupport, please help

Can you please share the steps that you have followed along with the API payload body.

Yes, thanks.

  1. https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init
    {
    “requestId”: “{{$guid}}”,
    “timestamp”: “{{$isoTimestamp}}”,
    “consent”: {
    “purpose”: {
    “text”: “Self Requested”,
    “code”: “PATRQT”
    },
    “patient”: {
    “id”: “ravi12@sbx”,
    “name”: null
    },
    “hiu”: {
    “id”: “inlocker3”
    },

     "requester": {
         "name": "inlocker3",
         "identifier": {
             "type": "HEALTH_LOCKER",
             "value": "",
             "system": ""
         }
     },
     "hiTypes": ["DiagnosticReport"],
     "permission": {
         "accessMode": "VIEW",
         "dateRange": {
             "from": "2023-01-01T12:52:34.925Z",
             "to": "2023-03-01T12:52:34.925Z"
         },
         "dataEraseAt": "2023-05-28T12:52:34.925Z",
         "frequency": {
             "unit": "HOUR",
             "value": 1,
             "repeats": 1
         }
     }
    

    }
    }

<=== /v0.5/consent-requests/on-init
{‘requestId’: ‘ff5375a5-511d-45df-978e-1b0d1c16de28’, ‘timestamp’: ‘2023-05-02T09:21:22.965636787’, ‘consentRequest’: {‘id’: ‘ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b’}, ‘error’: None, ‘resp’: {‘requestId’: ‘f612dd0a-9c48-4181-b702-7e4387d74ef7’}}

  1. {{CM_HOST}}/patients/requests?lockerSetupLimit=198&lockerSetupOffset=0&subscriptionLimit=80&subscriptionOffset=0&authorizationLimit=100&authorizationOffset=0&status=ALL

{
“consents”: {
“size”: 13,
“limit”: 20,
“offset”: 0,
“requests”: [
{
“id”: “ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b”,
“status”: “REQUESTED”,
“createdAt”: “2023-05-02T09:21:22.99022”,
“purpose”: {
“text”: “Self Requested”,
“code”: “PATRQT”,
“refUri”: null
},
“patient”: {
“id”: “ravi12@sbx”
},
“hip”: null,
“hiu”: {
“id”: “inlocker3”,
“name”: null
},
“careContexts”: null,
“requester”: {
“name”: “inlocker3”,
“identifier”: {
“value”: “”,
“type”: “HEALTH_LOCKER”,
“system”: “”
}
},
“hiTypes”: [
“DiagnosticReport”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2023-01-01T12:52:34.925”,
“to”: “2023-03-01T12:52:34.925”
},
“dataEraseAt”: “2023-05-28T12:52:34.925”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 1
}
},
“lastUpdated”: “2023-05-02T09:21:22.99022”
},

  1. https://dev.abdm.gov.in/cm/consent-requests/ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b

            { "id": "ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b",
             "status": "REQUESTED",
             "createdAt": "2023-05-02T09:21:22.99022",
             "purpose": {
                 "text": "Self Requested",
                 "code": "PATRQT",
                 "refUri": null
             },
             "patient": {
                 "id": "ravi12@sbx"
             },
             "hip": null,
             "hiu": {
                 "id": "inlocker3",
                 "name": null
             },
             "careContexts": null,
             "requester": {
                 "name": "inlocker3",
                 "identifier": {
                     "value": "",
                     "type": "HEALTH_LOCKER",
                     "system": ""
                 }
             },
             "hiTypes": [
                 "DiagnosticReport"
             ],
             "permission": {
                 "accessMode": "VIEW",
                 "dateRange": {
                     "from": "2023-01-01T12:52:34.925",
                     "to": "2023-03-01T12:52:34.925"
                 },
                 "dataEraseAt": "2023-05-28T12:52:34.925",
                 "frequency": {
                     "unit": "HOUR",
                     "value": 1,
                     "repeats": 1
                 }
             },
             "lastUpdated": "2023-05-02T09:21:22.99022"
         }
    
  2. {{CM_HOST}}/consent-requests/ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b/consent-artefacts
    {
    “error”: {
    “code”: 1416,
    “message”: “Cannot find the consent artefact”
    }
    }

I am not able to get the complete consent details to approve or edit the given consent.

@prakharmohan

Please check the you’re access token issue.
{"@timestamp":“2023-05-02T09:43:52.062Z”,"@version":“1”,“message”:“Error happened for path: /consent-requests/ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b/consent-artefacts, method: GET, message: Token verification failed”,“logger_name”:“in.projecteka.consentmanager.link.GlobalExceptionHandler”,“thread_name”:“boundedElastic-4201”,“level”:“ERROR”,“level_value”:40000,“stack_trace”:"in.projecteka.consentmanager.clients.ClientError: Token verification failed\n\tat in.projecteka.consentmanager.clients.ClientError.unAuthorized(ClientError.java:297)\n\tSuppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: \nError has been observed at the following site(s):\n\t|_ checkpoint ⇢ org.springframework.security.web.server.authorization.AuthorizationWebFilter
Thanks.

Thanks @Govind_Deshmukh

I am passing two headers ‘Authorization’ and ‘X-AUTH-TOKEN’. Do I have to add more headers?
Please find below the curl for reference:

curl --location ’ https://dev.abdm.gov.in/cm/consent-requests/ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b/consent-artefacts
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2ODMwMjg0OTIsImlhdCI6MTY4MzAyNzg5MiwianRpIjoiN2NiMTU0MjItNGU0MC00OWM4LTgxMmYtNGI2ODU0NWM5ZWM0IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI0NTk1MDhlYS1jNTc3LTRhNTAtYmU3Mi1jNTE2MDM4ZDE2N2Ii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fD_6nqYZuNzFJHiXiWIdGDVed59vAvJBfVvVctp4O2CSPP8WcfcPjkb7Mrg’
–header ‘Cookie: TS011c04bd=01445fed04d9e25931a6313f3e0b8c87e4ce232630e907cb923631762f3a053b84e604fd40a59168bd292cd3b2f5e43c81a5bd4eab’

RESPONSE:
{
“error”: {
“code”: 1416,
“message”: “Cannot find the consent artefact”
}
}

@prakharmohan ji,
Please check the below document and use it as well as please add the conset-id as consent request -id in header. only one access token is fine.
NDHM Sandbox (abdm.gov.in)

Thanks.

@prakharmohan please let us know if this resolution helped

1 Like

@SARCH1 @Govind_Deshmukh Can you please share the curl for this?
I have tried every possible way I could and still I am not able to get the consent data for editing.

These APIs return artefact data only after approving the consent.

@prakharmohan, Can you share some screenshots ?

Yes, Sure.
Consent Init API:

consent_onit Line:55 msg:{‘requestId’: ‘f371cac7-bd0c-4961-a57a-7dc9b224f942’, ‘timestamp’: ‘2023-05-04T12:48:31.827489727’, ‘consentRequest’: {‘id’: ‘9876736b-0293-4168-aa2d-80099f6e7b22’}, ‘error’: None, ‘resp’: {‘requestId’: ‘da74878c-8089-42ed-9b75-0f34f2e70341’}}

Using the above consentId, I am getting this response.

@IntegrationSupport please help.

@IntegrationSupport
Still waiting for the help.
We have also mailed you regarding the same.

@prakharmohanji,
may i know in API link https://dev.abdm.gov.in/cm/consent-requests/ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b/consent-artefacts’ consent_Request_Id=ac49fb7c-06ec-4a5e-a127-c9dcec2bae3b which is correct please check.
Thanks

Yes Sir,
I am using this API and getting the response as:

Just initiated the new consent request and still the same response :frowning_face:

I am not able to find any API which could provide me the consent data before approving.

@Govind_Deshmukh @IntegrationSupport
Can you please schedule a call if possible?
We have mailed you regarding the same. Thanks.

@prakharmohan - can you please share on which email address did u share the email? please fwd to integration.support@nha.gov.in so that we can proceed to arrange the call

Is the email shared by “aniket shukla” ?

@prakharmohan - we are arranging a call. we are sharing an email for meeting link. please generate a meeting link once the time is decided

Yes sir/ma’am,
That’s the Email - ‘sent by aniket shukla.’
Okay thanks, we will generate a meeting link.