V0.5/links/link/on-add-contexts

Hi Team,

I am getting a conversion issue from ABDM

The response from the ABDM server is shown below.

API: v0.5/links/link/on-add-contexts
Response Body:

{
“requestId”: “666f7f6a-4cbd-4a88-b56b-d9a0cbab64e4”,
“error”: {
“code”: 2500,
“message”: “Cannot deserialize instance of java.util.ArrayList<in.projecteka.consentmanager.clients.model.CareContextRepresentation> out of START_OBJECT token\n at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 846] (through reference chain: in.projecteka.consentmanager.link.link.model.LinkRequest[“link”]->in.projecteka.consentmanager.link.link.model.Link[“patient”]->in.projecteka.consentmanager.clients.model.PatientRepresentation[“careContexts”])”
},
“timestamp”: [
2023,
12,
11,
5,
17,
21,
368443000
],
“resp”: {
“requestId”: “d224d76d-2b2b-461c-ade1-5d626accd237”
}
}

Hi @anil.kushaba
Can you share entire request with headers and payload which you are using?

Hi @ayadav33

Thanks for replay

Headers :

Content-Type: application/json

Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE3MDIyOTI5NDUsImlhdCI6MTcwMjI3MTM0NSwianRpIjoiOThmZjlhYTgtZjI1OS00ZjljLTkzMGEtZTJhNzdkNjc0ZjZlIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxN2YyOTlmZi1kMjkyLTQzNWItOTZkOC0xZGI5ZTU1ODQzNWYiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAzNjgzIiwic2Vzc2lvbl9zdGF0ZSI6IjYzMjkzZTVmLWY0YjMtNDM0YS1hNGE3LWQ5YWViMTgzZjYwZCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlNCWF8wMDM2ODMiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY4LjIyMSIsImNsaWVudElkIjoiU0JYXzAwMzY4MyIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNieF8wMDM2ODMiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY4LjIyMSJ9.UPejdi-zuq16GAvutw9Aoltq8Dcp1uAd0vxEdmkof29VkHIh0TYpxyuOmOS8W44wLIPTMuPGlrUE6djpzn65T5Pb3-pT8vfZBgfseExB0rbZUXUTUr9pXeCjaAUcL8fD0pBHReaUGZ1_70aaZZvg_sTnT5vmltqGQB1TVefr3R1Gn75_2IwVIl1kPQUdhWSsZjsjtaDBMibkhRqMELeUphZNU8jKgdU_JTbrS7E5tUS5xq4GZUDBo-Pq5DkXZif-M6_qxCXC4YofSKw6XMNn5lmAVSCAuybFR2WhQhIe0rVJiaTt1gNojfQAatYs4q9iWKrN1rtf9U_H9VVwavFCeA

User-Agent: PostmanRuntime/7.34.0

Accept: /

Postman-Token: ab554e82-ed50-41fd-abc4-fe3d3f89f03c

Host: localhost:5120

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

Content-Length: 833:

and Request Body

{
“healthId” : “anil.kushaba@sbx”,
“patientDisplay”: “record for anil demo”,
“careContextsReferenceNumber”: “SUMA-012877”,
“careContextDisplay”: “testing purpose for demographics”,
“accessToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJhbmlsLmt1c2hhYmFAc2J4IiwicmVxdWVzdGVyVHlwZSI6IkhJUCIsInJlcXVlc3RlcklkIjoiU1VNQSIsInBhdGllbnRJZCI6ImFuaWwua3VzaGFiYUBzYngiLCJzZXNzaW9uSWQiOiJiYzE4ZjFjMy1hM2QyLTQ4MmYtYTg3Yy0yYTM2MzNlZDM0ZDEiLCJleHAiOjE3MDIzNjA4NzUsImlhdCI6MTcwMjI3NDQ3NX0.Oggtzurbfy4_cd_S7AL80Xd-65_Jg1zbS2o7O5oRoU74rXktRUFYg-S_6bUlc-f0kIn56iMecTr_hryY6jKQIJrLcG8s4ZX2OPxByvxQYFjiT1WVa1LDYlkSwBabtkXVscrt5e_B0P-7_tQFhCy6z-NXqnCIOTZ3eW4jjjmDQFGz5R10x0oEVL1JnUOLvASrvMzG6gx1joOu4tq4wpUHSKp4QQh7R6mBFdPsqiEdiQMjqTSe0NUQxpcJ6Vp24FqG4gB_ra6lDdZlfuV0jKVuPzcdVXOi9GqJQsTcUAxGASiRS25a3ovulIITIpVP_C1u2omjyLreierWMTHCuM6R5Q”
}

Hi @anil.kushaba
Are you sharing the payload for this api - https://dev.abdm.gov.in/gateway/v0.5/links/link/add-contexts

Hi @anil.kushaba
api - https://dev.abdm.gov.in/gateway/v0.5/links/link/add-contexts
Payload headers:


Use X-CM-ID : sbx

Payload body:

Hi @ayadav33

I am also creating same payload from backend side please check

Header

Request Body{
“requestId”: “cedd3913-f6fa-4839-a8c2-f35273ed5a44”,
“timestamp”: “2023-12-11T09:48:31.902385Z”,
“link”: {
“accessToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJhbmlsLmt1c2hhYmFAc2J4IiwicmVxdWVzdGVyVHlwZSI6IkhJUCIsInJlcXVlc3RlcklkIjoiU1VNQSIsInBhdGllbnRJZCI6ImFuaWwua3VzaGFiYUBzYngiLCJzZXNzaW9uSWQiOiJiYzE4ZjFjMy1hM2QyLTQ4MmYtYTg3Yy0yYTM2MzNlZDM0ZDEiLCJleHAiOjE3MDIzNjA4NzUsImlhdCI6MTcwMjI3NDQ3NX0.Oggtzurbfy4_cd_S7AL80Xd-65_Jg1zbS2o7O5oRoU74rXktRUFYg-S_6bUlc-f0kIn56iMecTr_hryY6jKQIJrLcG8s4ZX2OPxByvxQYFjiT1WVa1LDYlkSwBabtkXVscrt5e_B0P-7_tQFhCy6z-NXqnCIOTZ3eW4jjjmDQFGz5R10x0oEVL1JnUOLvASrvMzG6gx1joOu4tq4wpUHSKp4QQh7R6mBFdPsqiEdiQMjqTSe0NUQxpcJ6Vp24FqG4gB_ra6lDdZlfuV0jKVuPzcdVXOi9GqJQsTcUAxGASiRS25a3ovulIITIpVP_C1u2omjyLreierWMTHCuM6R5Q”,
“patient”: {
“referenceNumber”: “SUMA-012877”,
“display”: “record for anil demo”,
“careContexts”: {
“referenceNumber”: “SUMA-0128778”,
“display”: “string”
}
}
}
}

Hi @anil.kushaba
Please note that care context is a list and not dictionary in payload