Missing fields in response JSON by call to Hubspot API


#1

By calling Hubspot API for get all contacts with URL : “https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=xxxxxxx&count=100&vidOffset=0”. Returns a response JSON with some the empty fields like ‘merge-vid’, ‘merge-audits’ , ‘form-submissions’.
What is the sample data for these fields ? I tried with diiferent apikeys but dint got data for these objects. It was not possible to create data through UI. Even response shown on Hubspot API docs does not have this data.
Can you help out with any sample response JSON which will have data for all the fields ?


#2

Hi @kajalna

merged-vids and merge-audits will only be populated for records that have been merged with another record. merged-vids is a list of the vids that have been merged (including the vid of the current record):

“merged-vids” : [407596,407546],

merge-audits will be details about the merge:

"merge-audits": [
  {
    "canonical-vid": 407546,
    "vid-to-merge": 407596,
    "timestamp": 1459183894522,
    "num-properties-moved": 32,
    "merged_from_email": {
      "value": "merge2@example.com",
      "source-type": "CONTACTS_WEB",
      "source-id": "test@hubspot.com",
      "source-label": null,
      "source-vids": [
        407596
      ],
      "timestamp": 1459183770094,
      "selected": false
    },
    "merged_to_email": {
      "value": "merge1@example.com",
      "source-type": "CONTACTS_WEB",
      "source-id": "test@hubspot.com",
      "source-label": null,
      "timestamp": 1459183757761,
      "selected": false
    }
  }
]

form-submissions will contain a list of form submission events for the record (it will be empty if no forms have been filled out by the record.

"form-submissions": [
  {
    "conversion-id": "614232f0-b1fc-4680-ada3-99be0d6e218b",
    "timestamp": 1476206665018,
    "form-id": "2519dd98-7f01-4776-84a3-478319cfc4af",
    "portal-id": 62515,
    "page-url": "http://www.test.com/contact",
    "page-title": "Contact us",
    "title": "contact us form",
    "meta-data": [
      
    ]
  }
],

#3

Thank you for the help.
So if we consider a complete response JSON, will it look like below for any particular record?

“contacts”:[
{
“addedAt”:1390574181854,
“vid”:204727,
“canonical-vid”:204727,
“merged-vids”:[
407596,
407546
],
“portal-id”:62515,
“is-contact”:true,
“profile-token”:“AO_T-mOjUxM-_S1xxXvcFanaPMyTOOqBgGi_zfmvkc9_nLffGQanZAuCEf_8wz-sUB3nDcHAcTKLXCAQ39djqH9Dne-apM48LPcipEfCpfZY0zyR37nOjdF9EHFEGWIvPsJdlD4ovsuZ”,
“profile-url”:“https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mOjUxM-_S1xxXvcFanaPMyTOOqBgGi_zfmvkc9_nLffGQanZAuCEf_8wz-sUB3nDcHAcTKLXCAQ39djqH9Dne-apM48LPcipEfCpfZY0zyR37nOjdF9EHFEGWIvPsJdlD4ovsuZ/”,
“properties”:{
“firstname”:{
“value”:""
},
“lastmodifieddate”:{
“value”:“1473963575184”
},
“company”:{
“value”:""
},
“lastname”:{
“value”:""
}
},
“form-submissions”:[
{
“conversion-id”:“614232f0-b1fc-4680-ada3-99be0d6e218b”,
“timestamp”:1476206665018,
“form-id”:“2519dd98-7f01-4776-84a3-478319cfc4af”,
“portal-id”:62515,
“page-url”:“http://www.test.com/contact”,
“page-title”:“Contact us”,
“title”:“contact us form”,
“meta-data”:[
]
}
],
“identity-profiles”:[
{
“vid”:204727,
“saved-at-timestamp”:1471266813356,
“deleted-changed-timestamp”:0,
“identities”:[
{
“type”:“LEAD_GUID”,
“value”:“f9d728f1-dff1-49b0-9caa-247dbdf5b8b7”,
“timestamp”:1390574181878
},
{
“type”:“EMAIL”,
“value”:"new-email@hubspot.com",
“timestamp”:1471266813256
}
]
}
],
“merge-audits”:[
{
“canonical-vid”:407546,
“vid-to-merge”:407596,
“timestamp”:1459183894522,
“num-properties-moved”:32,
“merged_from_email”:{
“value”:"merge2@example.com",
“source-type”:“CONTACTS_WEB”,
“source-id”:"test@hubspot.com",
“source-label”:null,
“source-vids”:[
407596
],
“timestamp”:1459183770094,
“selected”:false
},
“merged_to_email”:{
“value”:"merge1@example.com",
“source-type”:“CONTACTS_WEB”,
“source-id”:"test@hubspot.com",
“source-label”:null,
“timestamp”:1459183757761,
“selected”:false
}
}
]
}
]

There are no any other additional fields or missing fields in this response ?


#4

On similar basis for:

  1. Companies object ‘[]additional-domain’ field’s data is missing in response JSON. What is intended data for this field ?
    2)Get all Engagements: there are varying fields for all records.
    For eg : Some records may have []scheduled tasks while some have []attachments and some records have both these fileds.
    And still data for []attachments, []scheduled-task and []associations is missing.
    3)Contact list: []filters what is this field intended for ?

