API reference · Votes
Create a vote
POST/v1/votes
This vote will then have to be casted i.e linked to a Charity.
Requires a Bearer access token.
Body
CreateVoteDtocampaignId#stringrequiredUUIDId of the campaign
weight#numberintegerminimum 1An optional weight to assign to this vote. Weight affects campaign's buget distribution amongs charities. Vote with larger weight will direct a larger amount of the campaign's budget towards a charity than one with a lesser weight. This is only useful if you want some votes to have more weights than others.
externalId#stringAn optional internal id of your system e.g orderId or customerId. Can be used to link a donation to an entity in your system. Votes can be queried using this field.
uniqueExternalId#stringSimilar to externalId but should be unique across all votes. Can be used to prevent duplicate votes.
donor#PartialDonorOnly required for EMAIL or SLACK campaigns. Attach useful user data to votes for a better usage tracking.
19 child fields
streetstringAddress line 1
streetAdditionstringAddress line 2
citystringCity
countrystringCountry alpha 2 ISO code
zipstringZip code
firstNamestringDonor's first name
lastNamestringDonor's last name
emailstringemail addressDonor's email.
companyNamestringDonor's company name.
phonestringDonor's phone number.
birthdatestring (date)pictureUrlstringURLDonor's phone number.
titlestringDonor's job title.
personalEmailstringemail addressDonor's personal email.
personastringPersona of the donor.
CSRMARKETINGHRSALESCOMMUNICATIONPRODUCTSMBOTHERextraInfostringAdditional information about the donor.
externalIdstringOptional id to link this donor to an entity on your side.
uniqueExternalIdstringSimilar to externalId but should be unique across all donors. Can be used to prevent duplicate donors
slackIdstringDonor's slack id. Required for SLACK campaigns.
language#stringLocale to be used to communicate with the donor. Default to the campaign's language value.
frensendingDate#string (date-time)Required for EMAIL and SLACK campaigns, when Charitips sends it to the donor.
Response
201 · VoteNo field is described in the spec.
voteId#stringalways returnedweight#numberstatus#VoteStatusalways returnedPENDINGDONEPROCESSEDsecret#stringalways returnedexternalId#stringuniqueExternalId#stringcastedAt#string (date-time)validatedAt#string (date-time)processedAt#string (date-time)billingStatus#BillingStatusalways returnedPENDINGBILLEDPAIDautoAssigned#booleansendingMode#CampaignSendingModealways returnedMANUALEMAILPHYSICALSLACKPOSTALsendingDate#string (date-time)sendingStatus#DonationSendingStatusalways returnedPENDINGFAILEDDONElastReminderId#stringmessage#stringreminderMessage#stringfrom#stringlanguage#Languagealways returnedfrenaccountId#stringalways returnedcampaignId#stringalways returnedcharityId#stringtransactionId#stringdonorId#stringcreatedAt#string (date-time)always returnedupdatedAt#string (date-time)always returned
Errors
- 400 Bad Request
Campaign is a FACE_VALUE one. Only donations can be created
{ "statusCode": 400, "message": "Campaign is a FACE_VALUE one. Only donations can be created", "error": "Bad Request" }Votes cannot be posted.
{ "statusCode": 400, "message": "Votes cannot be posted.", "error": "Bad Request" }donor is required for EMAIL campaigns.
{ "statusCode": 400, "message": "donor is required for EMAIL campaigns.", "error": "Bad Request" }Both donor.email and donor.firstName are required for email campaigns
{ "statusCode": 400, "message": "Both donor.email and donor.firstName are required for email campaigns", "error": "Bad Request" }donor is required for SLACK campaigns.
{ "statusCode": 400, "message": "donor is required for SLACK campaigns.", "error": "Bad Request" }Both donor.slackId and donor.firstName are required for slack campaigns
{ "statusCode": 400, "message": "Both donor.slackId and donor.firstName are required for slack campaigns", "error": "Bad Request" }A field is missing, has the wrong type, or is not part of the request schema.
Every request with a body or query is validated.
{ "statusCode": 400, "message": [ "amount must not be less than 1", "property foo should not exist" ], "error": "Bad Request" }Bad Request
No resource with this id on your account: the API answers as if it did not exist.
{ "statusCode": 400, "message": "Bad Request" }- 401 Unauthorized
Unauthorized
Missing, expired or invalid access token.
{ "statusCode": 401, "message": "Unauthorized" }- 403 Forbidden
Campaign has ended.
{ "statusCode": 403, "message": "Campaign has ended.", "error": "Forbidden" }Campaign has to be activated first.
{ "statusCode": 403, "message": "Campaign has to be activated first.", "error": "Forbidden" }Only recurring donations can be created for recurring campaigns.
{ "statusCode": 403, "message": "Only recurring donations can be created for recurring campaigns.", "error": "Forbidden" }Account not validated
{ "statusCode": 403, "message": "Account not validated", "error": "Forbidden" }Account closed
{ "message": "Account closed", "code": "ACCOUNT_CLOSED" }- 409 Conflict
Unique constraint failed on uniqueExternalId
{ "statusCode": 409, "message": "Unique constraint failed on uniqueExternalId" }
curl -X POST https://api.sandbox.charitips.com/v1/votes \ -H "Authorization: Bearer $CHARITIPS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "campaignId": "<campaignId>", "uniqueExternalId": "employee_4410" }'Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.