/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Get announcement statistics

    Copy link

    Retrieves daily, weekly, or monthly statistics of all announcements or a specific group of announcements.


    HTTP request

    Copy link
    dailyweeklymonthly
    GET https://api-{application_id}.sendbird.com/v3/announcement_stats/daily
    

    Parameters

    Copy link

    The following table lists the parameters that this action supports.

    Parameters
    RequiredTypeDescription

    start_date

    string

    Specifies the start date of the statistics' time range in YYYY-MM-DD format. This string is effective when using the endpoint /announcement_stats/daily. (Default maximum range: 31 days)

    end_date

    string

    Specifies the end date of the statistics' time range in YYYY-MM-DD format. This string is effective when using the endpoint /announcement_stats/daily. (Default maximum range: 31 days)

    start_week

    string

    Specifies the start week of the statistics' time range in YYYY-W# format. This string is effective when using the endpoint /announcement_stats/weekly. (Default maximum range: five weeks)

    end_week

    string

    Specifies the end week of the statistics' time range in YYYY-W# format. This string is effective when using the endpoint /announcement_stats/weekly. (Default maximum range: five weeks)

    start_month

    string

    Specifies the start month of the statistics' time range in YYYY-MM format. This string is effective when using the endpoint /announcement_stats/monthly. (Default maximum range: one month)

    end_month

    string

    Specifies the end month of the statistics' time range in YYYY-MM format. This string is effective when using the endpoint /announcement_stats/monthly. (Default maximum range: one month)

    OptionalTypeDescription

    announcement_group

    string

    Restricts the search scope to only retrieve announcements in a specified announcement group.

    Note: If you want to increase the default maximum range, contact our sales team.

    dailyweeklymonthly
    // Query string example
    ?start_date=2020-01-01&end_date=2020-01-15
    

    Response

    Copy link

    If successful, this action returns the statistics resources of all announcements or a specific group of announcements within a specified time range in the response body.

    dailyweeklymonthly
    # Status: 200 OK
    {
        "statistics": [
            {
                "date": "2020-01-01",
                "canceled_announcement_count": 1,
                "stopped_announcement_count": 1,
                "completed_announcement_count": 2,
                "total_announcement_count": 4,
                "target_channel_count": 175,
                "target_user_count": 500,
                "sent_channel_count": 175,
                "sent_user_count": 500,
                "open_rate": 0.71,
                "open_count": 355
            },
            ... # More statistics
        ],
        "days": 15
    }
    

    In the case of an error, an error object is returned. A detailed list of error codes is available here.