APIs & Integrations

Samanderson41
Contributor | Diamond Partner
Contributor | Diamond Partner

Mapping properties in Contact API

We have the Contact API set up between another platform and HubSpot; however, the tool's developer only used the parameters set in the sample JSON.

We want to pipe over all the fields below. Will we need to make new fields that match exactly the data here? The dev asked for sample json for this request so he can map the fields accordingly.

So, for example, would the first line of the below data set be the following and we'd need to make sure that "Order name" was the exact name of a contact property?

{
"property": "order name",
"value": "VA Refi C/O Premium"
},

DATA SET:
Order Name VA Refi C/O Premium
Order Id 581319-55
LeadClass Quality Band Premium
Connection Id
Product Refinance

0 Upvotes
7 Replies 7
cbarley
HubSpot Alumni
HubSpot Alumni

Mapping properties in Contact API

Hi @sanderson41, cross-checking the values in that POST request with the values that exist on those contact properties, some of them do not match up. For example, for the lead_source property, there is no option in your account for pegasus. That is the label - the internal value is actually Leadpoint. Same thing goes for loan_purpose. There isn't a value for that property called lower_rate. Check all of the values on each property you're including in the request to make sure that if they're a dropdown option that the values actually exist. Two things I also noticed are that FHA and Language are capitalized when the internal value is not - make sure those are lowercased as well. Your issue appears to be syntactical.

0 Upvotes
Samanderson41
Contributor | Diamond Partner
Contributor | Diamond Partner

Mapping properties in Contact API

For the values, can you not use single-line properties? Or do you mean that if it is a dropdown the value has to be exact.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Mapping properties in Contact API

The latter. If it is a dropdown property they have to match the values you have set already in your HubSpot Account. Adding a new value does not automatically create a new option

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Mapping properties in Contact API

Hi @sanderson41, please try and refrain from posting your API key here as these are public forums. I'd recommend deactivating your current one and activating a new one to be safe and protect your data.

Nothing jumps out at me here. What is the HubID of the account you're trying to make this request to? Make sure to double check that everything is spelled properly and that the internal values match exactly what's in your account

0 Upvotes
Samanderson41
Contributor | Diamond Partner
Contributor | Diamond Partner

Mapping properties in Contact API

Thank you. The ID is 3972732.

0 Upvotes
Samanderson41
Contributor | Diamond Partner
Contributor | Diamond Partner

Mapping properties in Contact API

So we tried this and got the following. What do we need to do?

After 77 milliseconds: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.hubapi.com/contacts/v1/contact/? Server Response: {"status":"error","message":"property cannot be missing or null","correlationId""}

Test lead:

{
"properties": [
{
"property": "email",
"value": "[xxxx@lead.com]"
},
{
"property": "lead_source",
"value": "pegasus"
},
{
"property": "firstname",
"value": "John"
},
{
"property": "lastname",
"value": "Smith"
},
{
"property": "website",
"value": "http://hubspot.com"
},
{
"property": "company",
"value": "HubSpot"
},
{
"property": "phone",
"value": "3105551217"
},
{
"property": "address",
"value": "121 Vermont Ave"
},
{
"property": "city",
"value": "Fake City"
},
{
"property": "state",
"value": "MD"
},
{
"property": "zip",
"value": "21218"
},
{
"property": "loan_purpose",
"value": "lower_rate"
},
{
"property": "purchase_year",
"value": "2002"
},
{
"property": "what_is_your_annual_income_",
"value": "90000"
},
{
"property": "minimum_monthly_debt_pmt",
"value": "1200"
},
{
"property": "occupational_status",
"value": "employed"
},
{
"property": "preferred_time_to_call",
"value": "morning_primary"
},
{
"property": "property_state",
"value": "MD"
},
{
"property": "property_zip",
"value": "21218"
},
{
"property": "n1st_mortgage_balance",
"value": "200000"
},
{
"property": "n1st_mortgage_interest",
"value": "4.0"
},
{
"property": "do_you_have_a_2nd_mortgage_",
"value": "no"
},
{
"property": "n2nd_mortgage_balance",
"value": "15000"
},
{
"property": "n2nd_mortgage_interest",
"value": "5.0"
},
{
"property": "property_description",
"value": "single_fam"
},
{
"property": "Language",
"value": ""
},
{
"property": "FHA",
"value": ""
},
{
"Property": "have_you_or_your_spouse_been_an_active_member_of_the_us_armed_forces_",
"value": "yes"
},
{
"property": "credit_grade",
"value": "EXCELLENT"
},
{
"property": "order_name",
"value": ""
},
{
"property": "leadclass_quality_band",
"value": ""
},
{
"property": "product",
"value": "Refinance"
},
{
"property": "loan_value",
"value": "200000"
},
{
"property": "loan_to_value",
"value": "44"
},
{
"property": "estimated_home_value",
"value": "500000"
},
{
"property": "how_much_additional_cash_do_you_wish_to_borrow_",
"value": "20000"
},
{
"property": "loan_type",
"value": "Adjustable"
}

]
}

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Mapping properties in Contact API

Hi @sanderson41, I hope I'm understanding your question correctly but let me know if I'm off base. You're looking to send over more than just the fields you're currently including into HubSpot? If so, you must use the internal value with every HubSpot endpoint. You can find the internal values by going to the properties page (https://app.hubspot.com/property-settings/HUBID/) and clicking into a specific property. Or you can pull the internal values using this endpoint: https://developers.hubspot.com/docs/methods/contacts/v2/get_contacts_properties.

If the corresponding contact properties do not exist yet in HubSpot, you'll need to create create them in HubSpot first.

0 Upvotes