Unsupported_grant_type Error while invoking pub.client:http

Hi,

I am getting unsupported_grant_type error while trying to get an access token from SalesForce URL through the pub.client:http from SoftwareAG. But if I try the same from Postman, it’s returning the Access Token. Below is how I am passing the parameters to the pub.client:http.

I am passing in the values as shown above.
URL =
method = post
auth : type = bearer (also tried empty)
auth: user = empty
headers : content_type = application/json
grant_type = password
client_id = entered
client_secret = entered
username = entered
password = entered

But it gives unsupported_grant_type error while invoking this service. Can you please let me know if there is anything I am missing?

Looks like the parameters you’re passing are specified as headers. You’ll want the grant_type, client_id, etc. as fields under data/args. And don’t specify a content_type (which is the wrong header name in any case – it is Content-Type and is not needed in this case; http will set it for you when you specify the fields in data/args).

Edit: or you might be able to set the client_id and client_secret as the inputs via auth/user and auth/pass with auth/type set to Basic. Not sure what SalesForce supports for sure. May not need the client_id/secret at all. Whatever you did in Postman, make sure you’re doing the same thing in the http call – parameters in data/args, headers in headers, etc. If you’re unsure about is the equivalent to what you did in Postman, share the details of the Postman setup and we can provide how to do the same in the http call.

Thank you so much. That worked perfect when I passed all the parameters in data/args as you mentioned.

This topic was automatically closed after 1083 days. New replies are no longer allowed.