Custom object import through API

Hi

What is the syntax for “importRequest” in the request body of the url https://api.hubapi.com/crm/v3/imports to import data for a custom object (Insert new records) and associate them to companies object usng a single CSV file containing data of both custom object and companies.

Thanks in advance.

Hi, @DTeam34 :waving_hand: Thanks for the question. I have a few questions to help give our community members more information:

  • Have you made an attempt? If so, can you share your request body?

  • If yes, have you tried making a request to retrieve more details about the error?

  • If not, have you tried making a single sheet import for two objects with only a single row and a single column (or the minimum number of columns)?

    GET /crm/v3/imports/{importId}/errors​

Knowing what you’ve already tried, and any errors you are receiving, will help our community members better understand how they can help.

Thank you! Jaycee

Hi @Jaycee_Lewis

Thank you for your reply.

Below is the “Import Request” Json we are using.

{

“name”: “import_test_1”,

“importOperations”: {

“0-1”: “UPSERT”

},

“dateFormat”: “DAY_MONTH_YEAR”,

“files”: [

{

“fileName”: “Stats-Companies.csv”,

“fileFormat”: “CSV”,

“fileImportPage”: {

“hasHeader”: true,

“columnMappings”: [

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “AccountName”,

“propertyName”: “accountname”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Account_Id”,

“propertyName”: “account_id”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Clicks30”,

“propertyName”: “clicks30”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Clicks60”,

“propertyName”: “clicks60”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Clicks90”,

“propertyName”: “clicks90”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Clicks”,

“propertyName”: “clicks”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingSales30”,

“propertyName”: “pendingsales30”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingSales60”,

“propertyName”: “pendingsales60”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingSales90”,

“propertyName”: “pendingsales90”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingSales”,

“propertyName”: “pendingsales”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Sales30”,

“propertyName”: “sales30”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Sales60”,

“propertyName”: “sales60”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Sales90”,

“propertyName”: “sales90”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Sales”,

“propertyName”: “sales”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingPayout30”,

“propertyName”: “pendingpayout30”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingPayout60”,

“propertyName”: “pendingpayout60”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingPayout90”,

“propertyName”: “pendingpayout90”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “PendingPayout”,

“propertyName”: “pendingpayout”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Payout30”,

“propertyName”: “payout30”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Payout60”,

“propertyName”: “payout60”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Payout90”,

“propertyName”: “payout90”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Payout”,

“propertyName”: “payout”

},

{

“columnObjectTypeId”: “2-21443064”,

“columnName”: “Balance”,

“propertyName”: “balance”

},

{

“columnObjectTypeId”: “0-2”,

“columnName”: “Website”,

“propertyName”: “website”

},

{

“columnObjectTypeId”: “0-2”,

“columnName”: “CompanyName”,

“propertyName”: “name”

},

{

“columnObjectTypeId”: “0-2”,

“columnName”: “Domain”,

“propertyName”: “domain”

},

{

“columnObjectTypeId”: “0-2”,

“columnName”: “Phone”,

“propertyName”: “phone”

}

]

}

}

]

}

Actual our requirement is to insert new records into statistics custom object and create association with existing companies object based on common column (account_id). But the import is inserting new records into both statistics and companies (Causing duplicates in companies) and association created from statistics to newly created company object, which is actually a duplicate.

Thank you.