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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
1 0 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 5.0 MiB each and 10.0 MiB total.

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

and returned the same value of postman

Upvotes
Accepted
3.1k 16 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 5.0 MiB each and 10.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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea