Loading XMLHttpRequest Library

Avatar

Avatar

karanv22355550

Avatar

karanv22355550

karanv22355550

12-03-2018

Hey everyone, I am new to adobe campaign. I am trying to call an api within a javascript code icon. I am getting stuck when I try something like this var xhttp = new XMLHttpRequest(); Do I have to load the library in?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

daniell35335226

Avatar

daniell35335226

daniell35335226

13-03-2018

Hi,

Without further info, I cannot help in detail but here is an example that may get you moving if you want to call an api within a javascript activity in a workflow.

                   //Make web service call for each email address, licence key is set here

var http = new HttpClientRequest("APIURL");

http.connect();

http.execute();

http.dispose();

http.disconnect();

Let me know if you need more help.

Dan

Answers (4)

Answers (4)

Avatar

Avatar

jonase_2

Avatar

jonase_2

jonase_2

02-04-2020

Did you manage to solve this?

Avatar

Avatar

karanv22355550

Avatar

karanv22355550

karanv22355550

16-03-2018

Quick Question, Do you happen to know if there is a library to read the XML when I call the api? I tried using DOMParser but the library does not exist.

Avatar

Avatar

karanv22355550

Avatar

karanv22355550

karanv22355550

16-03-2018

Wow thank you very much! This helped me call the api!

Avatar

Avatar

karanv22355550

Avatar

karanv22355550

karanv22355550

12-03-2018

I forgot to mention that the error I get is, XMLHttpRequest is not defined.