# Statistics

## Get global statistics

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatistics`

Get campaign statistics by campaign ID

#### Query Parameters

| Name                                         | Type | Description            |
| -------------------------------------------- | ---- | ---------------------- |
| campaignId<mark style="color:red;">\*</mark> | Int  | The ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of statistics for each email of the campaign" %}

{% endtab %}
{% endtabs %}

## Get detailed statistics

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsDetailed`

This route returns a listing of each user statistics for a specific campaign.

#### Query Parameters

| Name                                         | Type | Description                                                                                           |
| -------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------- |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign                                                                                    |
| offset                                       | Int  | From which element in the database you would like to start getting campaign, by default it's set to 0 |
| limit                                        | Int  | The number of campaigns you would like to get in your request, by default it's set to 100             |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of user detailed statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% endtab %}
{% endtabs %}

## Get click statistics per user

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsClicks`

This route returns a listing of all the users who have click statistics

#### Query Parameters

| Name                                         | Type | Description        |
| -------------------------------------------- | ---- | ------------------ |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of user  statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% endtab %}
{% endtabs %}

## Get click statistics per URL

<mark style="color:blue;">`GET`</mark> `https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignStatisticsLinks`

This route returns a listing of links statistics for a specific campaign.

#### Query Parameters

| Name                                         | Type | Description        |
| -------------------------------------------- | ---- | ------------------ |
| campaignId<mark style="color:red;">\*</mark> | Int  | ID of the campaign |

#### Headers

| Name                                      | Type   | Description                                                                                         |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License". |

{% tabs %}
{% tab title="200: OK Array of links statistics" %}

{% endtab %}

{% tab title="404: Not Found Campaign not found" %}

{% endtab %}
{% endtabs %}
