OAuth 2 'forms' Scope Permission Problem

oauth
forms

#1

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!!


#2

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


#3

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!


#4

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


#5

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

Thanks


#6

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

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