Getting 400 Bad Request when trying to create a constituent via the API

https://api.sky.blackbaud.com/constituent/v1/constituents

Posting to the following URL with an access token returns 400 Bad Request everytime.

Headers Sent:

Content-Type = 'application/json; charset=utf-8',

Bb-Api-Subscription-Key => ‘{Subscription Key}’

Authorization => ‘Bearer {access token}’

Body Sent in the Request:

{
"first": "Test",
"last": "Test",
"email":
{
"address": "test@test.com",
"do_not_email": false,
"inactive": false,
"primary": true,
"type": "Email"
},
"address":
{
"type": "Home",
"city": "Philadelphia",
"state": "Pennsylvania"
},
"type": "Individual"
}

Am I missing something here? Looking at the error codes in the wadl file says that 400 Response would be returned if the Body is not in the correct format. But this is in the correct format, so what's happening here??

Comments

  • I found the problem, the type: “Email” was not the correct value. Used the correct value for this and is working fine now!

Categories