403 Forbidden access - HubSpot pages endpoint


#1

I’m trying to hit the https://api.hubapi.com/content/api/v2/pages endpoint on hubspot. I have gone through the steps to get my access token and am using a test portal on HubSpot at the moment. I’m getting a 403 error. Is this more of a permission issue since I’m using a test account? Thanks

Sample CURL request Im using

curl -i ‘https://api.hubapi.com/content/api/v2/pages?archived=false&is_draft=false’ -H “Authorization: Bearer MY_ACCESS_TOKEN”

HTTP/1.1 403 Forbidden
Access-Control-Allow-Credentials: false
Content-Type: application/json; charset=UTF-8
Content-Length: 291
Date: Mon, 14 Aug 2017 17:24:51 GMT
Connection: keep-alive

{"correlationId":"f93c894f-0185-45b7-919a-352fdabda086","message":"This oauth-token (MY_ACCESS_TOKEN) does not have proper permissions! (requires any of [content-access])","requestId":"7d03160eaf1465bb064b656b1177267a","status":"error"}%

#2

This sounds like the requested scope when you generated the initial auth code did not include the necessary ‘content’ scope. (Although it’s listed in the response as ‘content-access’.) Can you verify that you requested the proper scopes for this API endpoint?


#3

Thanks that worked! My hubspot scope was set to contacts before.


#4

Don’t forget, you can pass multiple scopes by separating them with a space (or %20 as the case may be).