APIs & Integrations

Not applicable

OAuth 2 'forms' Scope Permission Problem

I’m trying to get form information via the forms API and I get the error “This oauth-token (XXXX) does not have proper scope group permissions!” I am using OAuth 2.

The url that I’m trying to hit is “/forms/v2/forms” and the authentication url I used was “https://app.hubspot.com/oauth/authorize?client_id=<client_id>&redirect_uri=<redirect_uri>&scope=content%20forms”

I’m not having any trouble accessing the content API, but even if I just have ‘forms’ as the value of the scope query param I still get the same authentication error. Is there something that I am doing incorrectly when building the url to get the OAuth token?

Thanks!!

0 Upvotes
5 Replies 5
Not applicable

OAuth 2 'forms' Scope Permission Problem

@dadams
I was able to get the forms by adding contacts to the scope.

Thanks

0 Upvotes
derekcavaliero
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

OAuth 2 'forms' Scope Permission Problem

@dadams I am having the same issue as @seanag see this topic:

Seeing something strange while working with OAuth and the forms API. I have a simple application that only requires access to the forms here’s my form to request access: <form action="https://app.hubspot.com/oauth/authorize" method="GET" id="authForm"> <input type="hidden" name="client_id" value="b6dc1f3c-2c29-4411-913a-3bfa646ecab6"> <input type="hidden" name="scope" value="forms"> <input type="hidden" name="redirect_uri" value="https://my-return-url.com/au…

This needs to be corrected - the forms scope shouldn’t require the contacts scope to function - otherwise why have 2 different scopes at all?

Derek Cavaliero
Director of Engineering

WebMechanix
www.webmechanix.com
0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

OAuth 2 'forms' Scope Permission Problem

Hi @seanag

Are you seeing an authentication error when authorizing the app with the forms scope? Or just with that 403 error when actually hitting the Forms API, after getting a token that should have the forms scope?

If you check the details of the token you’re using when you get that scope group permissions error, does it include the forms scope?
https://developers.hubspot.com/docs/methods/oauth2/get-access-token-information

0 Upvotes
Not applicable

OAuth 2 'forms' Scope Permission Problem

Hey @dadams,

Thanks for responding! I’m not getting an authorization error when authorizing the app with the forms scope. I’m just getting the 403 scopes group permissions error when trying to use that token to access the forms api.

When I check the details of the token this is what I get in the metadata about the scope of the token:
“scopes”: [
“content”,
“oauth”,
“forms”
],

Thanks!

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

OAuth 2 'forms' Scope Permission Problem

I need some other details for this. I’ll message you directly.

0 Upvotes