Getting 500 internal server error when calling APIs

Getting internal server error while using some health ID APIs. It appears to be an unhandled exception when the attributes in body are not in exact case.
In the example below “https://healthidsbx.ndhm.gov.in/api/v1/auth/authWithMobile” API throws 500 error if
–data ‘{ “healthId”: “66-2244-1746-6304”}’ throws following exception.

but no error if
–data ‘{ “healthid”: “66-2244-1746-6304”}’ ; I get the transaction Id.

Exception :
{
“code”: “HIS-500”,
“message”: “An unexpected error has occured. Please try again in sometime.”,
“details”: null
}

Request :
curl --request POST
–url https://healthidsbx.ndhm.gov.in/api/v1/auth/authWithMobile
–header ‘accept: /
–header ‘accept-language: en-US’
–header ‘authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2MDMzNzI3MTcsImlhdCI6MTYwMzM3MjExNywianRpIjoiNWVhZDA2MTgtNjk5NS00MjgwLWI3ZjItZTE4NTE2ODI4ZDM0IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJkOTNiYWRlZC02MGJlLTQxYzYtOTI4OC1iMmU1ZmY1NzVkNDkiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJQSElMTElQU18xODk2ODEzIiwic2Vzc2lvbl9zdGF0ZSI6IjYzZDA4NTBmLTU0YzgtNDAyZS05ZjVjLWJlYjEyYjRiNzA0ZCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiaGlwIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiUEhJTExJUFNfMTg5NjgxMyI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjkuMTc0IiwiY2xpZW50SWQiOiJQSElMTElQU18xODk2ODEzIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtcGhpbGxpcHNfMTg5NjgxMyIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjkuMTc0In0.TcAJeAyAuK94pcx7upJem41f25_yG8JZe3LZXVm2Aq9HeglBfWpllGiZQ7ZLd8sNTxYMLrBNo8CwVkZEb1lOe65unA94C5wAGcIPwhqzsfmhQLbf25g4N_4WinI91xjk-ED74-7g98vtAZbdtuPGnw6phkT07_Eo3qMszqY-NwND91djn9yvM82DwNAkJZUgOWDyuHTLnu_0ixsd-cCReAsxoNLY3cKppjrk50Eui64Ig75YUbUrAWOnabBUYkrxIRKEUVk1cD9ANIudD2sayz8mVVJ6kiefylnQH-ogrr2K6arBrUfMj3PmFTRTQas_oDRcArVMc-NS4YstJKMqDg’
–header ‘content-type: application/json’
–cookie TS01c078b5=01115a1c909003ca21034e39f67cc8a7f72aa9f4c43efe1ebfdb0d04d59ab0ee328a2890171b9b4bdbec7413a0b2f76a15c6924e78
–data ‘{ “healthId”: “66-2244-1746-6304”}’

Similarly I am getting same exception while using “https://healthidsbx.ndhm.gov.in/api/v1/registration/mobile/createHealthId” API. Not able to identify the issue yet.

For the createHealthId API the issue I think was expired token in the payload. I updated the token and 500 error was gone.

{ “txnId”: “9a345a4a-3e9d-4b30-b0eb-715a59b866fd”, “yearOfBirth”: “1991”, “gender”:“M”, “name”:“TestNAme”, “token” : “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI3MjU5MDAyNjY0IiwiZXhwIjoxNjAzNDM1NDU3LCJpYXQiOjE2MDM0MjgyNTcsInR4bklkIjoiOWEzNDVhNGEtM2U5ZC00YjMwLWIwZWItNzE1YTU5Yjg2NmZkIn0.PfwSJDB6Mh2gndlWHX1e0pE47GKJntphO-7V9he50AFK_1EjMquHEBd0QqhevGMISbHGGhnlRzp8IbPe-Rmr-_QvT2UlYBhywb2u08jlDBPWKz_86jj7teEMmEK72RDPPNTIUIQO4xeSpwPFQQmCC1gL0nYkK7MJYKq8bCr0ArPWHJFijUewmZkdWH6zKmlohSjwnTBt4JBJvqPlL5atizFRXKArZT3T687Z0JM2Iu3Kwv6yA4i9si2a1a_0G_8XgWV3diCfE60DPBRtyEqxhY2t8oQ4O4peb7Xn9EQ7bwSx8V2IQRTKYAC-ezdZxylwwEFpTvoKrxPrE-tqbv1z-ijHN-9NX67vW9hzqgGte-5d25sKjALMLh0TMEtaElKFw0YJSCSqHVRN6kmhgJ56CjcTL7uDs3bJ3dXZ3skUlkD_zMBRlZPEhBrTwFGmgei5xaBjkzAJHuGsbGtU9sHNcaRl_A3OUULzprqxxkp2cJF72H4BbXL_AbWsvS25B5oo2DqA579_aXs5aN4E8Wrx_ZWWu6j7UC_MZHhyP_wGtE-sxWjyBMx_h8uixkW8_3DT5JMLpiMKJ6aIRZxRtoQj9bvoFPxhmxtuSn42EWpTJwRM1_a3069QY5o104DN1OyWh_0LLomFf7sETRO0ujGje5J6xNXmYCNnQLb0R9a8Ius”}

