V2 verifyOTP is not working

Hi,

App is calling https://dev.abdm.gov.in/api/v2/registration/mobile/login/verifyOtp for login with mobile with following POST parameters:
{
“otp”: “583974”,
“txnId”: “5fbdb58e-04de-416f-b9d5-b20d377XXXX”
}

Even though the OTP is correct, its giving following error message:
{
“code”: “HIS-400”,
“message”: “Request is invalid. Please enter the correct data.”,
“details”: [
{
“message”: “The OTP that you have entered is incorrect. Please try again.”,
“code”: “HIS-1013”,
“attribute”: {
“key”: “otp”,
“value”: “583974”
}
}
]
}

Please suggest what is wrong in above API request.

Regards,
Jignesh
@IntegrationSupport

@atulsharma can you plz check this and share why email OTP is not working. client-id is SBX_001988

Hi,

URL which I have used for the same is https://healthidsbx.abdm.gov.in/api/v2/registration/mobile/login/verifyOtp and NOT https://dev.abdm.gov.in/api/v2/registration/mobile/login/verifyOtp

@IntegrationSupport

v2 APIs need RSA encryption of sensitive data.
Here we encrypt with public key from https://healthidsbx.abdm.gov.in/api/v2/auth/cert.
Look into Encryption in your favoured programming language.
The resulting request body should look like :
{
“otp”: “KJVAqhOVzexVXQGSbMsEG+ur6ldmW5NGUDJ6+SHXmP8NyMtjgKQ6EJ7qjzo8s+Nzg2WZV8InusLRlxU1z80pynPahxuoMcHerwHd1IBONtZY9o50ehHrx55yjhpdbqVV0pTff2XLgofMWquUx7HLOjw7yX10ZmZqcIm98+tBffTFuU735rABuXH0d9sG6MsvXgBOCzl77bjUi0NAdSNly+1JSMtBhUrS4ni1HoHit2fjX2E82Dh8N+7zgjSUv9i2NMmSUxugaClSMa7fdHP0NfHtVfd2Jg+JpfkVp/ngts3kZXKrhmrPuunfSk6m3HIP10o+5zvx7sXUaMDbv4XtqZGYQ+KHy8zn2g5vNY89UnhnWHJlmybHkEosquF9rtAKWBXrhVrovkIgQd6V23cO589fOSOBg9YzZvmCOtG/7Fgw41pGpmV+0AuPzM6jZZohzBr4FKZzSSXWixxyvwv1elc8TtLO4lcwGmB3lvSgWTDmmAV4ff/hYma+F4qbq5Sc1HulwQDRpApAx+tQmAGgSQExeKC5KphcWBYdOEXf8UQ6zHmm2vCDc7MDaPmDopM9gm7bD3t8B/qhRCfFALdnMGgfp2X1aD2swfJ/bx841mOuFKpOX+H0WhDGQCoQzwflZpb7EJXpmu6cNlf9873P+bF1abluN7N/aecn6M6u2tk=”,
“txnId”: “5fbdb58e-04de-416f-b9d5-b20d377XXXX”
}

Hi,
Thanks for replying and solving this issue. Its working now.

Now,
https://healthidsbx.abdm.gov.in/api/v2/registration/mobile/login/userAuthorizedToken is giving internal server error 500.

POST Body
{
“healthId”: “{{healthId}}”,
“txnId”: “{{txnId}}”
}

{{healthId}} is encrypted healthIdNumber received from https://healthidsbx.abdm.gov.in/api/v2/registration/mobile/login/verifyOtp` API

Thanking you in advance.

Regards,
Jignesh
@IntegrationSupport

APIS for Registration by mobile is deprecated. Please use registration by aadhaar.

How do user login through mobile in that case? @IntegrationSupport

https://healthidsbx.ndhm.gov.in/api/v1/registration/aadhaar/generateOtp

is giving me

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. response
@IntegrationSupport

@IntegrationSupport @SagarKhengat Thank you for the response.

I have another doubt. I am working to share the patient profile with facility and for that I am using https://dev.ndhm.gov.in/cm/v1/patients/profile/share API. Request body in the same API has requestId, how can I get this requestId?

Please refer https://sandbox.abdm.gov.in/docs/build_hip
You need to add this in Pre request script so as to make it as a global variable.

$guid is basically a uid which generates code, it is a random number generated. You may also check this online.

A universally unique identifier (UUID) is a standardized format for identifier strings that are designed to be unique across all devices and systems. UUIDs are commonly used in computer systems to identify resources such as database records, files, or network connections. They are also sometimes referred to as globally unique identifiers (GUIDs).

UUIDs are usually generated using a combination of the current time, the device’s MAC address, and a random number. The resulting string is typically represented as a sequence of 32 hexadecimal characters, separated into groups by hyphens. For example, a UUID might look like this: “6ba7b810-9dad-11d1-80b4-00c04fd430c8”.

Because UUIDs are guaranteed to be unique, they are often used to avoid naming conflicts in distributed systems, where multiple devices might need to generate unique identifier strings.

@IntegrationSupport Thank you for your prompt response. I really appreciate it. Its working now.

@IntegrationSupport

https://dev.abdm.gov.in/cm/v1/patients/profile/share
Request Body:
{
“requestId”: “296e74fc-9c58-4e76-82a1-0e5b8e760c32”,
“intent”: {
“type”: “REGISTRATION”
},
“location”: {
“latitude”: “23.014509”,
“longitude”: “72.591759”
},
“hipDetails”: {
“hipId”: “IN3410000286”,
“code”: “10055-9999”
},
“source”: “ANDROID”
}

Response:
{“error”:{“code”:1500,“message”:“Unknown error occurred”}}

Its always giving 500 internal server error response

Please refer the payload given under documentation page - https://sandbox.abdm.gov.in/docs/build_hip