APIs & Integrations

MSmithson
Member

Difficulties with oAuth and the timeline event API

SOLVE

Hi, I have created a new app using my developer account so I can post timeline events to my contacts in my main hubspot account. I attempted to do this with the new V3 API here https://developers.hubspot.com/docs/api/crm/timeline but I was running into "This oauth-token (CM...) is not valid for this request!" error. Even when I was able to validate that it was an active access token by using it to hit this endpoint https://api.hubapi.com/crm/v3/objects/contacts?limit=10&archived=false. 

After reaching out through live chat I was advised to go to the hubspot slack group. I did some debugging with a couple nice people and made slightly further progress using the legacy V1 API https://legacydocs.hubspot.com/docs/methods/timeline/timeline-overview . I have now however hit another hurdle, when reaching the 5th step in the documentation of actually creating the timeline event to be displayed against a contact I receive a 500. This is specifically the PUT request. I don't know what could be causing the 500 and this is full the error response of my latest attempt:

 

{
"status": "error",
"message": "internal error",
"correlationId": "159cee73-a8b6-415a-a33f-3b9399c3a2e4"
}
 
This has taken a lot more time than I thought it would and I have other things to break. It would be great to get some advice on this from a tehcnical member of hubspot staff. Thanks.
0 Upvotes
1 Accepted solution
MSmithson
Solution
Member

Difficulties with oAuth and the timeline event API

SOLVE

As is always the case.... Seconds after posting this I found the solution. I looked at this similar post https://community.hubspot.com/t5/APIs-Integrations/issues-with-Timeline-Events-API/m-p/305940#M28962 and noticed in their postman API calls they sent the body as raw json strings and I was using form data. This resolved my issue.

I'll keep the post open incase someone else falls in this trap!

View solution in original post

1 Reply 1
MSmithson
Solution
Member

Difficulties with oAuth and the timeline event API

SOLVE

As is always the case.... Seconds after posting this I found the solution. I looked at this similar post https://community.hubspot.com/t5/APIs-Integrations/issues-with-Timeline-Events-API/m-p/305940#M28962 and noticed in their postman API calls they sent the body as raw json strings and I was using form data. This resolved my issue.

I'll keep the post open incase someone else falls in this trap!