Freshchat API authentication failed

We tried accessing Freshchat API using endpoint - GET - https://api.freshchat.com/v2/agents/me. But, we got a response as 400 Bad Request.

Request:

GET - https://api.freshchat.com/v2/agents/me

Response:

Date: Fri, 07 May 2021 13:26:44 GMT
Content-Type: application/json
Content-Length: 166
Connection: close
server: fwe
strict-transport-security: max-age=31536000; includeSubDomains
x-envoy-upstream-service-time: 5
x-trace-id: 00-1ca8b994cffb9aa3ba0cbfadd9a0cc61-e72df6b39363aadb-00
x-fw-ratelimiting-managed: false
x-request-id: 9b2ff305-ff90-4f49-92d1-916890da02b4

{
“success”: false,
“error_code”: 0,
“error_message”: “JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.”
}

I have reset my API TOKEN and tried but unfortunately, it also threw the same error.

Please do let me know why I’m receiving this?

1 Like

Hi @rajezz

May I know which region is the Freshchat account belongs to? If you are not sure, you can message me with the account’s full domain URL. The API endpoint is specific to the region which the account belongs to.

api.freshchat.com - US
api.eu.freshchat.com - EU
api.in.freshchat.com - IN
api.au.freshchat.com - AU

3 Likes

Hi @Santhosh,

This occurred in one of our client’s account. We’re not sure where it belongs to. So, I’m adding the account URL below.
https://lovelyprofessionaluniversity-team.freshchat.com/

Please let me know which API endpoint works for this.

1 Like

@rajezz The Freshchat account you are trying is on the India data centre so the base URL for the same will be https://api.in.freshchat.com.

Also please note that the endpoint v2/agents/me is not a valid Freshchat API. So even if you update the base URL, the API will throw a 404 error.

Hope this helps.

4 Likes

@Arjun_Paliath Thanks for the clarification :slightly_smiling_face:. The endpoint - https://api.in.freshchat.com worked for us.

And noted the endpoint v2/agents/me is not a valid Freshchat API.

1 Like