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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
5 1 0 4

calling WC1 API from CSharp is resulting into 401 unauthorised

I am trying to call WC1 /v2/refences/countries API from CSharp from Windows environment.

The response is 401 unauthorised. pls guide me where things are going wrong. thank you!
wc1-api-call.png

#productrest-apiworldcheck-one-apierror-401
wc1-api-call.png (33.7 KiB)
icon clock
10 |1500

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

Upvote
Accepted
546 4 0 2

Hi @ashwinikumar.


My initial assessment is that Date should be generated as GMT instead of manually adding GMT to the string. This could be the cause of the 401 error. I have also attached the C# code for authorization provided by World-Check for your reference - csharp.zip. This may help to solve this error. Thank you.

Regards,

Ssneha Balasubramanian.



csharp.zip (2.3 KiB)
icon clock
10 |1500

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

Actually I did few changes and every time I am getting the same response.

wc1-api-call-2.png

wc1-api-call-2.png (19.1 KiB)

WC1 API response.zip

here is the response file @ssneha.balasubramanian

Upvotes
546 4 0 2

Hi @ashwinikumar.


I am looking into this and will get back to you with a solution as soon as possible. Thank you.


Regards,

Ssneha Balasubramanian.

icon clock
10 |1500

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

Upvotes
546 4 0 2

Hi @ashwinikumar.


Can you also post the code of GenerateAuthHeaders() function? Thanks.


Regards,

Ssneha Balasubramanian.

icon clock
10 |1500

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

it's the same file which you shared to me in the 3rd last comment.

here it is! @ssneha.balasubramanian

AuthHeadersBuilder.zip

Upvotes
546 4 0 2

Hi @ashwinikumar.


Can you send me your email id? Thanks.


Regards,

Ssneha Balasubramanian.

icon clock
10 |1500

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

Thank you @ssneha.balasubramanian

I appreciate your help, now it's working!


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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