API Call from javascript node in workflow

Avatar

Avatar
Validate 1
Level 1
Ramaswami
Level 1

Likes

0 likes

Total Posts

100 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
Ramaswami
Level 1

Likes

0 likes

Total Posts

100 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile
Ramaswami
Level 1

13-08-2020

Hi guys, 

 

i am trying to call an API from javascript node in a workflow llike below : 

 

var http = new HttpClientRequest("https://xxxxx/accesstoken")

var buffer = new MemoryBuffer()
buffer.fromString("abc" + ':' + "efg", "iso-8859-1")
http.header["Content-Type"] = "application/x-www-form-urlencoded"
http.header["Authorization"] = "Basic " + buffer.toBase64()
http.body = "grant_type=password&username=conny.roscher@dynata.com&password=PaneL321!@"
http.method = "GET"

http.execute()

var result = http.response.body.toString();
logInfo("Results = " + result)

 

i am getting the below error : 

 

JST-310026 The URL 'https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/accesstoken' that the script is trying to access is not part of the authorized addresses in urlPermission (serverconf.xml)

 

i saw in other posts that we need to whitelist so i went to control panel and added this url under instances>URL permissions but still the same error.

 

i saw in one other post to add in destination url : 

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-standard/how-to-perform-an-api-rest-...

but this is not clear. where should i add my url inorder to overcome this error. can you please eloborate

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

258 likes

Total Posts

372 posts

Correct reply

152 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

258 likes

Total Posts

372 posts

Correct reply

152 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile
DavidKangni
MVP

13-08-2020

Hi,

 

Please try to add this in control Panel. https://api.trustpilot.com

If it's still not working then contact support.

Thanks,

David

Answers (0)