Refresh oauth 2.0 access token using refresh_token

Hi guys,

We have an external API for which we are currently authenticating using an access token. This access token has an expiry duration of 1 month so we need to find a way to automatize refreshing the access token using the refresh token provided by our external party.

Using Postman we need to:

  1. Send a POST call to the token URL
  2. Set authorization type with value OAUTH.20
  3. Mark add authorization data to request headers
  4. In the body section fill in below fields:
    x-www-form-urlencoded
    client_id
    client_secret
    refresh_token
    refresh_token=refresh_token

And it is working:

But in webMethods using the pub.client.http service I keep getting below response:

{
  "error":"invalid_request",
  "error_description":"Failed to parse request"
}

In the headers document I have Content-Type=x-www-form-urlencoded and I am using below URL:

%tokenURL%?client_id=%clientId%&client_secret=%clientSecret%&refresh_token=%refreshToken%&grant_type=refresh_token

Do you have any idea what is missing here?

Br,
n23

Hi

You would have to send the parameters via args for form URL encoded

Thanks a lot! Now it’s working :slight_smile:

1 Like