APIs & Integrations

Not applicable

How I can fetch all notes from each contact using API?

Hi Guys,

I am able to fetch each contacts, but I couldn't fetch notes from each contact using php with curl. Please share me if you have any help link or code.

Regards,
Krishna

0 Upvotes
8 Replies 8
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How I can fetch all notes from each contact using API?

Hi @krishna,

There aren't any additional permissions needed to fetch engagements. Can you give me an example contact in your portal that you're currently experiencing issues with?

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How I can fetch all notes from each contact using API?

Hi @krishna,

Ok so based on that, it looks like you're trying to pull all the engagements associated with a given company record? Is that right? If so, you'll need to get the companyId from the contact's associatedCompanyId field. If instead you're trying to pull the engagements associated with a particular contact record, you'll need to hit change COMPANY to CONTACT in your request URL.

0 Upvotes
Not applicable

How I can fetch all notes from each contact using API?

Yes, I am trying to fetch engagements in a contact. I'm still unable to fetch the engagement. Is there any special permission is needed? In below url 110454 is vid.

$url = 'https://api.hubapi.com/engagements/v1/engagements/associated/contact/110454/paged?limit=20&hapikey=x...';

0 Upvotes
Not applicable

How I can fetch all notes from each contact using API?

Do you have any sample code to fetch contacts + engagements. I want to export contacts and engagements into csv format. If I get data from api, I can write code to generate csv file. I'm stuck at getting data from hubspot using api.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How I can fetch all notes from each contact using API?

Hi @krishna,

Can you post the full request URL (except the api key) and the full response body so I can take a look? Are you sure you're using the correct hapikey?

0 Upvotes
Not applicable

How I can fetch all notes from each contact using API?

I am using URL as:
https://api.hubapi.com/engagements/v1/engagements/associated/COMPANY/78451/paged?limit=2&hapikey=xxx...';

Output:
array (size=3)
'results' =>
array (size=0)
empty
'hasMore' => boolean false
'offset' => int 0

I couldn't find COMPANY ID in the contacts list output.

Yes, I am using correct hapikey as I can retrieve contact list without any issue. Only problem in retrieving engagement.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

How I can fetch all notes from each contact using API?

Hi @krishna,

Notes are a type of engagement, so you can use the Engagements API to pull a record's associated engagements:

0 Upvotes
Not applicable

How I can fetch all notes from each contact using API?

I tried to fetch an engagement and it returns empty results. Do I need to add any parameter while requesting data?

array (size=3)
'results' =>
array (size=0)
empty
'hasMore' => boolean false
'offset' => int 0

0 Upvotes