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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
1 1 1 0

(World Check One API) All requests returns 401 Unauthorized when using Angular 10

Hi Dear all,

Can anyone help me to resolve this issue ?. I am using Angular 10 to retrieve data by World Check One API. All requests have been blocked by CORS policy then I disabled security on browser (for testing purposes) and requests are returning error 401.

Note that in postman, all requests passed.


Looking forward any suggestions. Thanks in advance for your help.


world-checkworld-check-oneerror-401angular
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
Accepted
1.1k 3 1 2

@rnana

Hi,

I checked the logs to see if the request is hitting our servers and I can confirm that the last request that hit our servers from your keys was on 21st December and the 401 that you observed yesterday didn't reach our servers.

we suspect there is still an issue with the CORS on your side which may be blocking certain requests, can you check the code for any CORS issue?

Also, I would like you to hit a request bin target whose details I will send across via email so that I can capture all the details about the request that you're sending to check if there are any issues.

Email to follow.

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
1.1k 3 1 2

@rnana

Can you share the complete request and response header of the failed API call so that we can investigate it further?

401 errors occur because the request has failed an authorization check. This can happen for a variety of reasons, such as

  • An invalid or expired API key,
  • An invalid HMAC signature.
  • Request timing issue/problem with the Date header value. You should ensure a correctly synchronized clock is used to generate request timestamps.
  • Incorrect JSON payload formation at your end that can cause 401 response.


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
1 1 1 0

@Mehran Khan thanks for your response.

API_KEY_VALUE and API_KEY_VALUE are replaced by their value. these ones are hidden here for security reasons.


services.png (37.5 KiB)
erreur-401.png (31.4 KiB)
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
1 1 1 0

@Mehran Khan

Kindly find some screenshots: request and response header


header.png (37.7 KiB)
header-2.png (33.7 KiB)
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