Virtual Export using HTTP POST not working
Hi everyone,
I'm encountering an issue with the HTTP object configuration for a Virtual Export in Celigo integrator.io. I have the following HTTP object code:
I'm encountering an issue with the HTTP object configuration for a Virtual Export in Celigo integrator.io. I have the following HTTP object code:
const httpObject = {
_connectionId:"removed",
asynchronous:true,
oneToMany:false,
sandbox:true,
http:{
method:"POST",
body:JSON.stringify(payload),
formType:"http",
url:"/I have tried using a relative uri and a absolute url here",
headers: [
{name:"Content-Type",value:"application/json"},
{name:"Accept",value:"application/json"}
],
response:{resourcePath:"data"}
},
adaptorType:"HTTPExport"
};
I have tested the same JSON payload using Postman, and it works as expected. However, when I use this HTTP object in Celigo integrator.io for a Virtual Export, it doesn't seem to work properly.
I have verified that the JSON payload is valid and the endpoint URL is correct. The issue appears to be related to the HTTP object configuration in integrator.io.
I keep getting this as a response:
"error":"{\"code\":\"invalid_json\",\
"message\":\"An invalid JSON is sent in the response.body,
error: please ensure that you have wrapped all JSON property
names in quotes. details: Unexpected token D in JSON at position
1\"}"
When posting the exact same json via a flow step in Celigo or via Postman it does work, only via myApi I am getting this error.
I would greatly appreciate any insights or suggestions on how to resolve this issue. Is there anything missing or incorrect in the HTTP object code provided? Any guidance or alternative solutions would be really helpful.
I would greatly appreciate any insights or suggestions on how to resolve this issue. Is there anything missing or incorrect in the HTTP object code provided? Any guidance or alternative solutions would be really helpful.
Thank you in advance for your assistance!
0
-
I fixed it.
The solution was to use key relativeURI instead of URL.
And I needed to remove:
response: {
resourcePath: "data"
}1
Please sign in to leave a comment.
Comments
1 comment