# INT Token Endpoint - error grant\_type is missing

**URL:** <https://developer.community.nhs.uk/t/int-token-endpoint-error-grant-type-is-missing/1024>\
**Category:** e-Referral Service (e-RS)\
**Tags:** cis2, authentication, integration, testing\
**Created:** [1 July 2024 16:32 UTC](https://developer.community.nhs.uk/t/int-token-endpoint-error-grant-type-is-missing/1024 "2024-07-01T16:32:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![integration\_uk](https://avatars.discourse-cdn.com/v4/letter/i/eb9ed0/32.png) [@integration\_uk](https://developer.community.nhs.uk/u/integration_uk)\
**Post date:** [1 July 2024 16:32 UTC](https://developer.community.nhs.uk/t/int-token-endpoint-error-grant-type-is-missing/1024/1 "2024-07-01T16:32:32Z")

</div>

I am in the process of completing our development of the new CIS2 authentication with eRS and am currently on step 5:

> **[User-restricted RESTful APIs - NHS Care Identity Service 2 combined...](https://digital.nhs.uk/developer/guides-and-documentation/security-and-authorisation/user-restricted-restful-apis-nhs-cis2-combined-authentication-and-authorisation#step-5-exchange-authorisation-code-for-access-token)**
>
> Learn how to integrate your software with our user-restricted RESTful APIs - using our NHS Care Identity Service 2 combined authentication and authorisation pattern.

Sending the expected payload however is throwing an error and I’m unable to determine what is wrong as the grant\_type is included:

(values modified for security)  
curl --location --request POST ‘[https://int.api.service.nhs.uk/oauth2/token?client\_id=[OUR\_APP\_ID]&client\_secret=[OUR\_APP\_SECRET]&redirect\_uri=[OUR\_URL]&grant\_type=123&code=123](https://int.api.service.nhs.uk/oauth2/token?client_id=%5BOUR_APP_ID%5D&client_secret=%5BOUR_APP_SECRET%5D&redirect_uri=%5BOUR_URL%5D&grant_type=123&code=123)’   
–header ‘Content-Type: application/x-www-form-urlencoded’

However the response I get back is:  
{  
“error”: “invalid\_request”,  
“error\_description”: “grant\_type is missing”,  
“message\_id”: “rrt-6783935314234691558-c-geu2-22818-486135-1”  
}

Does anybody have any advise on this endpoint? I’m declaring the grant\_type so not sure how to resolve this?

---

<div class="post-metadata">

**Author:** ![integration\_uk](https://avatars.discourse-cdn.com/v4/letter/i/eb9ed0/32.png) [@integration\_uk](https://developer.community.nhs.uk/u/integration_uk)\
**Post date:** [4 July 2024 10:29 UTC](https://developer.community.nhs.uk/t/int-token-endpoint-error-grant-type-is-missing/1024/2 "2024-07-04T10:29:33Z")

</div>

I believe this has been resolved due to the message payload being sent back not correctly registering the content-type as url-encoded.
