APIs & Integrations

ivo-1
Participant

Timeline Event Permission developers-read (/crm/v3/timeline/{appId}/event-templates)

SOLVE

Hi,

I'm trying to GET all timelline event templates in Python.

 

import requests

# bearer token obtained via redirect URI "code"
BEARER_TOKEN = "CMD<...>WgA"
APP_ID = "1036370"

headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {BEARER_TOKEN}"
}

url = f"https://api.hubapi.com/crm/v3/timeline/{APP_ID}/event-templates"

 
I get the following response:

403

{'status': 'error', 'message': 'This oauth-token (CMD<...>WgA) does not have proper permissions! (requires all of [developers-read])', 'correlationId': '53ca5c88-9adf-4cff-b6a2-6feb39bb89a6'}

First of all, this response is not helpful at all as there is no such thing as a developers-read scope. Second, and much more important, how do I get this to work?

This is the same issue as in here: https://community.hubspot.com/t5/APIs-Integrations/Authorisation-issues-calling-crm-v3-timeline-appI...

However the answer does not solve my problem. I am in fact a super user of the account of where I installed the app in and I still face the issue.

Kind regards,
Ivo

 

1 Accepted solution
wgdowski
Solution
HubSpot Employee
HubSpot Employee

Timeline Event Permission developers-read (/crm/v3/timeline/{appId}/event-templates)

SOLVE

Hi there, it looks like you are using a Bearer Token (App Access Token) to authenticate the request. The Access Token is unique to your custom app and to the live portal where the app is installed and it can only be used to push and fetch information from that CRM portal.

 

However, the timeline events are not stored in a CRM portal they are stored in your Developer portal. This means that the reuqest cannot be authenticated using an access token. Instead you will need to use something called "Developer API Key" found in your Developer Portal. Here is an article explaining where to locate this key: https://legacydocs.hubspot.com/docs/faq/developer-api-keys

Do note that your Developer API Key is different than the Hapi Key.

View solution in original post

3 Replies 3
GFrewin
Member

Timeline Event Permission developers-read (/crm/v3/timeline/{appId}/event-templates)

SOLVE

I can't get this to work. I am still getting the error of :

"This oauth-token (xxxx) does not have proper permissions! (requires all of [developers-read])\

The python method is: 
def get_all_events():
    headers = {
        'Authorization': f'Bearer {HUBSPOT_ACCESS_TOKEN}'
    }

    url = f"https://api.hubapi.com/crm/v3/timeline/{APP_ID}/event-templates"

    response = requests.get(url, headers=he)
    return response

as developer api keys are no longer a thing, I've tried different things in place of HUBSPOT_ACCESS_TOKEN. Mainly, the access token of a privateapp which is what the documentation says to use to replace developer api keys, and, the token that is return when I run the oauth flow for the connected app. 

Neither access tokens work, they both return this developer error. 

I can access contacts and companies just fine using just the private app key, but timeline events just doesn't seem to work. 


0 Upvotes
ivo-1
Participant

Timeline Event Permission developers-read (/crm/v3/timeline/{appId}/event-templates)

SOLVE

I have also validated that this same error arises when using the official hubspot-python-api package. See the code below:

# via hubspot provided api client (from hubspot.crm.timeline import ApiClient)
api_client = ApiClient(header_name="Authorization", header_value=f"Bearer {my_bearer_token}")
# from hubspot.crm.timeline.api.templates_api import TemplatesApi
template_api = TemplatesApi(api_client)
all_timeline_templates = template_api.get_all(app_id=int(SENDGRID_SYNC_APP_ID))



Additionally, I have verified that I am using a super-set of permission of another app which uses/creates timeline events in contacts called MailSyncApp (https://mailsyncapp.io/). Their install URL is:

 

https://app.hubspot.com/oauth/authorize?client_id=a021a415-969a-4747-a538-263e70d1b43e&scope=content%20timeline%20oauth%20crm.objects.contacts.write%20crm.objects.companies.write%20crm.objects.deals.write&redirect_uri=https://mailsyncapp.io/hs_oauth



This is my install URL: https://app-eu1.hubspot.com/oauth/authorize?client_id=1443c400-3b58-4967-b101-11bcf561c42d&redirect_...

Which includes all necessary scopes to my knowledge. 

0 Upvotes
wgdowski
Solution
HubSpot Employee
HubSpot Employee

Timeline Event Permission developers-read (/crm/v3/timeline/{appId}/event-templates)

SOLVE

Hi there, it looks like you are using a Bearer Token (App Access Token) to authenticate the request. The Access Token is unique to your custom app and to the live portal where the app is installed and it can only be used to push and fetch information from that CRM portal.

 

However, the timeline events are not stored in a CRM portal they are stored in your Developer portal. This means that the reuqest cannot be authenticated using an access token. Instead you will need to use something called "Developer API Key" found in your Developer Portal. Here is an article explaining where to locate this key: https://legacydocs.hubspot.com/docs/faq/developer-api-keys

Do note that your Developer API Key is different than the Hapi Key.