I have an endpoint that is expecting data that is close to the below format (recipient object is required). I want to send this data after execution in my journey. The data is coming from my entry source (data extension). Here is documentation to the API I am wanting to send my POST to: API DOC
{
"campaign_id": "",
"recipient": {
"first_name": "",
"last_name": "",
"company": "",
"email": "",
"address_1": "",
"city": "",
"state": "",
"postal_code": "",
"identifier": ""
}
}
In my config JSON, below is how I have successfully posted data to a postbin from my DE. Now, my issue is that the endpoint I want to use ONLY accepts the ABOVE data and nothing else. However, when I POST with the working format below it will come with additional data that is not accepted by the endpoint.
"arguments": {
"execute": {
"inArguments": [
"first_name": "{{Event.Entry-event-key.first_name}}",
"last_name": "{{Event.Entry-event-key.last_name}}",
"company": "{{Event.Entry-event-key.company}}",
"email": ""{{Event.Entry-event-key.email}}""
],
"outArguments": [],
"url": "postbin endpoint url",
"verb": "POST",
"body": "",
"header": "",
"format": "json",
"useJwt": false,
"timeout": 10000
}
}
In addition, the endpoint also requires custom headers for access. Is it possible to do this kind of POST to an API from JB? One that only requires specific fields and nothing else?
If so, how can this be done? Is there a way to access the data I am pushing out of my custom activity? Clearly I am able to post it to postbin in the request body at this point. Maybe I need to push my DE data to an endpoint where I can again GET the data, rework it, and then POST it to the API in it's required format?
What is the best practice here?