External API request fails with error: Fail to parse request json
Hello Experts,
I am using the PostJSON of ContentLoaderFunctions to retrieve some data form 3rd party application and i have this error as output:
"error-info": "Fail to parse request json",
"http-status": 400
below the code of my snippet:
let HmacHeaders = {
'Content-Type':'application/json',
'Accept':'*/*',
'Accept-Encoding':'gzip, deflate, br',
'X-HP-HMAC-Authentication': '****************************************************',
'X-HP-HMAC-Date': '2021-05-26T12:31:19.292Z',
'X-HP-HMAC-Algorithm': 'SHA1',
};
let Hmacurl="https://*************************/api/3d/v2/jobs/_search-by-orgs";
let Hmacbody={
"aaa-org-ids" :
"**********************************",
"start" : "2021-05-03",
"end" : "2021-05-09",
"active" : "false"
};
let params = {
headers: HmacHeaders /* JSON */,
url: Hmacurl /* STRING */,
body:Hmacbody
};
// result: JSON
let result = Resources["ContentLoaderFunctions"].PostJSON(params);
and as output i have while i am expecting data in JSON format:
{
"headers": {
"Accept": "*/*",
"X-HP-HMAC-Authentication": "***************************************************",
"X-HP-HMAC-Algorithm": "SHA1",
"Accept-Encoding": "gzip, deflate, br",
"X-HP-HMAC-Date": "2021-05-26T12:31:19.292Z",
"Content-Type": "application/json"
},
"error-info": "Fail to parse request json",
"http-status": 400
}
Thanks in advance,
