API reference · Campaigns
Get campaign metrics
GET/v1/campaigns/{campaignId}/metrics
Retrieve aggregated usage metrics about a campaign. These metrics match the ones displayed in the campaign dashboard and the admin metrics widget. ⚠️ We recommend including the admin metrics widget in your app instead for a better experience.
Requires a Bearer access token.
Parameters
1 of 6 fields has no description in the spec.
campaignId#stringin pathrequiredcreatedAt_lt#string (date-time)in queryFormat: YYYY-MM-DDTHH:MM:SSZ.
createdAt_lte#string (date-time)in queryFormat: YYYY-MM-DDTHH:MM:SSZ.
createdAt_gt#string (date-time)in queryFormat: YYYY-MM-DDTHH:MM:SSZ.
createdAt_gte#string (date-time)in queryFormat: YYYY-MM-DDTHH:MM:SSZ.
includeMatchedDonationsInMetrics#booleanin queryInclude matched donations made by and charged to the beneficiary in the metrics
Response
200 · CampaignMetricsNo field is described in the spec.
numberOfDonations#numberalways returnedtotalDonation#numberalways returnednumberOfMatchedDonations#numberalways returnedtotalMatchedDonation#numberalways returnednumberOfCharitiesWithDonations#numberalways returnedusedDonationsMetric#Metricalways returned2 child fields
valuenumberalways returnedpercentagenumberalways returned
sortedCharities#SortedCharity[]always returned10 child fields
charityIdstringalways returnednamestringalways returnedlogoUrlstringalways returnedsustainableDevelopmentGoalsstring[]always returnedNO_POVERTYZERO_HUNGERGOOD_HEALTH_AND_WELL_BEINGQUALITY_EDUCATIONGENDER_EQUALITYCLEAN_WATER_AND_SANITATIONAFFORDABLE_AND_CLEAN_ENERGYDECENT_WORK_AND_ECONOMIC_GROWTHINDUSTRY_INNOVATION_AND_INFRASTRUCTUREREDUCED_INEQUALITIESSUSTAINABLE_CITIES_AND_COMMUNITIESRESPONSIBLE_CONSUMPTION_AND_PRODUCTIONCLIMATE_ACTIONLIFE_BELOW_WATERLIFE_ON_LANDPEACE_JUSTICE_AND_STRONG_INSTITUTIONSPARTNERSHIPS_FOR_THE_GOALSimpactIndicatorsOmitTypeClass[]always returned10 child fields
userInvitationIdstringalways returnedfirstNamestringalways returnedlastNamestringalways returnedemailstringalways returnedphonestringstatusUserInvitationStatusalways returnedPENDINGCLAIMEDCANCELEDroleRolealways returnedADMINMEMBERPAYROLL_MANAGERaccountIdstringalways returnedcreatedAtstring (date-time)always returnedupdatedAtstring (date-time)always returned
numberOfDonationsnumberalways returnedtotalnumberalways returnedpercentagenumberalways returnedtotalMatchedDonationnumberalways returnedlatestDonationstring (date-time)always returned
sortedSdgs#SortedSustainableDevelopmentGoal[]always returned5 child fields
sustainableDevelopmentGoalstringalways returnedNO_POVERTYZERO_HUNGERGOOD_HEALTH_AND_WELL_BEINGQUALITY_EDUCATIONGENDER_EQUALITYCLEAN_WATER_AND_SANITATIONAFFORDABLE_AND_CLEAN_ENERGYDECENT_WORK_AND_ECONOMIC_GROWTHINDUSTRY_INNOVATION_AND_INFRASTRUCTUREREDUCED_INEQUALITIESSUSTAINABLE_CITIES_AND_COMMUNITIESRESPONSIBLE_CONSUMPTION_AND_PRODUCTIONCLIMATE_ACTIONLIFE_BELOW_WATERLIFE_ON_LANDPEACE_JUSTICE_AND_STRONG_INSTITUTIONSPARTNERSHIPS_FOR_THE_GOALSnumberOfDonationsnumberalways returnedtotalnumberalways returnedpercentagenumberalways returnedcharitiesLightCharity[]always returned3 child fields
charityIdstringalways returnednamestringalways returnedlogoUrlstringalways returned
sortedImpactIndicators#SortedImpactIndicator[]always returned9 child fields
charityImpactIndicatorIdstringalways returnedsingularLabelstringalways returnedpluralLabelstringalways returnedcountnumberalways returnedtotalnumberalways returnedcountMatchedDonationnumberalways returnedtotalMatchedDonationnumberalways returnednamestringalways returnedlogoUrlstringalways returned
monthlyDonations#MonthlyDonation[]always returned3 child fields
namestringalways returnedaveragenumberalways returnedaverageMatchedDonationnumberalways returned
nps#NPSalways returned4 child fields
promotersnumberalways returneddetractorsnumberalways returnedneutralsnumberalways returnedscorenumberalways returned
rating#Ratingalways returned1 child field
averagenumberalways returned
comments#Commment[]always returned5 child fields
feedbackIdstringalways returnedcommentstringcharityCommentCharityalways returned2 child fields
namestringalways returnedlogoUrlstringalways returned
campaignCommentCampaignalways returned2 child fields
namestringalways returnedlogoUrlstring
donorCommentDonoralways returned1 child field
emailstring
emailMetrics#EmailMetricsalways returned4 child fields
sentMetricalways returned2 child fields
valuenumberalways returnedpercentagenumberalways returned
openedMetricalways returned2 child fields
valuenumberalways returnedpercentagenumberalways returned
clickedMetricalways returned2 child fields
valuenumberalways returnedpercentagenumberalways returned
errorMetricalways returned2 child fields
valuenumberalways returnedpercentagenumberalways returned
Errors
400A 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" }401Unauthorized
Missing, expired or invalid access token.
{ "statusCode": 401, "message": "Unauthorized" }403Account closed
{ "message": "Account closed", "code": "ACCOUNT_CLOSED" }403Forbidden
Your credentials cannot perform this action on this resource. An id from another account answers 404 in the path, 400 in the body or the query.
{ "statusCode": 403, "message": "Forbidden" }404Not Found
No resource with this id on your account: the API answers as if it did not exist.
{ "statusCode": 404, "message": "Not Found" }
curl -X GET https://api.sandbox.charitips.com/v1/campaigns/<campaignId>/metrics \ -H "Authorization: Bearer $CHARITIPS_TOKEN"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.