Content Type header

Hi all,
Getting the below response from https://int.api.service.nhs.uk/oauth2/token

{
“error”: “invalid_request”,
“error_description”: “Content-Type header must be application/x-www-urlencoded”,
“message_id”: “removed…”
}

Seems simple enough error but I have “application/x-www-urlencoded” set as my Content Type.
I have also encoded the below as url encoded in the body of the request:

  • grant_type = client_credentials
  • client_assertion_type = urn:ietf:params:oauth:client-assertion-type:jwt-bearer
  • client_assertion = <your signed JWT from step 4>

First time requester so I’m sure it’s something simple. Anyone else have this problem?

Thanks in advance,
James.

Hi James,

Looks like you’ve spotted a bug in our error message!

The correct error message would read Content-Type header must be application/x-www-form-urlencoded - the form part was omitted in our message.

Thanks for getting in touch. I will open a ticket to fix this error message. Hopefully the above gives you enough information to continue.

Best regards,
Alex

3 Likes

Hi James,

The fixed error message has been deployed to the Integration environment. (A live release will follow in due course.)

Thanks for using the developer community to report this

Best regards,
Alex

1 Like