Retrieve Custom or Native Fields from Engagement API

anilvithani
Member

Hi,

 

We have synced contacts from our crm system to Hubspot. We have saved primary key of our databaase into crm_id field of contacts.

 

When retriving recent engagements from this API [https://legacydocs.hubspot.com/docs/methods/engagements/get-recent-engagements], we only have contactID in association. I need more information to be included like the value of field "crm_id" in response. Follwoing is a sample response I am getting.  Life will be easier if I can get info like 

 

"associations":{  "contactIds":[ 458774], "crm_id":[353532], 

 

 

default resultset

{
   "results":[
      {
         "engagement":{
            "id":8404576745,
            "portalId":8149850,
            "active":true,
            "createdAt":1598011090516,
            "lastUpdated":1598011091674,
            "createdBy":11461569,
            "modifiedBy":11461569,
            "ownerId":49628444,
            "type":"TASK",
            "timestamp":1598409000000,
            "source":"CRM_UI",
            "sourceId":"dssdsaani@sdsmail.com",
            "allAccessibleTeamIds":[

            ],
            "bodyPreview":"Hey Ballu, whats going",
            "queueMembershipIds":[

            ],
            "bodyPreviewIsTruncated":false,
            "bodyPreviewHtml":"<html>\n <head></head>\n <body>\n <p>Hey Ballu, whats going</p>\n </body>\n</html>",
            "gdprDeleted":false
         },
         "associations":{
            "contactIds":[
               458774
            ],
            "companyIds":[
               4206841234
            ],
            "dealIds":[

            ],
            "ownerIds":[

            ],
            "workflowIds":[

            ],
            "ticketIds":[

            ],
            "contentIds":[

            ],
            "quoteIds":[

            ]
         },
         "attachments":[

         ],
         "scheduledTasks":[
            {
               "engagementId":8404576745,
               "portalId":8149850,
               "engagementType":"TASK",
               "taskType":"REMINDER",
               "timestamp":1598409000000,
               "uuid":"TASK:c0bc3419-1788-4435-ae9b-27f4ebea3659"
            }
         ],
         "metadata":{
            "body":"<p>Hey Ballu, whats going</p>",
            "status":"NOT_STARTED",
            "subject":"catch up with Ballu",
            "taskType":"TODO",
            "reminders":[
               1598409000000
            ],
            "sendDefaultReminder":true,
            "priority":"NONE",
            "isAllDay":false
         }
      },

 

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee

Hey @anilvithani,

 

Currently, it is not possible to specify additional properties on the Get recent engagements

 

In this case, I'd recommend for your team to grab the contactID associated with the engagement and use it on this endpoint: Get a contact by vid - you can specify to include other properties such as crm_id. 

 

i.e.

GET

contacts/v1/contact/vid/:vid/profile?property=crm_id

0 Upvotes