APIs & Integrations

techextension
Member

Unable to set durationMilliseconds value while creating engagement using API

Hello,

I am ceating engagement type call using API.
Everything log perfectly but when i am tring to log durationMilliseconds for call it is not showing in Call log.
I am using call duration in milliseconds like let say i have to set duration 21 seconds so i am passing 21000 to variable $CallDurationMiilliseconds in below code but still its not working.
I am using below code : 

URL : https://api.hubapi.com/engagements/v1/engagements?hapikey=demo
PARAM : 


{
"engagement": {
"active": true,
"ownerId":"'.$userID.'",
"type": "CALL"
},
"associations": {
"contactIds": ['.$ID.'],
"companyIds": ['.$AccountID.'],
"dealIds": [ ],
"ownerIds": [ ]
},

"metadata" : {
"toNumber" : "'.$DestinationNumber.'",
"fromNumber" : "'.$SourceNumber.'",
"status" : "'.$COMPLETED.'",
"externalId" : "'.$UniqueId.'",
"durationMilliseconds" : "'.$CallDurationMiilliseconds.'",
"recordingUrl" : "'.$recordLink.'",
"disposition" : "'.$disposition.'",
"body" : "'.$subject.'",
"title" : "'.$subject.'"
}
}


0 Upvotes
1 Reply 1
dennisedson
HubSpot Product Team
HubSpot Product Team

Unable to set durationMilliseconds value while creating engagement using API

Hi @techextension ,

Are you still having issues with this?

I replicated your set up using 21000 rather than the variable and it was successfully logged into the metadata.  

Can you do a test without the variable and see if that works?

 

Thanks!

0 Upvotes