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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
53 2 4 6

World-Check-One API Authorisation using C#

Hello,

Does anyone have any code snippets for performing API Authorisation using C# and the Built-in HttpClient classes?

I have tried an implementation based on the Postman examples, but all I am getting via my calls is a 401, while the equivilant in Postman works perfectly fine.

world-checkworld-check-oneauthentication
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.

Upvote
Accepted
526 2 2 3

Hello @john.crocker

thank you for the data. As we discussed the sample data you've provided looks correct. The only problem was with value of the signature.

Easiest way to test it is to:
- comment dateToSign variable in Postman pre-request script
- create new variable using the data generated by your code, i.e.
var dateToSign = "(request-target): get /v1/reference/countries\nhost: rms-world-check-one-api-pilot.thomsonreuters.com\ndate: Mon, 26 Sep 2016 15:36:42 GMT";
- send the request using postman
- compare your signature with signature generated by the code

From my experience algorithm to generate signature should looks like:
- encode secret to sequence of bytes
- encode message to sequence of bytes
- create new instance of the HMACSHA256 class using the encoded secret
- compute hash from the encoded message
- convert result to base 64 string

In the internet you can find many examples of the algorithm in the different programming languages.

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
53 2 4 6

Hi Everyone - if I crack it in the meantime I will post a code snippet for anyone interested if that's ok?

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
526 2 2 3

Hello @john.crocker

would you be able to provide:

- example of string you use in your hmac function (in postman it's called DataToSign) i.e.

(request-target): post /v1/groups
host: rms-world-check-one-api-pilot.thomsonreuters.com
date: Tue, 07 Jun 2016 20:51:35 GMT

- all headers that are in your https requests (Host, Date, Authorization)?

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.

Hi Kamil

Will email full info seperate as it contains our API key

Upvotes
53 2 4 6

Is there any code samples being written for using the API?

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

I need to know about how can I make a request to the World-check one API. Can you please provide me the link for the sample code?

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
22 2 0 4

Hi Guys,

I have a client looking for the same answer to this last question from @krunal.b.patel

Can you please post some info on how this progressed?

Many thanks

Vanessa

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.

Upvote
3.1k 16 7 7
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