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

Options

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

Best Answer

  • giovanni.parente
    giovanni.parente Newcomer
    Answer ✓

    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

Answers

  • 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