Consent Flow in v0.5/consent-requests/init

@IntegrationSupport
@Sachin
Hi team i am getting these error
i am hitting these url : https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init
This is request body :
{

“requestId”: “{{$guid}}”,

"timestamp": "{{$isoTimestamp}}",

“consent”: {

"purpose": {

  "text": "Radha",

  "code": "Kishna",

  "refUri": ""

},

"patient": {

  "id": "ramesh1231998@sbx"

},

"hip": {

  "id": "1456"

},

"careContexts": [

  {

    "patientReference": "TEST-02",

    "careContextReference": "paracetmal"

  }

],

"hiu": {

  "id": "1456"

},

"requester": {

  "name": "Ramesh",

  "identifier": {

    "type": "REGNO",

    "value": "MH1001",

    "system": "https://www.mciindia.org"

  }

},

"hiTypes": [

    "OPConsultation"

],

"permission": {

  "accessMode": "VIEW",

  "dateRange": {

    "from": "2016-09-21T04:08:55.799037465",

    "to": "2023-09-21T04:08:55.79904012"

  },

  "dataEraseAt": "2023-11-20T13:42:43.719897",

  "frequency": {

    "unit": "HOUR",

    "value": 1,

    "repeats": 0

  }

}

}

}

This is response while hitting these url :

{

"error": {

    "code": 2500,

    "message": "Unknown error occurred"

}

}

can you please tell me is their any mistake in these code or can you please help me on these and
can you please provide or share the milestone-2 api’s or url’s

@Bhaskar1 Please check our documentation . This is M3 flow.
https://sandbox.abdm.gov.in/abdm-docs/RequestingConsent
https://sandbox.abdm.gov.in/swagger/ndhm-hiu.yaml

@IntegrationSupport
@Sachin
Hi team
I am clicking on pull records response come to webhook

like these response was coming :
[
https://webhook.site/f16c98fb-bd41-40d6-9965-1778c2042d9b/v0.5/consents/hip/notify]

In these url response i can pass these values into these url : https://dev.abdm.gov.in/gateway/v0.5/consents/hip/on-notify { response : 202 Accepted }

After i am these url for getting one notification purpose only
url : https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init
response was not coming like these error was coming
“error”: {

    "code": 2500,

    "message": "Unknown error occurred"

}

or
How can i get these response form webhook url :

https://dev.abdm.gov.in/gateway/v0.5/health-information/hip/request

@IntegrationSupport
@Sachin
Hi team while Hitting on this url : https://dev.abdm.gov.in/gateway/v0.5/subscription-requests/cm/init
my request body is :
{

“requestId”: “{{$guid}}”,

"timestamp": "{{$isoTimestamp}}",

“subscription”: {

"purpose": {

  "text": "Self Requester", 

  "code": "Vamasathi",    

  "refUri": ""

},

"patient": {

  "id": "mounika12345@sbx"

},

"hiu": {

  "id": 76436

},

"hips": [

  {

    "id": 76436

  }

],

"categories": [

  "LINK"

],

"period": {

  "from": "2023-09-22T05:26:20.972Z",

  "to": "2025-09-22T05:26:20.972Z"

}

}

}

i am getting these response:

can u please tell me how can i resolve these error

@pranab Please assist.

@Bhaskar1 From the error which is present in webhook its quite clear that the Content-Type value is not correct, it should be application/json rather than text/plain. Please use the correct header and let us know if you still face any issue.

@pranab
TQ pranab
this issue is resolve and which back end language are implementing the code can u please tell me

@Bhaskar1 not sure if its relevant to you but I believe its Java

@pranab
I am also doing I java can u please help me how to connect the database or how to get the response to the your data base
can u please help me

Yes, sure. Let me know how can we connect. If you have any meeting link, kindly share it with with me on abdm.ssd1@nha.gov.in

@IntegrationSupport

How do i request a consent? I am getting error and let me know what is HIP Id.? How do i get hipd.?

@dhanyathanmayi HIP Id is the facility ID. You will get this once you register your facility in sandbox.
Please go through our vast documentation before integration

@IntegrationSupport

Well, We went through the documentation but still didn’t found a solution for the error we get.

Could you please check our request and response.

Request :

{

“requestId”: “499a5a4a-7dda-4f20-9b67-e24589627061”,
“timestamp”: {{timestamp}},
“consent”: {
“purpose”: {
“text”: “Public Health”,
“code”: “PUBHLTH”,
“refUri”: “http://example.com
},
“patient”: {
“id”: “abdm-hasna-facility”
},
“hip”: {
“id”: “abdm-hasna-facility”
},
“careContexts”: [
{
“patientReference”: “batman@tmh”,
“careContextReference”: “Episode1”
}
],
“hiu”: {
“id”: “91-6860-6012-7327”
},
“requester”: {
“name”: “Dr. Manju”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1001”,
“system”: “https://www.mciindia.org
}
},
“hiTypes”: [
“OPConsultation”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “1970-01-01T00:00:00.000Z”,
“to”: “1970-01-01T00:00:00.000Z”
},
“dataEraseAt”: “1970-01-01T00:00:00.000Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 0,
“repeats”: 0
}
}
}
}

