I am trying to update mobile number but am getting unauthorized error:
b'{"timestamp":"2023-08-23T11:47:54.030+0000","status":401,"error":"Unauthorized","message":"Unauthorized","path":"/api/v2/account/change/mobile/new/generateOTP"}'
API Sequence followed :
https://dev.abdm.gov.in/gateway/v0.5/sessions
https://healthidsbx.abdm.gov.in/api/v2/account/change/mobile/new/generateOTP
Data being sent:
session API :
credentials = {
"clientId": "SBX_001854",
"clientSecret" : "my-sandbox-secret"
}
generateOTP API:
{"newMobileNumber" : mobile_number}
headers:
{'X-Token': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2OTI4MTI4NjAsImlhdCI6MTY5Mjc5MTI2MCwianRpIjoiNDQ4MzZiZmEtYTNhZS00NTE0LTk5MDktMGY4OTA0ZTU2OGRmIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI5NDE1YmQ0Mi0yZTIxLTQ3NzQtYWFjNS1kODQ5OGNkNDE0YTAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAxODU0Iiwic2Vzc2lvbl9zdGF0ZSI6IjQ4ZjhmYWM0LTczOWUtNDliZi05ODY1LWMwNGNkZGM2YWMxYyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCIsImhwX2lkIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiU0JYXzAwMTg1NCI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudElkIjoiU0JYXzAwMTg1NCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiY2xpZW50SG9zdCI6IjEwLjIzMy42OC4yMzIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMTg1NCIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjguMjMyIn0.X6OMuYoWTuvptRIlXtpELYDIjVDACOOwjo82T2yecHsUy9Z1MyQB86-vgIjRPdNin4IOs3vi8A43UxoWgNRDTQpDrPx9Ou7NJHJvC7Xn0Uc_vYW9wrPYO00n0I7uICuFlK_9ZVximliJNdDQ0Bd_UsGNNxldf0HDVnW7j2KInrLS8cU5E_jzIN39pw_XzFcZTsGZ_FW1D4kcu9PdMCJbJORLpAYBwhPhmZgwTGxOd2HWiQULEv7yozm0EKrOdRw2-wu-ZhfSpmyla6e0KThQNKAi_zzkodkX432UrIVhxU9ZeKXRU78IYdbZmokz9HKatQ2OxCg2yyYAqRiryAeN6w', 'Accept-Language': 'en-US'}
X-Token is what I am getting from Sessions API
Please let me know what am I missing here?
Thanks