Http request - Get access token

Hey guys :slight_smile:

Im having abit of problems getting a access token via Http request in UiPath.

I can get the request to work in Postman. In postman im using a OAuth2 to get the token.

image

I made a dictionary containing the below combinations in uipath that i convert to json using assign.

grant_type = client_credentials
client_id = client id
client_secret = client secret
scope = “”

When i try to pass the access info into the body of http request (as json string), i get error code 400.

Endpoint is the url for the token.

Hope theres a clever person who has the answer :slight_smile:

Thanks in advance!

Found the answer myself. For those interested, the variables to get to token needs to passed as parameters in the http request.

/cheers

Hi Bjorn,

I’m trying to get an authentication token for O365 using the Http Request activity in UiPath, and I thought that this post might be relevant.

In using OAuth2 to get the token, what did you pass in the Properties panel of HttpClient activity?

Thanks in advance!

Cheers,
Shearer Tan

Hi Bjorn,
Are you able to provide a screenshot of your parameters in the HTTP Request activity?
I’ve fallen into the same scenario as yourself.
TIA!

Hi Guys,

Managed to get it to work with the following setup in the Parameters properties:


image

Additionally, what my issue was I was missing the Authorisation in the Header:
image

Hope this helps anyone landing in the same spot. :upside_down_face:

1 Like