APIs & Integrations

caiorochap
Participante

Unknown fields in Engagements API response

resolver

Hi, I've been trying to extract some data from the Engagements API and found some fields not mapped in the output preview described on the Overview section. Here's a sample of those fields:

['id', 'portalId', 'active', 'createdAt', 'lastUpdated', 'createdBy', 'modifiedBy', 'type', 'uid', 'timestamp', 'source', 'allAccessibleTeamIds', 'bodyPreview', 'queueMembershipIds']

The output preview shows a lot of these fields. However, there's no explanation to what is the number returned on the field createdBy, modifiedBy and uid, for instance. I'd like to know what those mean, and if there is a possibility to map these into the ownerId. 

Thanks!

0 Avaliação positiva
1 Solução aceita
WendyGoh
Solução
HubSpot Employee
HubSpot Employee

Unknown fields in Engagements API response

resolver

Hi @caiorochap,

 

The createdBy, modifiedBy and ownerId will be on all records. 

 

As mentioned on my previous reply, bot modifiedBy and createdBy is referring to the userId and currently there isn't a public endpoint to retrieve meta information from the userId. Hence, I'd recommend you to look at the ownerId field, grab that value and use this endpoint Get an Owner | Owners API to retrieve the owner information.

Exibir solução no post original

3 Respostas 3
WendyGoh
HubSpot Employee
HubSpot Employee

Unknown fields in Engagements API response

resolver

Hi @caiorochap

 

I hope all is well with you 😄

 

When looking to map the task owner to the Get Owners | Owners API endpoint, you can look at the ownerId field. Both the createdBy and modifiedBy field are referring to the user id. Currently, there isn't a public endpoint to pull user information using user id - you will have to go through theGet Owners | Owners API endpoint and search for the user ID.

 

Hope this helps to clarify things!

0 Avaliação positiva
caiorochap
Participante

Unknown fields in Engagements API response

resolver

Hi there, @WendyGoh. Is there any guarantee that the modifiedBy and createdBy will be on all records I request? If there is, it's all good. I'd like to know, also, if the modifiedBy and createdBy returns a number that refers to an OwnerId, so I could map it directly by using the get owners endpoint. Thanks!

0 Avaliação positiva
WendyGoh
Solução
HubSpot Employee
HubSpot Employee

Unknown fields in Engagements API response

resolver

Hi @caiorochap,

 

The createdBy, modifiedBy and ownerId will be on all records. 

 

As mentioned on my previous reply, bot modifiedBy and createdBy is referring to the userId and currently there isn't a public endpoint to retrieve meta information from the userId. Hence, I'd recommend you to look at the ownerId field, grab that value and use this endpoint Get an Owner | Owners API to retrieve the owner information.