422 Unprocessable entry


#1

Hi,

I am trying to create a contact using the Oauth playground and am having issues, and am out of ideas as to why. My Json is the following:

{
“contacts”: [
{
“first_name”:“User”,
“last_name”:“Name”,
“organisation_name”:“Luc Limitr”
}
]
}

When I run this, I get a 422 error, and then get:

{
  "errors": [
    {
      "message": "first_name can't be blank"
    }, 
    {
      "message": "last_name can't be blank"
    }, 
    {
      "message": "organisation_name can't be blank"
    }
  ]
}

Please can someone let me know what the request body should look like?

Thanks in advance,

Paul


#2

Your JSON should look like this:

{
    "contact": {
        "first_name": "User",
        "last_name": "Name",
        "organisation_name": "Luc Limitr"
    }
}

Yours,
Andrew Stewart


https://doubleagent.io


#3

Thanks Andrew, thats great :slight_smile:
This is now working.