APIs & Integrations

dntaker
Member

API to Update Custom Properties?

https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/dave.nash@mail.com/?hapikey=MyKey?pr...

{
"properties":
[
{"property": "firstname", "value": "Dave" },
{"property": "lastname","value": "Nash"},
{"property": "jobtitle","value": "Web Sys Manager"},
{"property": "company","value": "ERIKS"},
{"property": "website","value": "https://eriks.co.uk"},
{"property": "phone","value": "+44 1246 245720"},
{"property": "address","value": "Wharf Lane"},
{"property": "state","value": "Derbyshire"},
{"property": "zip","value": "S43 7NB"}
{"property": "nps_flag","value": "True"}
]
}

I'm attempting to get my contact on Hubspot to update nps_flag with the value True, however the custom properties don't update, any ideas why?

I've posted on other threads but I'm not getting answers :frowning:

My email has been changed to protect the innocent

Any help at all would be great!

9 Replies 9
dntaker
Member

API to Update Custom Properties?

@Derek_Gervais,

So this code still isn't working and I can't understand why? I've added the comma and it's made no difference, I've also removed the other fields thinking they may have caused an issue.

https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/dave.nash72@gmail.com/?hapikey={my HPI Key Here}?property=nps_flag

{"properties": [{"property": "firstname", "value": "Dave" },{"property": "lastname","value": "Nash"},{"property": "nps_flag","value": "true"}]}

dntaker
Member

API to Update Custom Properties?

@Derek_Gervais & @mhammed

I've no idea why but the property=nps_flag was stopping the update.
I'll try adding in the extra details.

Best Regards

Dave

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to Update Custom Properties?

Hi @dnash,

Apologies for the delay here. I was able to make a request using a very similar request:

POST https://api.hubapi/com/contacts/v1/contact/createOrUpdate/email/dgervais@hubspot.com/
{
"properties":
  [
    {"property": "firstname", "value": "Derek" },
    {"property": "lastname","value": "Gervais"},
    {"property": "nps_flag","value": "True"}
  ]
}

You can see the resulting contact record (with the nps_flag property correctly set) below. It looks like you were missing a comma right before the nps_flag property in your request body; is it possible that was affecting your requests?
https://app.hubspot.com/contacts/340621/contact/154675242/properties?search=nps

0 Upvotes
dntaker
Member

API to Update Custom Properties?

@Derek_Gervais Any news on this one pal?

0 Upvotes
dntaker
Member

API to Update Custom Properties?

The URL I used was with my correct email!!

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to Update Custom Properties?

Hi @dnash,

Can you give me your Hub ID so that I can take a look at the property?

0 Upvotes
dntaker
Member

API to Update Custom Properties?

Hi Sorry for the delay :
340621

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to Update Custom Properties?

Hi @dnash,

What type of property is the nps_flag property? When updating enumeration or single checkbox contact properties, your value must exactly match the internal property values. If nps_flag is a single checkbox, the internal value for true is all lowercase (i.e. true). Can you try your request again with the lowercase property value?

0 Upvotes
dntaker
Member

API to Update Custom Properties?

The value is a text entry and can contain anything, I've changed it to true to see if that fixers just in case, but still no joy.

0 Upvotes