Not able to get the access_key with sample-python-app.

Hi,
I’m using the sample-apps-oauth/python and after the app authorization it throws an error.
I’ve already created the private app and added the client ID and secret.

Authorization failed because the provided scopes are insufficient. Please contact the app developer.

snippet on the landing page :-

// app/routes/oauth.py - Generate URL for OAuth
from hubspot.utils.oauth import get_auth_url
auth_url = get_auth_url(
 scopes=('contacts',),
 client_id=os.environ.get('HUBSPOT_CLIENT_ID'),
 redirect_uri=get_redirect_uri(),
)

@AT16 - perhaps there is some confusion between using Oauth and private app tokens here. You state you are using a private app and it’s associated scope settings. The auth token for any Python call using that method would be included in the header of an API call.

headers = {

‘Content-Type’: ‘application/json’,

‘Authorization’: 'Bearer ’ + api_token,

}

So that it could be used in the following way:

response = requests.request(“GET”, request_url, headers=headers)

Hope I don’t have the wrong end of the stick here.

Steve