0

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

http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/using_ampscript_with_the_web_service_api/

2

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

http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/ampscript_syntax_guide/http_ampscript_functions/

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.

HTTPGet("http://www.example.com")

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.

https://help.exacttarget.com/en-US/documentation/exacttarget/content/server_side_javascript/server_side_javascript_syntax_guide/http_server_side_javascript_functions/

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.