APIs & Integrations

JNeal
Member

Custom Field Endpoint Mapping

SOLVE

Hi all - I am trying to utilize the Hubspot API endpoint for contacts... I am trying to POST a new contact into hubspot..

 

Things seem to run smoothly with Hubspot created fields - Such as "Name", "email", "Zip" etc.

 

The issue seems to be that hubspot denies the input from my back-end in terms of custom fields... I know that it is possible to  POST a custom field, to Hubspot because they do so via zapier...  Either I dont have them mapped correctly from my back end, or something else is incorret within the custom fields themselves that it blocks contacts being added that dont have custom fields mapped properly?

 

Does anybody know the format for mapping customer fields withhin the endpoint:

 

curl --request POST \
--url 'https://api.hubapi.com/crm/v3/objects/contacts?hapikey=YOUR_HUBSPOT_API_KEY' \
--header 'content-type: application/json' \
--data '{
"properties": {
"company": "Biglytics",
"email": "bcooper@biglytics.net",
"firstname": "Bryan",
"lastname": "Cooper",
"phone": "(877) 929-0687",
"website": "biglytics.net"
}
}'

 

 

Please advise! Thanks guys!

 

Jon

0 Upvotes
1 Accepted solution
JNeal
Solution
Member

Custom Field Endpoint Mapping

SOLVE

 Hey Dennis! I tested from the back end in run 7 debug mode and it worked with customer fields!

 

However, I am still having trouble within that platform in passing the data but the problem seems to within the back end in mapping the field in the function correctly to the database side of the back end... So, it seems like I can handle it with the back end from here!

 

Will ping you back if there are any other questions/thoughts here!

 

Thanks so much for the help!

 

Jon

View solution in original post

4 Replies 4
JNeal
Solution
Member

Custom Field Endpoint Mapping

SOLVE

 Hey Dennis! I tested from the back end in run 7 debug mode and it worked with customer fields!

 

However, I am still having trouble within that platform in passing the data but the problem seems to within the back end in mapping the field in the function correctly to the database side of the back end... So, it seems like I can handle it with the back end from here!

 

Will ping you back if there are any other questions/thoughts here!

 

Thanks so much for the help!

 

Jon

JNeal
Member

Custom Field Endpoint Mapping

SOLVE

Hey Dennis! Sure thing - API key is omitted... See below:

 

  }

}'

curl --request POST \

  --url 'https://api.hubapi.com/crm/v3/objects/contacts?hapikey=APIKEY' \

  --header 'content-type: application/json' \

  --data '{

  "properties": {

    "firstname":  "first_name",

    "lastname": "last_name",

    "email": “email”,

    "phone": “phone”,

    “address”: “address”,

    “roof_age": "roof_age”,

    “campaign_number”: "campaign_number",

    “zip”: “postal_code”,

    "single_family_homeowner_status": “single_family_homeowner_status”,

    “sun_exposure": “estimated_sun_exposure,

    "email": “created_at”,

    “ghl_contact_id”: “contact_id”,

    “estimated_roof_size_sqft: "roof_size",

  }

}'

 

None of the custom fields (in bold) on the left pass the value from my DB when I POST the json payload. I tried with only hubspot created fields and it worked like a charm. 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Custom Field Endpoint Mapping

SOLVE

@JNeal , did you get a chance to test again?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Custom Field Endpoint Mapping

SOLVE

Hey @JNeal 

Mind posting your json payload?  It should be as simple as adding the internal name + the value just like the example you have above.

0 Upvotes