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

Overview |  Quickstart |  Documentation |  Downloads

question

Upvote
Accepted
31 1 2 2

400 when Posting a case

when trying to post a new case in php, I keep getting a 400 response after around 20 seconds. I'm using php's file_get_contents along with stream_context_create. I have successfully retrieved a case this way using the following request object:

[method] => GET
[url] => https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/cases/0a599156-6eb7-1e40-9bb3-2aae00039721
[header] => [
    [Date] => Tue, 10 Dec 2019 14:57:56 GMT
    [Authorization] => Signature keyId="0b8f7e24-16d0-4672-9234-9b07b84d90d3",algorithm="hmac-sha256",headers="(request-target) host date",signature="qDJDsCI8vxWgcPXbQG21zV5F89+G932NPGrH90AvKeU="
]

[content] => 

[wrapper] => http
[options] => [
    [http] => [
        [content] => 

        [header] => [
            [0] => Date: Tue, 10 Dec 2019 14:57:56 GMT
            [1] => Authorization: Signature keyId="0b8f7e24-16d0-4672-9234-9b07b84d90d3",algorithm="hmac-sha256",headers="(request-target) host date",signature="qDJDsCI8vxWgcPXbQG21zV5F89+G932NPGrH90AvKeU="
        ]

        [method] => GET
    ]
]

That returns the case as expected. The following request object is what keeps returning a 400 response:

[method] => POST
[url] => https://rms-world-check-one-api-pilot.thomsonreuters.com/v1/cases
[header] => [
    [Date] => Tue, 10 Dec 2019 14:56:17 GMT
    [Content-Type] => application/json
    [Content-Length] => 233
    [Authorization] => Signature keyId="0b8f7e24-16d0-4672-9234-9b07b84d90d3",algorithm="hmac-sha256",headers="(request-target] host date content-type content-length",signature="+pY/EAeJtN5/nGlVLN0ux/0j56ItyZd+ghpNRcutxXg="
]

[content] => [
    [groupId] => 0a3687d0-6d92-196f-9b87-2dc30000256c
    [caseId] => 1238
    [entityType] => INDIVIDUAL
    [providerTypes] => [ [0] => WATCHLIST ]
    [name] => Joseph
    [customFields] => []
    [secondaryFields] => []
]

[wrapper] => http
[options] => [
    [http] => [
        [content] => [
            [groupId] => 0a3687d0-6d92-196f-9b87-2dc30000256c
            [caseId] => 1238
            [entityType] => INDIVIDUAL
            [providerTypes] => [ [0] => WATCHLIST ]
            [name] => Joseph
            [customFields] => []
            [secondaryFields] => []
        ]

        [header] => [
            [0] => Date: Tue, 10 Dec 2019 14:56:17 GMT
            [1] => Content-Type: application/json
            [2] => Content-Length: 233
            [3] => Authorization: Signature keyId="0b8f7e24-16d0-4672-9234-9b07b84d90d3",algorithm="hmac-sha256",headers="(request-target) host date content-type content-length",signature="+pY/EAeJtN5/nGlVLN0ux/0j56ItyZd+ghpNRcutxXg="
        ]

        [method] => POST
    ]
]


world-checkworld-check-one
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
31 1 2 2

I discovered the reason this wasn't working was because I was sending my content as a JSON/php associative array, while the server expects it to be stringified/json_encoded.

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.

@d.marcella,

Thank you for the confirmation.

Upvotes
4.5k 4 7 8

@d.marcella,

Thank you for your query and sharing the details.

Can you please share the raw JSON request paylad which you are sending for the POST API request?

Also, can you please share the raw headers of the failed GET API request to investigate on the cause of Error 400?

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.