Discussions

Ask a Question
Back to All

Issue with ServiceM8 OAuth Token Request

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
(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?