Freshchat API Token not working 400 error

Hi,

One of my customer facing an issue while validating freshchat credentials java.lang.RuntimeException: Token not present,Please help me out with the fixes on high priority.

Please find Attachment!

Cheers,

@Furqan_Mehboob,
Good Day!
Can you please check the API which you are using to validate the API?
Freshchat has region-specific API’s,

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

Hope it helps :slight_smile:

Thanks

Hi @Santhosh ,

You mean I have to whitelist these domains?

@Furqan_Mehboob
Nope, its not about the whitelisting.
can you please give us the API which you are using?
and the region of the account?

Thanks

@Santhosh
Could you please let me know where I can find the region because its a customers environment.

Secondly I am using https://api.freshchat.com/v2/channels to validate freshchat Api , Which results in this error.

Cheer,

@Furqan_Mehboob,
the API which you are using is the US region,
and if your customer is in a different region then the API that you are using won’t work.
and if your app wants to work on all the regions then you need to validate your token all the regions and if your token is valid in any one region then you need to use that API for all other requests,
if your API is not valid for any one region then you need to throw the error,

Hope it helps :slight_smile:

kindly let me know if you are having any other questions

Thanks

Hi @Santhosh ,
Alright, So basically its a public app how could I validate on all regions ? Do I have to make request on all mentioned APIs :

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

And these are the only apis for all regions where customers could be from?

Cheers,

1 Like

Hi @Furqan_Mehboob ,
You are right, since we don’t know the customer is from which region you need to validate the token with all regions, and upon validating only one API will get success and others will fail,

And these are the only APIs for all regions where customers could be from?
Yes, these are the only APIs for all the regions where customers could be from.

hope it helps :slight_smile:

Thanks

@Furqan_Mehboob

Did the suggestion from @Santhosh help?

I guess we will need to do this trial and error approach to find the right region and start consuming APIs from then.

Hi @Santhosh ,

Yes now it working fine. Thank you for your time.

Cheers,

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.

We identified a pattern of asks around this topic.

Here’s a wiki article explaining the domains developers can use to consume APIs.