API3
galmeida at November 8th, 2017 10:51 — #1
HI,
I'm using this JSON body to create a contact:
{ "partial": 1, "first_name":"Happy","last_name":"User", "emails": [{"type": "home","value": "some@mail.com"}]}
But I get the message:
{
"readyState":4,
"responseText":"{"status":400,"message":"Invalid request data","error_name":"invalid_request_data","error_message":"A validation error has occurred","errors":{"last_name":"Lastname or organization name must be provided","company_name":"Lastname or organization name must be provided"}}",
"responseJSON":
{ "status":400,
"message": "Invalid request data",
"error_name":"invalid_request_data",
"error_message":"A validation error has occurred",
"errors":{ "last_name":
"Lastname or organization name must be provided",
"company_name":"Lastname or organization name must be provided"}
},"status":400,"statusText":"Bad Request"}
My contact does have a Last Name. What am I doing wrong?
dem at November 10th, 2017 06:55 — #2
Hi Gonçalo,
I have just try to create contact using Postman tool and your data:
var contact = { "partial": 1, "first_name":"Happy","last_name":"User", "emails": [{"type": "home","value": "some@mail.com"}]}
And it is created without any problem:
{
"status": 0,
"message": "Created",
"timestamp": 1510312662,
"data": {
"contact": {
"id": "5a058ad63e5a147f4a2a8b82",
"first_name": "Happy",
"last_name": "User",
...
I suppose issue lays somewhere in code which sends requests to API. Could you provide code sample?
Kind regards,
Mikhail
Powered by Discourse, best viewed with JavaScript enabled