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?
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.
- expected format: "Thu, 19 Oct 2017 16:12:42 GMT"
- mine was "Gio, 19 Ott 2017 16:12:42 GMT"
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.
Hey guys , i am getting response 401 ,my code is from http.client import HTTPSConnection from base64 import b64encode #This sets up the https conn response = requests.post(url, auth=requests.auth.HTTPBasicAuth( '****', '****')) #print(response.text)