Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!
SOLVED

Loading XMLHttpRequest Library

Avatar

Level 2

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?

1 Accepted Solution

Avatar

Correct answer by
Level 2

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

View solution in original post

5 Replies

Avatar

Level 2

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

Avatar

Correct answer by
Level 2

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

Avatar

Level 2

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.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now