Response :

The requested URL was rejected. Please consult with your administrator.
Your support ID is: 8374555054904008535

@dhanyathanmayi Share the API sequence you are following and share the api for which you have shared the payload body above.

@IntegrationSupport

Issue with consent request init API.
Could you please check the below details .

**API Url : **

https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init

Body Parameters :

{
“requestId”: “499a5a4a-7dda-4f20-9b67-e24589627061”,
“timestamp”: {{timestamp}},
“consent”: {
“purpose”: {
“text”: “Public Health”,
“code”: “PUBHLTH”,
“refUri”: “http://example.com
},
“patient”: {
“id”: “abdm-hasna-facility”
},
“hip”: {
“id”: “abdm-hasna-facility”
},
“careContexts”: [
{
“patientReference”: “batman@tmh”,
“careContextReference”: “Episode1”
}
],
“hiu”: {
“id”: “91-6860-6012-7327”
},
“requester”: {
“name”: “Dr. Manju”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1001”,
“system”: “https://www.mciindia.org
}
},
“hiTypes”: [
“OPConsultation”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “1970-01-01T00:00:00.000Z”,
“to”: “1970-01-01T00:00:00.000Z”
},
“dataEraseAt”: “1970-01-01T00:00:00.000Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 0,
“repeats”: 0
}
}
}
}

Response :

The requested URL was rejected. Please consult with your administrator.
Your support ID is: 8374555054904008535

@dhanyathanmayi Share header screenshot also.

@IntegrationSupport

Please find the screenshot below

[{“key”:“Authorization”,“value”:“Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2OTY4N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WvhJPSzz_1fLmJ7SSo3hWpuAktZnUIKU03mc1WtTm_qw640f9DuEffKcZEyUabDWn4SG0Plus0Tq1jMEDzvqrhUIarbzfmGBjQyE0msaGQTUfAI6zAuK3Mhws2YKg4DpMcfdDY0XIAEBG4QaVnilrSe0xcQTgJn7yneSi-vrz7FN8HMrSdWGokINv34aNq3iOBsZGsR0jUFgG_riA1o3q2MDgTJq7EKDLZldupjFL5pmlD2jyN7RS3pRUxpgpXqndrId68RsJUg62ikO5aZSow”,“type”:“text”},{“key”:“X-CM-ID”,“value”:“sbx”,“description”:"",“type”:“text”,“enabled”:true}]

@dhanyathanmayi
Hey hiii
You completed the Data Encryption part

@Bhaskar1

Sorry i didn’t understand.

@dhanyathanmayi
Are you completed the Data encryption part
and why you are doing these url : https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init