API call is not allowed(unsupported container)" in myAPI script

I am encountering an issue with myAPI script where I am receiving the following response:

{
  "statusCode": 400,
  "headers": {},
  "body": "{\"message\":\"API call is not allowed(unsupported container).\"}"
}

I am unsure about the meaning of the error message. Can anyone please explain it to me?

Here is the relevant code snippets. It is a POST or GET to a graphQL api:

main function snippet 
let productObj = exportObjDefinition_test(options,connection_id);
try {
    invokeExportResponse = exports.runVirtual({export:productObj});
     console.log(JSON.stringify(invokeExportResponse));
    response.statusCode = 200;
  } catch(e) {
    console.log("be")
    invokeExportResponse = JSON.stringify(e);
    response.statusCode = 400;
  }
function exportObjDefinition_test(options,connectionId) {
  let orderId = options.orderId;
  let orderNumber = options.orderNumber;
  return {
    "_connectionId": "${connectionId}",
   "http": {
        //"method": "POST",
        "method": "GET",
      "body": `{"query":"query {\n  languageList {\n    totalCount\n    edges {\n      node\n    }\n  }\n}","variables":{}}`,
        "formType": "http",
        "response": {
            "resourcePath": "data"
        }
    },
  "rawData": "removed",
    "adaptorType": "HTTPExport"
}
}

I also tried using formType: graph_ql, which also did not work. And also used an existing flowstep export and getting the export definition object > body via the Celigo REST (Postman), which gave me the same error.

Can anyone help me solve this issue? Thank you.

 

0

Comments

1 comment
Date Votes
  • Hi Nuri Ensing
    We have checked your request. If you make API request via Postman on "v1/:_myApiId/request", it will not return any error. In case of preview on UI, you might receive this error. We have logged a bug for this issue, will fix it soon.

    Thank you

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post