#5

The example JSON you have would be typical, but again the merge items would only be populated for records that had been merged, and form submissions would only be included for contacts with form submissions. Also, it’s possible that contacts will not include all of those specific properties if the contact doesn’t have a value for that property (or for other properties to be included if you’re using the property= parameter in the request URL).

The additionalDomains field will be a list of domain names (as strings). In practice that list is going to be empty most of the time.

Engagements will have different metadata depending on the type of the engagement, and will only include attachments or tasks if the engagement is actually associated with those items . There are some examples of the data you’d see with the different types here:

List filters are the criteria used to determine which contacts join the list. For smart lists, contacts are evaluated against the list criteria when any change occurs. For statis lists, contacts are only evaluated when the list is created. There are additional details for the different filter types here:


#6

For Engagements with reference to "http://developers.hubspot.com/docs/methods/engagements/create_engagement"
shows to create different types of meta-data. That is okay, but what will be data in [] attachments or []scheduledtask. These two fields are always empty in reponse JSON.
When are we supposed to get data in these fields. Can you help with any sample JSON for these fields. And data in these responses will be fixed or vary ?


#7

There is issue raised on 17th Oct 2016, since then there is no answer or solution provided for the issue.
Can you please look into it on priority basis. We need to resolve it urgently.


#8

Attachments will be a list of IDs from the COS Files API, pointing to specific files uploaded to HubSpot. If there are no attachments the list will be empty.

"attachments": [
  {"id": 1004598000},
  {"id": 78092}
],

scheduledTasks will be a list (though usually this will be a list of 1 item) of internal tasks objects (they can only be created from inside of the HubSpot app). These would be used to send reminder emails to the assignee of the task.

"scheduledTasks": [
  {
    "engagementId": 133027587,
    "portalId": 62515,
    "engagementType": "TASK",
    "taskType": "REMINDER",
    "timestamp": 1477969200000,
    "uuid": "TASK:c5e24899-fc1c-46d8-b534-755042f2a0e3"
  }
],

#9

Thank you for the above responses, that was helpful.


#10

For Companies object
Hubspot API exposes two URL’s for either recently created companies or recently updated companies( “http://developers.hubspot.com/docs/methods/companies/get_companies_modified” and “http://developers.hubspot.com/docs/methods/companies/get_companies_created”)
But none of them supports “timeOffset” parameter. Due to which we can’t get data below for any specific date. (As in Contacts objects, API supports timeOffset parameter).
Thus is there any provision similar to Contacts object, to append timeOffset for Companies objects ?


#11

The /recent/ endpoints return the companies in modified or created order, starting with the most recent. There isn’t a way to specify a time to search around, so you’d need to page backwards through the results using the offset parameter, and check the hs_lastmodifieddate property of the companies to see when they were last updated, or the createdate if you’re looking for recently created records.