cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BPA - HTTP request in automation fails

milli_k
Member
0 Kudos

Hi all!

I am currently working on an automation with SAP BPA that is supposed to query data from Azure via an HTTP request.

I have tried various solutions for this.

First, I tried the "Call Web Service" module with a custom script. Then I changed the script and tried to send the request from the script with "await irpa_core.request.call()".

I use the following script:

const options = {

url: '***',

method: 'POST',

responseType: 'json',

resolveBodyOnly:true,

headers: {

'Content-Type': 'application/x-www-form-urlencoded',

'Accept': 'application/json',

},

body: JSON.stringify({

grant_type': 'client_credentials',

'scope': 'https://graph.microsoft.com/.default',

'client_id': '***',

'client_secret': '***',

})

};

const response = await irpa_core.request.call(options);

const accessToken = response.access_token;

return accessToken;

I get this error message:

"The request body must contain the following parameter: 'grant_type'".

However, the grant_type is set in the body of the request.

Then I tried the module "Call Web Service with Destination" and got either the error message "The destination must be of type HTTP" or "Invalid Path: 'https://...'. Contains invalid characters: '//'. Please remove them.". The created destination was of type HTTP and the invalid characters cannot be removed from the URL.

I would be very grateful for your help.

Best regards

Milena

Accepted Solutions (0)

Answers (0)