Expand my Community achievements bar.

SOLVED

How to perform an API REST call through a Web App ?

Avatar

Level 5

Hi,

We (me and my team mates) need to perform an API REST call from a Web App hosted on Adobe Campaign platform.

This call is directed to an external system.

We made a test using the following test url: https://jsonplaceholder.typicode.com/posts/1.

(Note that this one is just a test, not the one we are going to use for real)

Every time we perform this api call we gain the following error :

JST-310026 The URL 'https://jsonplaceholder.typicode.com/posts/1' to which the script is trying to acces is not part of the authorized addresses in urlPermission (serverconf.xml)

This is the javascript code we are using to execute the REST call

      var http = new HttpClientRequest("https://jsonplaceholder.typicode.com/posts/1");

       http.method = "GET";

       http.execute();

       var resp = http.response;

May anyone tell us how it is possible to solve this issue?
Thanks for help as usual,


Salvatore


Vipul Raghav

Amit_Kumar

Adhiyan

Jean-Serge Biron

florentlb

Adobe Campaign

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Salvatore,

As said in others posts (such as Re: Personalization field to include URL not working? ), since build 8857 (July 2017), the urlPermission whitelist in serverConf.xml is mandatory for Javascript calls to external URL (from server side of course).

Please add your destination URL as is:

<url dnsSuffix="jsonplaceholder.tipicode.com" urlRegEx="https://.*"/>

or more complex regex if only some pages must be accessible.

Regards.
JS

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi Salvatore,

As said in others posts (such as Re: Personalization field to include URL not working? ), since build 8857 (July 2017), the urlPermission whitelist in serverConf.xml is mandatory for Javascript calls to external URL (from server side of course).

Please add your destination URL as is:

<url dnsSuffix="jsonplaceholder.tipicode.com" urlRegEx="https://.*"/>

or more complex regex if only some pages must be accessible.

Regards.
JS