Not sure if this is the right place to post, but...
I've done various things with Tessitura's API, including GETS and POST etc... POSTS I've done to Custom/Execute for hitting my stored procedures. The REST client testing site is great for the Custom/Execute, because is gives me a JSON sample of how to structure the POST. I'm not finding the same kind of help for how to structure the JSON for POST to CRM/Constituents/Snapshot.
I simply want to create a constituent from an electronicAddress... so maybe this is better: CRM/Constituents/Detail
Regardless, I only want to send in an email. Can anybody give me some sample JSON that should work? I'm getting an error such as:
stdClass Object ( [success] => [status] => Bad Request [error] => [ { "Code": "FIELD_CANNOT_BE_NULL", "Description": "Field 'constituentSnapshot' cannot be null or empty."
Is it something like this:
{ "constituentSnapshot": { "electronicAddress": "billy.jack@gmail.com" } }
Thanks!
Jason
I might be making progress... now the error is: stdClass Object ( [success] => [status] => Bad Request [error] => [ { "Code": "FIELD_CANNOT_BE_NULL", "Description": "Field 'constituentSnapshot.ConstituentType' cannot be null or empty.
So now I need to structure a ConstituentType, but for a brand new constituent....
The REST tool help says this, but I don't know any of this... it's a new constituent?
"ConstituentType": { "Description": "sample string 1", "Id": 1, "Inactive": true, "ConstituentGroup": { "Description": "sample string 1", "Id": 1, "Inactive": true } },
But it also says none of this is "Required", so not sure what to think.
The only thing that you need for ConstituentType is the Id value. This goes for most reference data on an entity ("Category", "Group", "Type", etc). The following should work on your request object:
"ConstituentType": { "Id": 1 }
The service verifies that the object is an actual reference and returns the saved ConstituentSnapshot with a fully "baked" ConstituentType.
Thanks Ryan!
I think i have it now... i'm at least getting to the point where it is telling me that my system can't create a constituent without a Primary Address.
{"ConstituentType":{"Id":"1"},"ElectronicAddress":{"Address":"james.bond@gmail.com"},"OriginalSource":{"Id":"1"},"Inactive":{"Id":"1"},"LastName":"Andrea"}
stdClass Object ( [success] => [status] => Bad Request [error] => [ { "Code": "CANNOT_CREATE_CONSTITUENT_ATLEAST_ONE_ADDRESS_IS_REQUIRED", "Description": "Cannot create constituent because the rule for Require Address is turned on, which enforces a constituent to have at least one Primary Address.", "Details": null, "ErrorPath": "Constituent Address" } ] [data] => [response_headers] => Array ( [http_status_message] => Bad Request [http_status_code] => 400 [cache-control] => no-cache, no-store [pragma] => no-cache [content-type] => application/json; charset=utf-8 [expires] => -1 [server] => Microsoft-IIS/7.5 [access-control-allow-origin] => * [x-aspnet-version] => 4.0.30319 [x-powered-by] => ASP.NET [date] => Thu, 26 Oct 2017 20:23:01 GMT [content-length] => 317 ) [message] => [error_number] => 0 ) here...
This is a rule set for the organization in SystemDefaults (T_DEFAULTS). By default Tessitura requires each constituent to have a primary address. To get an idea of required address properties, GET an existing one and note what is returned. For NEW entities, the Id property will need to be set to NULL or -999 (a reserved number for new).