a month ago
Good Morning,
I am attempting to put together an API call to generate a bearer token within Blue Prism Web API Services (I am using Blue Prism v6.10.5)
I am struggling to get the token to authorise and get the following message:
“Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 400
HTTP Response Content: {"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'. Trace ID: 99479596-c3ae-4bb1-bcf8-e4ea321c0400 Correlation ID: f84f1d9d-e2d3-465e-a911-073a9a7c6e58 Timestamp: 2025-05-14 08:07:05Z","error_codes":[900144],"timestamp":"2025-05-14 08:07:05Z","trace_id":"99479596-c3ae-4bb1-bcf8-e4ea321c0400","correlation_id":"f84f1d9d-e2d3-465e-a911-073a9a7c6e58","error_uri":https://login.microsoftonline.com/error?code=900144}”
I have got this working in Postman without issue and wondered if you could offer some support in getting it working?
Here is a breakdown of the settings in Postman and Blue Prism:
Postman:
In postman it’s a very easy setup and the bearer token generates without issue
I have tried various things in Blue Prism but this is the latest setup
I am passing in the Parameters (I have also tried hard coding in the Service) to the action created by the Web API Services:
Inside the Web API Service:
Common Headers:
Common Parameters:
Common Authentication:
Common Code: (this is where the issue might be, Do I have to pass anything into this?)
The Action:
Parameters: ( I have tried the parameters that I am passing in, in here as well as mentioned above in the common parameters. I have tried to hard code them and pass them in from the calling process)
Request: (I have tried adding code to the Body Content but it didn't seem to work and I got compiler errors, code I tried looked like the following?
{
"grant_type": "[grant_type]",
"client_id": "[client_id]",
"client_secret": "[client_secret]",
"scope": "[scope]"
}
Also tried hard coding the values
Headers: (I tried adding Accept and Content Type here as well as the Common parameters above)
Response:
Any help is greatly appreciated
Thanks
Answered! Go to Answer.
a month ago
In the Generate Bearer Token Action:
a month ago
In the Generate Bearer Token Action:
a month ago - last edited a month ago
Thank you for the response I have now got it working.