APIs & Integrations

TimMunro
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Contact First Name Validation Error "CONTAINS_URL"

lösung
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!

 
 
 
 
1 Akzeptierte Lösung
Jaycee_Lewis
Lösung
Community-Manager/-in
Community-Manager/-in

Contact First Name Validation Error "CONTAINS_URL"

lösung

Hey, @andreub, the exact rules are not publicly available. There was some additional context provided here recently — https://community.hubspot.com/t5/APIs-Integrations/Announcement-Enhanced-Field-Validation/m-p/637334...

 

Thanks! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
6 Antworten
TimMunro
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Contact First Name Validation Error "CONTAINS_URL"

lösung

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.

andreub
Teilnehmer/-in

Contact First Name Validation Error "CONTAINS_URL"

lösung

Hi @TimMunro . We're having the same situation here. Did you manage to find out what are the rules that determine when a particular string will be rejected?

0 Upvotes
Jaycee_Lewis
Lösung
Community-Manager/-in
Community-Manager/-in

Contact First Name Validation Error "CONTAINS_URL"

lösung

Hey, @andreub, the exact rules are not publicly available. There was some additional context provided here recently — https://community.hubspot.com/t5/APIs-Integrations/Announcement-Enhanced-Field-Validation/m-p/637334...

 

Thanks! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
TimMunro
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Contact First Name Validation Error "CONTAINS_URL"

lösung

Unfortunuately I didn't any feedback from the HubSpot team, it would be great if they could explain. I found it impossible to determine what the rules applied are; simplest approach is to reject all that have fullstop (.) in them.

himanshurauthan
Vordenker/-in | Elite Partner
Vordenker/-in | Elite Partner

Contact First Name Validation Error "CONTAINS_URL"

lösung

**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
webdew
Ratgeber/-in | Diamond Partner
Ratgeber/-in | Diamond Partner

Contact First Name Validation Error "CONTAINS_URL"

lösung

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.