WORLD CHECK ONE API | V2 | return 404 while calling | POST | cases/{<!-- -->{case-system-id}}/screen

Hi

I am using worldcheck One Api and i am using your collection request SEQ-screen-async: Screen an existing case (asynchronous)
NOTE : i put **** in public and secret key here but in code i use real one.
Method : POST
URL : {
{protocol}}{
{gateway-host}}{
{gateway-url}}cases/{
{case-system-id}}/screeningRequest

DATA: none

Problem
when i request using postman its working fine and return 201 status
but when i call this api from nodejs code it return 404

Here is the code

let caseSystemId = "5jb6a6c1cjda1hyqpz0yylxrf";

let worldCheckBaseUrl = "https://api-worldcheck.refinitiv.com";

let worldCheckGatewayHost = "api-worldcheck.refinitiv.com";

let worldCheckGatewayVersion = "/v2/";

let requestPath = `cases/${caseSystemId}/screeningRequest`;

let getCompleteUrl = worldCheckBaseUrl+worldCheckGatewayVersion+requestPath;

var date = new Date().toGMTString();

var dataToSign = "(request-target): post " + worldCheckGatewayVersion + `${requestPath}\n` +

"host: " + worldCheckGatewayHost + "\n" +

"date: " + date;

console.log("dataToSign",dataToSign)


let secret = "*************";

var hash = CryptoJS.HmacSHA256(dataToSign,secret);

var hmac = hash.toString(CryptoJS.enc.Base64)

var worldCheckPublickey = "**************";

var authorisation = "Signature keyId=\"" + worldCheckPublickey + "\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date" + attachedHost + "\",signature=\"" + hmac + "\"";


So the data to sign request output is

(request-target): post /v2/cases/5jb6a6c1cjda1hyqpz0yylxrf/screeningRequest

host: api-worldcheck.refinitiv.com

date: Fri, 01 Sep 2023 10:04:38 GMT

and authorization signature output

Signature keyId="***********",algorithm="hmac-sha256",headers="(request-target) host date",signature="8k2F4Z/gluAspNarnd/sPEzTDwvlckdMYTPIqfe4iCY="

Kindly help to sort this issue

Thanks

Best Answer

Answers