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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
19 1 2 3

401 when asking for GetMyTopLevelGroups (SEQ-1a) by using Java code

Hi,

we are implementing a Java Client to call the WC Rest service, by following the sample code you provided (PFA the code in attachment). The point is we are obtaining a 401 Unauthorized error message every time we try to send a https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/groups request.

The problem occurs just when we send the request through Java code, it works properly if we send it through Postman (enabling with Postman Interceptor extension).

Is it due to wrong settings of the parameters we send with the request (i.e. apikey, apisecret) ? or something else?

Could you please help us?

Thanks

world-checkworld-check-onejavaerror-401
wcclientjava.txt (2.9 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
19 1 2 3

I found the solution by myself, and I'd like to share it, maybe it might be useful to someone.

The apikey and apisecret were correct, the problem was related to the Locale I used to generate the Date embedded in the "data to sign" object. I was wrong in generating it in Italian locale, the WC rest service expect the Locale.ENGLISH.

Example:

- expected format: "Thu, 19 Oct 2017 16:12:42 GMT"

- mine was "Gio, 19 Ott 2017 16:12:42 GMT"

Regards

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
3.1k 18 7 7

Hi @giovanni.parente,

I'm glad you found it, that would have been impossible to find looking at your code, although I did check to see you were using the GMT timezone, your Locale hadn't occurred to me. Perhaps not immediately obvious, what you found, is that the date is a string used in the signature as a string.

My sincere thanks to you for taking the time to post your answer. We'll certainly add your solution to our toolbox of client experience.

Brian

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.

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.