Skip to content
campaiDeveloper
campai.com

Donation · Donations · Statistics

GET/{organizationId}/{mandateId}/donation/donations/statistics/formDonationsReads only

Get form donations

Returns what was given through donation forms in a period, in cents, per form with what is still to pay of it, and for the ten sources that brought the most. The source is the UTM source of the link or the host the donator came from. Rejected submissions are left out

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Permission checks in detail
Required permissions
  • mandate.read
  • donation.read
  • donationFormSubmission.read

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Query parameters

  • fromDatestringrequired
  • toDatestringrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/donation/donations/statistics/formDonations' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • formsobject[]
    5 properties
    • formid
    • namestring
    • donationCountinteger

      at least 0

    • amountnumber

      at least 0

    • unpaidAmountnumber

      at least 0

  • sourcesobject[]
    3 properties
    • sourcestringnullable
    • donationCountinteger

      at least 0

    • amountnumber

      at least 0

Response200
{
  "forms": [
    {
      "form": "000000000000000000000001",
      "name": "string",
      "donationCount": 0,
      "amount": 0,
      "unpaidAmount": 0
    }
  ],
  "sources": [
    {
      "source": "string",
      "donationCount": 0,
      "amount": 0
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.