For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
18 2 7 9

reference/countries API Call giving 401 Unauthorised when API and Secret API key are valid

Hi there,

We are using reference/countries API Call to get a list of countries. However, every time we have hit this we are getting a 401 Unauthroised. However when we use other API calls i.e. SEQ-2a Save a simple case we are able to get a response back.

Can you please check what is going on as this is having an affect on our application and our clients using this data product.

Cheers

Derek

world-checkworld-check-one
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

This case been resolved via C3R API

Upvotes
4.2k 7 5 6

Hello @dereka ,

I just tried using the API "SEQ-1d: Get the ISO country list" and am getting a successful response back from our server.

In order to further diagnose the issue, I would need logs from you when the error was encountered. As soon as I have the requested logs, I would troubleshoot further to fix the issue.

Can you advise if other GET requests are working fine?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
4.2k 7 5 6

Hello @dereka ,

In addition to the error logs, I would also like to know the below mentioned details that you are sending when making the failed API call.

Data To Sign:

Authorization headers:

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
18 2 7 9

Hi @Irfan.Khan,

Please find the following information that you requested.

Error Log from our Application

2018-03-15 08:26:09,774 [essageListener-4] ERROR MAJOR .t.w.c.r.TRWCOneSearchFormRepository - Unable to get countries/groups

java.lang.NullPointerException: null

at com.encompasscorporation.encompass.dataproducts.tr.worldcheckone.core.client.TRWCOneClient.getAllGroups(TRWCOneClient.java:292)

From our Development team some notes that they had when looking

  • Looks like the call to /groups has started to return no data
  • I saw a few other errors after the fact but it looks like they all stem from not being able to get the group and therefore not being able to create a case for the search.

Also please find some of the further information that you request, I wasn't sure where to find information on "Date to Sign"

Authorization headers:

Date: Thu, 15 Mar 2018 09:36:41 GMT

Authorisation: Signature keyId="1022ca04-d262-4f62-858f-ece9528db519",algorithm="hmac-sha256",headers="(request-target) host date",signature="WLi/JqrTOmDMkJ2TkcwwF75hlhEW8ieJrpvgNUVnetI="

I hope this helps

Derek

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
4.2k 7 5 6

Hello @dereka ,

I have checked the HMAC for your shared HTTP request example and it matches with the one that I am generating using your credentials. The error log you shared was for when calling the endpoint "countries". Can you please confirm that?

I also fired few APIs from your account but am getting a successful response from them. Can you check if the API requests to WC1 from Postman are working fine? This step is necessary so that we know where to look for the issue.

I see that your development team has advised that the endpoint "groups" too is unable to fetch data and fails with 401 unauthorized. Can you please provide me an example of calling the endpoint "groups" which failed in the below format:

Error log:

Request method:

Endpoint you are calling:

Host:

Authorization header:

Once I have the afore mentioned info, I will raise this with the tech team.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
4.2k 7 5 6

Hello @dereka ,

I have not received the information that I requested from you. Kindly note the information requested is critical for the issue to be resolved. Please provide the requested information so that I can raise it with our tech team.

Can you please confirm if the issue is related to the production environment or the pilot environment? The authorization headers you provided in the last reply has the API key that belongs to the Pilot environment. May be that is causing the issue as production environment would require the API credentials belonging to the production environment.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea