Expand my Community achievements bar.

SOLVED

External API for posting data

Avatar

Level 4

Hi there, 

 

Has anyone tried external Api for Posting data to external API

I tried to use it but noticed it only tried to retrive data from the endpoint.

Is it only used for GET data?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee

Hello,

 

ExternalApi activity can perform a POST call too. You can define whatever valid json you want to send as POST body in the Customize Parameter section under Inbound Mapping tab. You can view the POST body that will be used for the request under POST body template section (which is greyed out and is read-only). If there is something in that section, it means externalApi activity will do a POST call.

 

Thanks.

View solution in original post

10 Replies

Avatar

Community Advisor

Hi,

The activity also can do HTTP POST to web services.

 

You can try:

* Define any query (can have record count 0)

* Then define any field mapping in the outbound mapping

This then shall trigger a POST call.

 

Thanks,

David



David Kangni

Avatar

Level 4

Hi David, Thanks for your reply. How do I define the method? It seems to be GET by default. I was able to establish connection when using Get method with end point but when I used end point for Post method, I got 400 error. I was trying to Post to https://graph.facebook.com/v7.0/<CUSTOM_AUDIENCE_ID>/users. The url, payload and token was working and tested on graph API. https://graph.facebook.com/v8.0/23845564964xxxxx/users?access_token=EAANkrpaqrfABANTbudbZAexxxx This is the json in the outbound mapping. Does it seem correct? How do I pass the inbound data to the API?

{ "data": [{ "EMAIL": "9b431636bd164765d63c573c346708846af4f68fe3701a77a3bdd7e7e5166254", "LOOKALIKE_VALUE" : " 44.5" } ] }

Avatar

Community Advisor

Hi

,Error 400 is usually response error. 

Here is the External API tutorial .

Hope it will help.

 

Thanks,

David



David Kangni

Avatar

Administrator

Hi @michellelowsl,

Were you able to resolve this query with the given solution? Do let us know.

Thanks!



Sukrity Wadhwa

Avatar

Level 4
Thanks Sukrity. Unfortunately I was still unable to resolve the issue. Is there any documentation that shows how to POST profiles from Adobe to other system using this activity in workflow?

Avatar

Administrator

I am not too sure but here's a documentation that might be helpful to you: External API 

In the meantime, I will reach out to our concerned SMEs for External API for your query. 



Sukrity Wadhwa

Avatar

Correct answer by
Employee

Hello,

 

ExternalApi activity can perform a POST call too. You can define whatever valid json you want to send as POST body in the Customize Parameter section under Inbound Mapping tab. You can view the POST body that will be used for the request under POST body template section (which is greyed out and is read-only). If there is something in that section, it means externalApi activity will do a POST call.

 

Thanks.

Avatar

Level 4
Hi pushkar, I wanted to perform POST Method using payload below { "schema": [ "EMAIL", "FN" ], "data": [ [ xxxx ] ] } . However, it's modified to {"params":{"schema":["EMAIL","FN"],"data":[[xxxx]]}} in Post Body Template. I guess it might be the reason of the failure. Do you have any suggestion to fix this?

Avatar

Employee
Hello, You can use a a translation would have to be carried out by an intermediary such as Adobe IO runtime action written specifically for translating from this JSON format to the format accepted by the API endpoint..