Create Constituent endpoint and multiple email addresses
Hello everyone
I am using the POST Constituent API call in order to create a new constituent record. In my POST request, I want to create the constituent with 2 email address records (a business type and a personal type). The guidance has an example of a single email but I want an email array to create the constituent with the 2 email addresses in the one call. Is this possible? Im getting error messages when attempting:
Thank you
Damon
[{"message":"Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'ConstituentEmailAddressAdd' because the type requires a JSON object (e.g. {\\"name\\":\\"value\\"}) to deserialize correctly.\\r\\nTo fix this error either change the JSON to a JSON object (e.g. {\\"name\\":\\"value\\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\\r\\nPath 'email', line 1, position 420.","error_code":400,"raw_message":"Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'ConstituentEmailAddressAdd' because the type requires a JSON object (e.g. {\\"name\\":\\"value\\"}) to deserialize correctly.\\r\\nTo fix this error either change the JSON to a JSON object (e.g. {\\"name\\":\\"value\\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\\r\\nPath 'email', line 1, position 420."}]
Comments
-
Hi Damon,
At this time, the endpoint that you're calling doesn't allow providing multiple emails for the constituent - just a single value is supported (you can see this in the docs on the endpoint reference page). So to accomplish this, you'll need to make two API calls:
- First call CreateConstituent to create the constituent with one email address (and to get the ID of the newly created constituent)
- Then call CreateConstituentEmailAddress to create the second email address, providing the ID of the newly created constituent in the request.
I hope this helps - if you'd like, feel free to file a suggestion for this functionality on the idea bank here:
0 -
Thank you for the reply Ben, its much appreciated. Im quite happy to make the two API calls, I just wanted to be sure.
Kind Regards
Damon
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 206 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 357 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 561 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.6K SKY Developer
- 242 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 778 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)

