APIs & Integrations

avinash1
Member

Need to add activity inside call using api

Hello,
i am using this api

https://api.hubapi.com/engagements/v1/engagements?hapikey=923c7b8e-2e9b-44e0-866d-0a2ad7281852

post this data

{
"engagement": { "type": "CALL" },
"metadata":
{ "toNumber": "5618769964",
"fromNumber": "+14845933452",
"status": "COMPLETED",
"externalId": "CAc052aca6842211ab1c548dcfed5c9",
"durationMilliseconds": 38000,
"body": "testing" }

}

getting response 200 and succesfully saved this engagement but this not showing inside the activity logs.

Response

{
"engagement": {
"id": 1461173152,
"portalId": 5012944,
"active": true,
"createdAt": 1542818175395,
"lastUpdated": 1542818175395,
"type": "CALL",
"timestamp": 1542818175395,
"allAccessibleTeamIds":
},
"associations": {
"contactIds": ,
"companyIds": ,
"dealIds": ,
"ownerIds": ,
"workflowIds": ,
"ticketIds": ,
"contentIds": ,
"quoteIds":
},
"attachments": ,
"metadata": {
"toNumber": "5618769964",
"fromNumber": "+14845933452",
"status": "COMPLETED",
"externalId": "CAc052aca6842211ab1c548dcfed5c9",
"durationMilliseconds": 38000,
"body": "testing"
}
}

I am not sure its right way to add activity in call. Is there any another way or another API to do this?

Thanks.

0 Upvotes
1 Reply 1
cbarley
HubSpot Alumni
HubSpot Alumni

Need to add activity inside call using api

Hi @avinash, please refrain from posting your API key on this public forum. I'd recommend deactivating this key and activating a new one.

That said, yes it looks like you're using the right endpoint. It's this one: https://developers.hubspot.com/docs/methods/engagements/create_engagement. Where are you expecting to see this call engagement? You should use the ID of the contact and explicitly associate the engagement with a contact by using the associations object in your original POST request.

0 Upvotes