Hi Satyam,
I am facing similar issues with healthId APIs.
For example - I am doing registration using Registration with Mobile APIs and could successfully execute api/v1/registration/mobile/generateOtp and api/v1/registration/mobile/verifyOtp, now next API to be used in order to create healthId is api/v1/registration/mobile/createHealthId’ and
its giving 500 internal error,
“code”: “HIS-500”,
“message”: “An unexpected error has occured. Please try again in sometime.”,
“details”: null
below is the CURL for my request -
curl --location --request POST ‘https://healthidsbx.ndhm.gov.in/api/v1/registration/mobile/createHealthId
–header ‘accept: /
–header ‘Accept-Language: en-US’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2MDgyODI4NDgsImlhdCI6MTYwODI4MjI0OCwianRpIjoiMTBiMDdkMGYtM2YzOC00NzIwLTk4NDctZDc4YjA5OWYxZWMxIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIwYTdlNTkzNy0yMWNhLTRlNGEtOTNkNy1mNWQwNDgwZjI1NzUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAwMTY1Iiwic2Vzc2lvbl9zdGF0ZSI6IjRlZDA4NWUzLWQ1YjYtNDI3Zi05NTYxLTg3Mjg1OWVlYTJjYSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiaGlwIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiU0JYXzAwMDE2NSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjguMjU0IiwiY2xpZW50SWQiOiJTQlhfMDAwMTY1IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMDE2NSIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjguMjU0In0.A9g8UjaDhXSXOVFzr7kBnD9b4PAH1m99PMU9cElXyI27GaBUo-G9rm-A1Es-VjvVuj5SwP9Sf8dDGasYcw9lj2O2Ri3pJe6lV7C0gPl_XR16-lGAe2OPst-25-hnhKhav6U1d82DxwBg8G6HqwBeymIzrJutHyQ6YoVu-nd2I275_gomykXpZqrpLWqhXbdV9ycDL1ul4ofb0KpAn62RLBAfy3JYFI4TBvaviyOWPK5lp8lzv6-A7Eol7EkBxapSaegfWa1sWUbZ-53vTlEuQ9NsBPPWFVzc8Ft_Gf0YIJpyQhnLOkPgTP_6u49FZmqeYB2zbWGvM5hfeq4hdQTUNw’
–header ‘X-HIP-ID: DPHIP119’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01c078b5=01115a1c90e1010ce7cbf61d24def85ee9777bbcaa910979514114ad7fa0817e31c27499a1b342fb35fd79aeb0630f1a93f3c05c82’
–data-raw ‘{
“address”: “xyz test”,
“dayOfBirth”: “9”,
“districtCode”: “9”,
“email”: “test@xyz.com”,
“firstName”: “test”,
“gender”: “F”,
“lastName”: “test”,
“monthOfBirth”: “9”,
“name”: “test”,
“pincode”: 194101,
“profilePhoto”: “string”,
“restrictions”: “UT”,
“stateCode”: “37”,
“token”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5NTYwMDI5Mzg0IiwiZXhwIjoxNjA4MjE0ODM5LCJpYXQiOjE2MDgyMDc2MzksInR4bklkIjoiZTNiN2E5ZjItOGNjZC00ODBiLWE2NDUtNGEyYjk3ODcxYTZmIn0.BcZWP-btgN1fMgfkfN8MH85FeuxGUmqy1bpC4l_iY14CDbRVQw_eRKfDuq5-bK_7U17pktZhCDdfKxTUHBldT0PUZ_xu5Ln-7Af6UeczhPKv60e79REflSUHbJrCDcNehw-anSP1ehpIvPUuzQBobsA0JpmJ0hWng-QX3oSMSgSFiBCAqS1PleVdW2iQ2jso20854AQS7JT6i12-S6cX5ZpJ3CCFHs3IuGAH-NSxdh-IuhdFVw0Huy-V_zy5nlDLyLVZuzvgQz-tMNBsfLFhIxa8CPlC-Ki6XntsdaxswjQPZPZvemYiD_OaT5MzZPyznNDbTBLVbvIgRes1eA2lBQYTaEbaPJgB4nCu5OZ49KNnS58Q51rMAIcZD2uF-5yBmgcvpndOqO7t9lf3c7iNb7rOq3qgcDcKm9MP_QtzTWsTAZyr3RJkcnGhdKtL7LozWC3JsxfeKnU4xOJlnmChtnqzu9g37nV0b6iHJbv-dgWPJYj2eedcabI2CjoIDpacMBznlfOe_ofUUvCej0vLSp6s_8FxqQVYMU_rOKarJ4qkN1xQNyzmVynevldeY78zbLfSKuI7JubCsmYC4ASsO6RTWU9QNZYScB_qagiy9j7Zh1E8dspaTK1_dw9Xi88WNA2aS0sE0-tdQuUGXet9c3BQ711soRsBFErXCbC_Hxs”,
“txnId”: “e3b7a9f2-8ccd-480b-a645-4a2b97871a6f”,
“yearOfBirth”: “1992”
}’

