HubSpot.NET: Unable to Create Contacts "Property properties doesn't exist".
This is for the v1-preview branch…
When trying to create (or CreateorUpdate) I’m getting an error back from the REST response saying "Property \"properties\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"properties"}],"status":"error","message":"Property values were not valid"...
It looks like the properties data member is being included for the Contact when sending off the JSON.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 19 (4 by maintainers)
Commits related to this issue
- Maybe fixes https://github.com/hubspot-net/HubSpot.NET/issues/50 — committed to JesseKlaasse/HubSpot.NET by JesseKlaasse 4 years ago
- Probably fixes https://github.com/hubspot-net/HubSpot.NET/issues/50 — committed to JesseKlaasse/HubSpot.NET by JesseKlaasse 4 years ago
@bburrell I have added a MIT license, so please go ahead and use it.
The current master branch seems to still have this bug. If you could point me in the right direction, I can probably fix the issue?
Sample call…
var contact = api.Contact.Create(new ContactHubSpotModel() { Email = "john@gmail.com", FirstName = "Terry", LastName = "Terrence", Address= "10 Something Street", City= "Heresville", ZipCode= "2022", State= "NSW", Phone = "02 8832 2213", });Which produces… (in the NewtonsoftResetSharpSerializer)
{"properties":[{"property":"email","value":"john@gmail.com"},{"property":"firstname","value":"Terry"},{"property":"lastname","value":"Terrence"},{"property":"phone","value":"02 8832 2213"},{"property":"address","value":"10 Something Street"},{"property":"city","value":"Heresville"},{"property":"state","value":"NSW"},{"property":"zip","value":"2022"},{"property":"properties","value":"System.Collections.Generic.Dictionary2[System.String,HubSpot.NET.Api.Contact.Dto.ContactProperty]"}]}`Removing the DataMember from the ContractHubSpotModel.Properties property then obviously removes that property from the generated json…which then works. I haven’t applied any brainpower to working out why you might be trying to include that in the payload.