I get back a code and use it to authenticate https://api.hubapi.com/oauth/v1/token
with header “Content-Type” = application/x-www-form-urlencoded
and body x-www-form-urlencoded in POSTMAN to:
grant_type = authorization_code
client_id = my client id
client_secret = my secret
redirect_url = http://www.hubspot.com
code = code returned from step 1 above
NOTE: my dev portal id = 2712969
When I issue the request in POSTMAN I get 400 bad request:
{
“error”: “access_denied”,
“error_description”: “missing or invalid scopes”
}
I am back in business. After deleting and recreating my CRM - all my test deals, all my test contacts and all my test companies, I was able to successfully acquire a code and then an access token. I can now send API requests without errors. After the OAuth initiate call I was greeted by the grant permissions page to which I granted access:
thanks, you are correct. In my java code, I use the correct redirect URL back to my app. In the above post, I am just trying to get it to give me back an access token using POSTMAN. This request was working. This is the first time I am getting “missing or invalid scopes” error message. My assumption is that something must be different or has been changed in Hubspot land.
@jsimone are you getting that error in the POST to https://api.hubapi.com/oauth/v1/token to get the initial tokens? You using redirect_url instead of redirect_uri (L instead of I in uri), but that should be returning a different error.
Does your app have the contacts scope checked in the settings? Do you have any other scopes selected?
Developer portals don’t have access to any of the tools besides the developer tools, so they won’t be able to authorize an OAuth connection. If you only have a developer portal, you can create a test portal that can be used to test the authorization.