Can you please help?
I am guessing something that has to be done with request body, since I omitted the properties that are not known at this point in registration process.

Regards,
Pragati Varshney

did you solve the issue ? are you still looking for help

Hi Satyam,

Thanks for reaching out. Issue is resolved now. :slight_smile:

@IntegrationSupport getting internal server error while calling https://dev.abdm.gov.in/devservice/v1/bridges/getServices api

@Wasi_rehman Wrong CURL used. Use this curl. You can also search for any such topic in devforum as many time things are shared and resolved.

curl --location --request PUT ‘https://dev.ndhm.gov.in/devservice/v1/bridges/addUpdateServices’ \

–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2OTg4MzU2ODMsImlhdCI6MTY5ODgxNDA4MywianRpIjoiNmZjMTcwNzgtYzQ4Ni00NDlkLTg4OGUtOWI0MTJLCJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsIkhpZF9DaGlsZCIsImhlYWx0aElkIiwicGhyIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfSwiTkhBVEVTVF8wMDEiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX19LCJzY29wZSI6Im9wZW5pZCBlbWFpbCBwcm9maWxlIiwiY2xpZW50SWQiOiJOSEFURVNUXzAwMSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjcuMTg3IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtbmhhdGVzdF8wMDEiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY3LjE4NyJ9.WzySsBBS4A_4b_LV81V6refGTZfd4Ls2SABdX2OhiUZFVd5TwiLDYdxjZianWGd8N5LqnZwRRFSAMLsyYLBA7oI-Y92MUagkfsnFv-OSUxIKjsq_Zxtt1NY7ElIxpNBFFEt2D86NSD4Z_hgOtiOVjY4l-td-9TVldgPgig26bMBOThajJzQIfuDAHEZnSo9I-06wmzS5KrCbJJPNd1bYha3vX5iB5Tbk3Nm15hPXVrTgjJTDtopszNhhfEmt8sgZwam3b0y6ie06iM9VJScGT_DjbUUmOByLJNyEUGmKZ8NxwvIiiwmKyeVK-gcRUKFi4-6_GtxguOtBGlNynqGJ6Q’
–data ‘[
{
“id”: “S_Test”,
“name”: “S Test”,
“type”: “PHR”,
“active”: true,
“alias”: [
“S Test”
]
}
]’

used the same curl and same url but it works now.