SOAP UI and token

Hi,

I am trying to get the access token using SoapUi, but i am always getting a bad request. I am using the client credentials grant and I have tested that postman is getting the token without any problem using the same data so I assume SoapUi is changing something in my request.

Request:
POST https://login.mypurecloud.ie/oauth/token HTTP/1.1
grant_types: client_credentials
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {TREAT YOUR AUTH TOKEN LIKE A PASSWORD}
Content-Length: 0
Host: login.mypurecloud.ie
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Response
HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Tue, 15 Jan 2019 10:35:52 GMT
Inin-Correlation-Id: c5e65a05-8bf3-4aed-5a60-745312edbad5
Strict-Transport-Security: max-age=7776000
Content-Length: 28
Connection: keep-alive

{"error":"invalid_request"}

What I am missing?

Thank you

Regards

Please see here: https://developer.mypurecloud.com/api/rest/authorization/use-client-credentials.html

The required headers are Content-Type (application/x-www-form-urlencoded) and Authorization. The required form body is:

grant_type=client_credentials

You've misspelled grant_type as "grant_types".

You also should immediately delete your OAuth client configured in PureCloud, as you've exposed the encoded ID and Secret here, potentially giving others access to your org. Please anonymize any credential or token details posted here.

Hi Smith,

I must have made a mistake when typing the header

Thank you for your reply.

Regards

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.