i am new to adobe campaign tool, trying to explore the possible ways to
1. send POST REST request to endpoint with JSON as input
2. get the response as JSON.
3. parse the JSON response for usage inside campaign.
i tried with GET REST request, got the response back.
var http = new HttpClientRequest("http://jsonplaceholder.typicode.com/posts/1");
http.method = "GET";
var resp = http.response;
Could you please share the sample code for POST call with jSON as input.
Solved! Go to Solution.
yes, but my question on POST method
var http = new HttpClientRequest("http://reqres.in/api/users");
http.header["Content-Type"] = "application/json";
above sample code, i tried to connect the endpoint but it doesnt work. can
you please help me to identify the error if any. thanks.
On Tue, May 8, 2018 at 2:00 PM, marcel.gent.86 <email@example.com>
Hmm. Seems we need to add the endpoint to server and admin is doing it.
when I am getting a JSON object, and also need to get the value
dynamically using key. But the below code works in Plain JS not in
Campaign. It is printing single character for every iteration in the loop.
Could you please help me to the parse JSON object, because the output is
console.log('Key : ' + key + ', Value : ' + data[key])})