AnsweredAssumed Answered

JQuery Ajax Request in Boomi

Question asked by blake.lassiter285843 on Aug 3, 2016
Latest reply on Aug 3, 2016 by blake.lassiter285843

Is it possible to make a call to an api using javascript in Boomi? I have been entirely unsuccessful in using the connectors that exist, but can make the correct call outside of boomi using JavaScript.

 

The only place that I've seen javascript is in the map shape. Can I use ajax in that? I would like to use the following code:

 

POST /{site_realm}/tokens/OAuth/2 HTTP/1.1
Host: accounts.accesscontrol.windows.net
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&client_id={client_id}&client_secret={client_secret}&refresh_token={refresh_token}&redirect_uri={redirect_uri}&resource={resource}

 

The Ajax version is:

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://accounts.accesscontrol.windows.net/{site_realm}/tokens/OAuth/2",
  "method": "POST",
  "headers": {
    "content-type": "application/x-www-form-urlencoded"
  },
  "data": ""
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

both of these were created from Postman "generate code" button from a successful call

Outcomes