# Issue with ServiceM8 OAuth Token Request

**URL:** <https://community.servicem8.com/t/issue-with-servicem8-oauth-token-request/275>\
**Category:** API & SDK\
**Created:** [March 13, 2025, 3:32pm UTC](https://community.servicem8.com/t/issue-with-servicem8-oauth-token-request/275 "2025-03-13T15:32:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@developer](https://community.servicem8.com/u/developer)\
**Post date:** [March 13, 2025, 3:32pm UTC](https://community.servicem8.com/t/issue-with-servicem8-oauth-token-request/275/1 "2025-03-13T15:32:48Z")

</div>

**Originally posted by rojin saji**

Currently, I created a developer account in my ServiceM8 account. In that, I created an item and received the Client ID and Secret ID. Using these credentials, I requested an authorization code and successfully received the code in the URL parameter of the redirect URL.

After that, I sent a POST request to obtain the access token and refresh token, but I encountered the following error:

json  
Copy  
Edit  
{  
“error”: “invalid\_request”,  
“error\_description”: “The grant type was not specified in the request”  
}  
My actual POST request URL is:

bash  
Copy  
Edit  
[https://go.servicem8.com/oauth/access\_token/?grant\_type=authorization\_code&client\_id=354&client\_secret=c40a2285ace9c91b&code=2055071a4f30b10&redirect\_uri=http://localhost:8000/accounts/create-opportunity](https://go.servicem8.com/oauth/access_token/?grant_type=authorization_code&client_id=354&client_secret=c40a2285ace9c91b&code=2055071a4f30b10&redirect_uri=http://localhost:8000/accounts/create-opportunity)  
(Note: The tokens are partially hidden for security reasons.)

Why am I getting this error? Is there anything else I need to do to resolve this?
