Creating a constituent API giving me an error even with sample JSON

I'm trying to hit constituent/v1/constituents API with the following JSON
{

"address": {

"address_lines": "12 Lower Mast Rd",

"city": "Freeport",

"formatted_address": "12 Lower Mast Rd Freeport ME 04032",

"postal_code": "04032",

"preferred": "1",

"state": "ME",

"type": "Business"

},

"birthdate": {

"d": 14,

"m": 8,

"y": 1980

},

"deceased": false,

"email": {

"address": "email@domain.com",

"do_not_email": false,

"inactive": false,

"primary": true,

"type": "Email"

},

"first": "FName",

"former_name": "FName LName",

"gender": "Male",

"gives_anonymously": false,

"last": "LName",

"marital_status": "Married",

"middle": "",

"phone": {

"do_not_call": false,

"inactive": false,

"number": "843-537-3397",

"primary": true,

"type": "Home"

},

"preferred_name": "Junior",

"primary_addressee": {

"configuration_id": "28"

},

"primary_salutation": {

"custom_format": true,

"formatted_name": "Joshua Kilgore"

},

"suffix": ", Jr.",

"title": "Mr.",

"type": "Individual"

}
but I'm getting the following response payload
Array ( [0] => Array ( [message] => Unexpected character encountered while parsing value: a. Path '', line 0, position 0. [error_code] => 400 [raw_message] => Unexpected character encountered while parsing value: a. Path '', line 0, position 0. ) [1] => Array ( [message] => A request body containing a(n) constituent is required. [error_code] => 400 [raw_message] => A request body containing a(n) constituent is required. ) )

Could someone assist me in resolving this issue?

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    @Amit Kumar
    couple of things:

    • Are you hitting the API endpoint with POST method (for creating new constituent)?
    • Do you have the authorization headers in the call?
    • for the request body, did you make sure all “properties” that is a table entry has correct values? (i.e. “Mr.” exists as a title? “, Jr.” exists as a suffix, primary addressee configuration_id of 28)
    • I also just noticed from another post, that it appears phone formatting incorrect could be a problem too. So check your RE database view's configration for phone format

Categories