on 2023 Dec 01 10:14 AM
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
Request clarification before answering.
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.