Contact First Name Validation Error "CONTAINS_URL"

TimMunro
Contributor
Certain contact add/update requests, particularly when setting 'firstname' property, recieve a HubSpot error response like this:
 
{"status":"error","message":"Property values were not valid: [{\"isValid\":false,\"message\":\"\\\"test.services.aaa2\\\" contains a URL\",\"error\":\"CONTAINS_URL\",\"name\":\"firstname\"}]","correlationId":"...guid...","category":"VALIDATION_ERROR"}
 
Here is an example API call to reproduce:
 {"inputs":[{"properties":{"firstname":"test.services.aaa2"}}]}
 
I understand what the error message is saying - in order to avoid sending bad data to HubSpot I am looking for details regarding the exact conditions that trigger this validation error (perhaps the HubSpot development team can chime in?):
  • What is the rule/rules that trigger this error? (e.g. is there a regex, something else, that we can use to test data against before sending to the HubSpot API)
  • Which properties on which records include the CONTAINS_URL validation err?

 

Thanks a lot!

 
 
 
 
3 Replies 3
webdew
Top Contributor | Diamond Partner

Hi @TimMunro ,

This is validation error, because your api object didn't pass sufficiant field. Please use below api documentation :
https://legacydocs.hubspot.com/docs/methods/contacts/batch_create_or_update

Example POST URL:
https://api.hubapi.com/contacts/v1/contact/batch/?hapikey=demo

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

himanshurauthan
Recognized Expert | Platinum Partner

**bleep** @TimMunro,

 

Yes, this is an expected error as announced in this post- https://community.hubspot.com/t5/APIs-Integrations/Announcement-Enhanced-Field-Validation/td-p/30422...says about contact firstname and lastname.

 

Affected fields/properties are standard HubSpot default fields, and as shared by jon An example of both a validation rule and obviously wrong value, would be if you have a first name field and a URL or code was entered instead. 

 

The answer for regular expression is something that the HubSpot team can share, but I believe it should be some general rules for firstname that you can try.

 

Hope this helps!

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
TimMunro
Contributor

Thanks for the responses, that link is useful. Really seeking an answer to this:

  • What is the rule/rules that trigger this error? (e.g. is there a regex, something else, that we can use to test data against before sending to the HubSpot API)

Re "I believe it should be some general rules for firstname that you can try." - yep, I have gone down that rabbit hole and trying to guess the rules that are in place is difficult, for example this first name is accepted "test.services1.aaa2", whereas this one is rejected "test.services.aaa2". So, the rule that is in place is more advanced that just rejecting all names that have a fullstop (.) in them. We are trying to:

  1. avoid discarding data that HubSpot will accept (e.g. if we discard all names with a fullstop that would cause some valid names to be discarded)
  2. avoid sending data that HubSpot will reject, and so cause the entire payload to be missed (e.g. maybe the other attibutes such as email address and phone number are just fine)

@davidwork7  - did you have any success here? @jmclaren as the original author of the "Announcement: Enhanced Field Validation" announcement, would you be able to follow up with the specifics?

 

Much appreciated.

0 Upvotes