cancel
Showing results for 
Search instead for 
Did you mean: 

Call WEB Services SAP IRPA

ludsonz
Discoverer
0 Kudos

Hi, I am having trouble using the custom script to get data from an API, I tested it by POSTMAN and it worked...
I need to get the token to go to the next step of the process, but I can't, the API documentation tells me to use this request method, the token. To use this APIs you need to use a Bearer token, which can be obtained through an API, passing a user and password to an endpoint, in this model:


to do this I converted the above code to javascript returning this code below, but the POST request is returning blank, but if I do it with POSTMAN it works, can you help me?

I have downloaded the web services from the store to try to use it, but I can't tell which automation is the most appropriate for this process

async function fetchToken() {
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
role: 'enterprise',
username: '',
password: ''
})
};
try {
const response = await irpa_core.request.call('https://api.trizy.com.br/iam/auth', requestOptions);
return response;
} catch (error) {
return error;
}
}
let response = await fetchToken();
return response.headers;

Accepted Solutions (0)

Answers (1)

Answers (1)

TJe
Product and Topic Expert
Product and Topic Expert
0 Kudos