Get Campaign stats

The Campaign Stats endpoint provides detailed statistics about a specific campaign, including the amount of money raised, the number of people who donated, and the statistics for different donation groups. This section outlines how to retrieve campaign statistics using the Campaign Stats endpoint.

Campaign Stats Endpoint

To retrieve campaign statistics, make a GET request to the following endpoint:

https://api.peach-in.com/v4/campaigns/stats/{accountId}/{campaignId}
  • Replace {campaignId} with the unique identifier of the campaign you want to retrieve statistics for.

Response

A successful response to the Campaign Stats endpoint will return the campaign statistics in the JSON format. The response will include the following information:

Here's an example response:

{
    "campaignGoal": 5000,
    "totalSum": {
        "ILS": 20637.941389000003
    },
    "totalDonationCount": 275,
    "campaignGroups": {
        "hh9J1che": {
            "clicks": 0,
            "groupName": "test2",
            "createdAt": 1682246882662,
            "donationCount": 1,
            "linkId": "t2zahh9J1che",
            "managerId": "000",
            "groupGoal": "1000",
            "amountRaisedInILS": 5
        },
        "490g1che": 
            "clicks": 0,
            "lastName": "yyy",
            "groupName": "test",
            "createdAt": 1684356387968,
            "donationCount": 0,
            "linkId": "t2za490g1che",
            "managerId": "000",
            "groupGoal": "1234",
            "amountRaisedInILS": 0
        },
    }
}

Example

Here's an example cURL command to retrieve statistics for a specific campaign:

bashCopy codecurl -X GET \
  https://api.peach-in.com/v4/campaigns/stats/{accountID}/{campaignId}

Replace YOUR_API_KEY with your actual API key and campaign123 with the ID of the campaign you want to retrieve statistics for.

Last updated