Auto Approval Issue

Hi @Shubhanshu_Shukla,
I have trying to set Auto Approval policy for HIU using below api but it’s give response 401(Unauthorized)

https://dev.abdm.gov.in/cm/consents/auto-approve

Request:
{“hiu”:{“id”:“driefcasehl”,“name”:""},“includedSources”:[{“categories”:[“LINK”,“DATA”],“hiTypes”:[“DiagnosticReport”,“Prescription”,“ImmunizationRecord”,“DischargeSummary”,“OPConsultation”,“HealthDocumentRecord”,“WellnessRecord”],“period”:{“from”:“1921-12-11T00:00:00T”,“to”:“2021-12-11T18:29:00T”},“purpose”:{“code”:“PATRQT”,“text”:“Self Requested”},“status”:""}],“isApplicableForAllHIPs”:true}

Response:
{
“error”: {
“code”: 1401,
“message”: “Token verification failed”
}
}

Please guide us
Thanks

Hey @jatin,

Kindly use bearer token you must have obtained from /patients/verify-pin .
You can use below curl.

curl --location --request POST ‘https://dev.ndhm.gov.in/cm/consents/auto-approve
–header ‘Authorization;’
–header ‘X-Auth-Token;’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01960242=01115a1c90c12b4fad1fd6037f58120f314b7db267813e6a7ed1d3b6cfc642558a568ce54c8a7589147dc12f334ddb67309b5103d8’
–data-raw ‘{
“isApplicableForAllHIPs”: true,
“hiu”: {
“id”: “Test-HIU”,
“name”: “HIU for test”
},
“includedSources”: [
{
“hiTypes”: [
“DiagnosticReport”,
“Prescription”,
“DischargeSummary”,
“OPConsultation”,
“ImmunizationRecord”,
“WellnessRecord”,
“HealthDocumentRecord”
],
“purpose”: {
“code”: “PATRQT”,
“text”: “Self Requested”
},
“period”: {
“from”: “2020-11-03T12:54:21.896Z”,
“to”: “2020-11-03T12:54:21.896Z”
}
}
],
“excludedSources”: [
{
“hiTypes”: [
“DiagnosticReport”
],
“purpose”: {
“code”: “PATRQT”,
“text”: “Self Requested”
},
“hip”: {
“id”: “*”
}
}
]
}’

Note - Also your JSON body shows Invalid JSON variable .
Please cross check the body also.

Thanks