Is it true that only Soap/Web Service API can be used with Ampscript? What about Ampscript and REST API?


1 Answer 1


You can perform GET and POST methods to perform REST API calls.


Create your AMPscript using the functions below and place them in the content areas of landing pages and email messages. For example, you can use the URLEncode() function to encode spaces or non-alphanumeric characters contained in a URL for use by your subscribers.


There are also methods to update headers if that's needed, as well. Passing data may also cause some difficulty and the issue is if the result is JSON, there isn't a great way to handle it.

Depending on the situation, you would be better off with SSJS, but if this happening during a send, it's best to get the data prior to sending anything. If it's on a landing page - you would be ok.


You can use the HTTP server-side JavaScript functions to perform HTTP GET and HTTP POST actions and use that information as part of your interactions with the ExactTarget application.

var url = 'http://www.example.com';
var headerNames = ["MyTestHeader1", "MyTestHeader2"];
var headerValues = ["MyTestValue1", "MyTestValue2"];
var response = HTTP.Get(url, headerNames, headerValues);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .