question

Upvotes
Accepted
1 0 1 4

top level group api 401 Unauthorized on all API Calls (SEQ-1a: Get my top-level groups)

function generateAuthHeader(dataToSign){
var hash = CryptoJS.HmacSHA256(dataToSign,environment["api-secret"]);
pm.globals.set("variable_key", "variable_value");
return hash.toString(CryptoJS.enc.Base64);
} var date = new Date().toGMTString(); var dataToSign = "(request-target): get " + environment["gateway-url"] + "groups\n" +
"host: " + environment["gateway-host"] + "\n" +
"date: " + date;
var hmac = generateAuthHeader(dataToSign);
var authorisation = "Signature keyId=\"" + environment["api-key"] + "\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date\",signature=\"" + hmac + "\""; postman.setEnvironmentVariable("authorisation",authorisation);
postman.setEnvironmentVariable("currentDate",date);

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

Upvotes
Accepted
245 1 0 2

Hello @Mostafa

Couple of things needs to be checked.

1. Please make sure you have put the right URL, API key and API Secret key in the Postman environment

2. The date is included in the Authorization Signature. Assuming you did not change anything with the request, please sync your clock

3. If you are using Chrome extension please make sure that you have Interceptor turned on

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.

Upvotes
21 0 0 0

Hi @Mostafa can you confirm that this question is about the Connected Risk API? Thanks.

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.