Bulk import API responseBody for create action

Hi,

I’m using the bulk import api to create contacts/accounts and had a couple of questions.

1) From the GET import response I’m looking to capture the IDs of the newly created objects. How do I do this?

2) What does the "fileIds" in the reponse represent?

A sample response of my import I get with the “Get Info on import api” has the following fields →

GET /crm/v3/imports/{importId}

HubspotBulkFileUploadResponse(

state=DONE,

createdAt=2022-11-03T10:27:12.891Z,

importName=6Sense Data Export:contact_1667471230872.csv, updatedAt=2022-11-03T10:27:29.223Z,

optOutImport=false,

id=29801094,

metadata=MetaData(

objectLists=[ObjectType(listId=331, objectType=0-1)], counters=Counters(

TOTAL_ROWS=10,

PROPERTY_VALUES_EMITTED=9,

UPDATED_OBJECTS=0,

UNIQUE_OBJECTS_WRITTEN=9,

MAPPED_COLUMNS=3,

CREATED_OBJECTS=9,

ERRORS=1),

fileIds=[90375898510]

)

)

Hi, @6sense :waving_hand: Thanks for the great questions. Let’s see if we can get the conversation going.

Q1 – Hey, @miljkovicmisa @albertsg, do you have any thoughts here?

One thought is to make a list from a specific import and then query the list. But I don’t see a direct approach in the Search API documentation to accomplish something similar. Not by specific import. We could look at createdate, but that could pull in contact created that day that are not part of the import.

Q2 – I do not have any documentation showing fileIds as an externally useable property or value. In other similar cases, I’ve seen values like this get retuned via a public endpoint, but only have internal (HubSpot) uses. Confusing, but it happens.

For Q2, can you tell us more about how you are using this value or were thinking of using it? I am happy to dig a bit more once I understand the context more.

Thank you very much! — Jaycee

Hi Jaycee,

Thanks for your response.

For Q2 - I was wondering if fileIds contains the response object and if I can get the data from this file via any api call?

Hello @6sense & @Jaycee_Lewis , you are correct @Jaycee_Lewis , it is possible to leverage the returned

listId to get contacts from the list by using the List API Get Contacts endpoint from this link.
Hope this is useful.

Wonderful. Is there a similar API for getting companies from a list id?

@miljkovicmisa @Jaycee_Lewis
Is there a similar API for getting companies from a list id?

Hi @miljkovicmisa @Jaycee_Lewis

I tried the above API and this is the response that I get
https://api.hubapi.com/contacts/v1/lists/527/contacts/all

{

“contacts”: [],

“has-more”: false,

“vid-offset”: 0

}

I tried for various requests, records get created but the listid that I get From the Bulk api response does not give me any data.

Please suggest.