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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
1 1 1 1

Please help me with a question about WC1 API and special characters

Hello, I was testing our implementation in Java with a simple request to the Pilot environment, using a POST request to the uri (rms-world-check-one-api-pilot.thomsonreuters.com/v1/cases) and was getting a response back with the unauthorized 401 error when I sent a name with special character. But this error only happend when I sent a name with special character like in the example:

{ ... "providerTypes":["WATCHLIST"], "name":"Tést" }

If I send a company name without special character, the test works. Testing in postman it works even with special character, but I can't see why. Thanks Vitor

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

I set the content length like this:
"return text.getBytes().length;"

and returned the same value of postman

@vitor.valerio
Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
AHS

Upvotes
Accepted
3.1k 18 7 7

Hi @vitor.valerio,

You must ensure your code is utf-8 and the byte count is encoded.

var contentLength = unescape(encodeURIComponent(content)).length;

Hope this helps,
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.

Upvote
286 3 3 3

Hi @vitor.valerio,

In java you can handle special character using below line of code.

String value = new String(jsonBody.getBytes("UTF-8"))

The value of jsonBody is given below.

String jsonBody = "{\"secondaryFields\":[],\"entityType\":\"INDIVIDUAL\",\"customFields\":[],\"groupId\":\"418f28a7-b9c9-4ae4-8530-819c61b1ca6c\",\"providerTypes\":[\"WATCHLIST\"],\"name\":\"Tést\"}";

Hope this helps.

Thanks,

Shilpi

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.