# إحصائيات الرسائل

## messages:list

يعرض قائمة الرسائل المرسلة.

`POST` `https://api.pushwoosh.com/api/v2/messages:list`

##### Headers

| الاسم | مطلوب | الوصف |
|---|---|---|
| `Authorization`| نعم | [Server API token](/ar/developer/api-reference/api-access-token/#server-api-token). يجب تقديمه بالتنسيق التالي: `Authorization: Api <Server Key>`. |

##### Request body parameters

| الاسم | مطلوب | النوع | الوصف |
|---|---|---|---|
| `platforms` | لا | Array | منصات الرسائل. القيم الممكنة: `"IOS"`, `"ANDROID"`, `"OSX"`, `"WINDOWS"`, `"AMAZON"`, `"SAFARI"`, `"CHROME"`, `"FIREFOX"`, `"IE"`, `"EMAIL"`, `"HUAWEI_ANDROID"`, `"SMS"`. |
| `date_range` | لا | Object | فترة التقرير. يجب أن يتبع `date_from` و `date_to` التنسيق `YYYY-MM-DD` (على سبيل المثال، `"2000-01-01"`). |
| `campaign` | لا | String | [Campaign code](/ar/developer/api-reference/api-identifiers/#campaign-code) |
| `filters` | نعم | Object | فلاتر الرسائل. |
| `source` | لا | String | مصدر الرسالة. على سبيل المثال: `AB_TEST`, `API`, `AUTO_PUSH`, `CP`, `CSV`, `CUSTOMER_JOURNEY`, `EMAIL_API`, `EMAIL_CP`, `GEO_ZONE`, `PUSH_ON_EVENT`, `RSS`. |
| `messages_codes` | لا | Array | [Message codes](/ar/developer/api-reference/api-identifiers/#message-code) التي تم الحصول عليها من استجابات `/createMessage` API. |
| `messages_ids` | لا | Array | معرفات الرسائل (Message IDs) التي تم الحصول عليها من سجل الرسائل (Message History). |
| `params` | لا | Object | حدد ما إذا كنت تريد إظهار تفاصيل الرسالة والمقاييس. قم بتعيين `with_details: true` لتضمين كائن `"details"` و `with_metrics: true` لتضمين كائن `"metrics"` في الاستجابة. |
| `application` | نعم | String | [Pushwoosh application code](/ar/developer/api-reference/api-identifiers/#application-code). |
| `per_page` | لا | Integer | عدد النتائج لكل صفحة (≤ 1000). |
| `page` | لا | Integer | رقم الصفحة لتقسيم الصفحات. |


##### Example request

```
{
    "filters": {
      "platforms": [],                  // IOS, ANDROID, OSX, WINDOWS, AMAZON, SAFARI, CHROME, FIREFOX, IE, EMAIL, HUAWEI_ANDROID, SMS
      "date_range": {
        "date_from": "string",          // Required format: 2000-01-01
        "date_to": "string"             // Required format: 2000-01-01
      },
      "source": "API",                  // AB_TEST, API, AUTO_PUSH, CP, CSV, CUSTOMER_JOURNEY, EMAIL_API, EMAIL_CP, GEO_ZONE, PUSH_ON_EVENT, RSS
      "campaign": "string",             // Campaign code
      "messages_ids": [],               // Message IDs
      "messages_codes": [],             // Message codes
      "application": "string"           // Pushwoosh application code
    },
    "params": {
      "with_details": true,             // Add message details to the response ("details" object)
      "with_metrics": true              // Add message metrics to the response ("metrics" object)
    },
    "per_page": 20,                     // <= 1000
    "page": 0
}
```

 <details>
  <summary> رموز الاستجابة والأمثلة </summary>
<Tabs>
<TabItem label="200: OK">
```
{
  "total": 0,
  "items": [{
    "id": 0,
    "code": "string",
    "created_date": "string",
    "send_date": "string",
    "status": "string",
    "platforms": [],
    "source": "string",
    "push_info": {
      "details": {
        "title": "string",
        "filter_name": "string",
        "filter_code": "string",
        "content": {
          "key": "value"
        },
        "platform_parameters": {
          "android_header": "string",
          "android_root_params": {
            "key": "value"
          },
          "ios_title": "string",
          "ios_subtitle": "string",
          "ios_root_params": {
            "key": "value"
          },
          "chrome_header": "string",
          "chrome_root_params": {
            "key": "value"
          },
          "firefox_header": "string",
          "firefox_root_params": {
            "key": "value"
          },
          "conditions": [               // tag conditions (see /developer/api-reference/messages-api/#tag-conditions)
            TAG_CONDITION1,
            TAG_CONDITION2,
            ...,
            TAG_CONDITIONN
          ],
          "conditions_operator": "AND", // logical operator for conditions arrays; possible values: AND, OR
          "data": {
            "key": "value"
          }
        },
        "follow_user_timezone": true
      },
      "metrics": [{
        "sends": 0,
        "opens": 0,
        "deliveries": 0,
        "inbox_opens": 0,
        "unshowable_sends": 0,
        "errors": 0,
        "platform": 0
      }]
    },
    "email_info": {
      "details": {
        "template": "string",
        "filter_name": "string",
        "filter_code": "string",
        "subject": {
          "key": "value"
        },
        "from_name": "string",
        "from_email": "string",
        "reply_name": "string",
        "reply_email": "string",
        "follow_user_timezone": true,
        "conditions": [              // tag conditions (see Messages-api - tag-conditions) 
          TAG_CONDITION1,
          TAG_CONDITION2,
          ...,
          TAG_CONDITIONN
        ],  
        "conditions_operator": "AND" // logical operator for conditions arrays; possible values: AND, OR
      },
      "metrics": [{
        "sends": 0,
        "opens": 0,
        "deliveries": 0,
        "hard_bounces": 0,
        "soft_bounces": 0,
        "rejects": 0,
        "confirmed_sends": 0,
        "unsubs": 0,
        "complaints": 0,
        "errors": 0
      }]
    }
  }]
}
```
</TabItem>

<TabItem label="400: Bad Request Error">
```json
{
  "error": "exceeded the maximum date interval. Max interval: 30 days"
}
```
</TabItem>

<TabItem label="401: Incorrect API access token">
```json
{
  "error": "account not found"
}
```
</TabItem>

<TabItem label="500: Internal Server Error">

</TabItem>
</Tabs>

</details>


<Aside type="note">
بالنسبة لـ iOS، يرجى التأكد من إضافة Notification Service Extension إلى مشروعك لتتبع تسليم الـ push. [اعرف المزيد](/ar/developer/pushwoosh-sdk/ios-sdk/ios-message-delivery-tracking)
</Aside>

## totalsByIntervals

يُرجع المقاييس وبيانات التحويل بناءً على كود الرسالة، مجمعة بالساعة.

**POST** `https://api.pushwoosh.com/api/v2/statistics/messages/totalsByIntervals`
  

##### Authorization

تتم معالجة المصادقة عبر API Access Token في رأس الطلب.

##### Request body parameters

| اسم المعلمة | النوع | الوصف | مطلوب |
|---|---|---|---|
| `message_code` | string | [Message code](/ar/developer/api-reference/api-identifiers/#message-code) الذي تم الحصول عليه من استجابات `/createMessage` API. | نعم |
| `platforms` | [int] | [Platforms](/ar/developer/api-reference/messages-api/api-prerequisites/#platforms) | لا |

##### Request example

```
{
  "message_code": "XXXXX-XXXXXXXXX-XXXXXXXX", // required. Unique message identifier
  "platforms": [1, 3, 7, 10, 11, 12]          // optional. List of platform codes
}
```

##### Response fields

| الاسم | النوع | الوصف |
|---|---|---|
| **`metrics`** | **array** | **يحتوي على مصفوفة من مقاييس الرسالة** |
| `timestamp` | string | وقت المقياس. |
| `platform` | int | كود المنصة (على سبيل المثال، iOS, Android). |
| `sends` | string | عدد الرسائل المرسلة. |
| `opens` | string | عدد الرسائل المفتوحة. |
| `deliveries` | string | عدد الرسائل التي تم تسليمها. |
| `inbox_opens` | string | عدد مرات الفتح في صندوق الوارد (inbox). |
| `unshowable_sends`| string | عدد الرسائل المرسلة التي تعذر عرضها. |
| `errors` | string | عدد الأخطاء. |
| **`conversion`** | **object** | **يحتوي على بيانات التحويل** |
| `sends` | string | إجمالي عدد الرسائل المرسلة. |
| `opens` | string | إجمالي عدد الرسائل المفتوحة. |
| **`events`** | **array** | **مصفوفة من الأحداث مع إحصائياتها** |
| `name` | string | اسم الحدث (على سبيل المثال، cart add). |
| `hits` | string | عدد مرات الحدوث (hits). |
| `conversion` | float | معدل التحويل بالنسبة لعمليات الفتح. |
| `revenue` | float | الإيرادات (فقط للأحداث ذات السمات `__amount` و `__currency`). |

##### Response example

```
{
  "metrics": [{
    "timestamp": "2024-08-03 15:00:00",  // Timestamp of the metrics in "YYYY-MM-DD HH:MM:SS" format
    "platform": 3,                       // Platform code
    "sends": "55902",                    // Number of messages sent
    "opens": "382",                      // Number of messages opened
    "deliveries": "22931",               // Number of messages delivered
    "inbox_opens": "0",                  // Number of messages opened in the inbox
    "unshowable_sends": "2",             // Number of messages that couldn't be shown
    "errors": "0"                        // Number of errors encountered
  }],
  "conversion": {
    "sends": "55902",                    // Total number of messages sent
    "opens": "772",                      // Total number of messages opened
    "events": [{
      "name": "cart_add",                // Name of the event
      "hits": "96",                      // Number of hits for the event
      "conversion": 0.12,                // Conversion rate relative to opens
      "revenue": 0                       // Revenue generated by the event (only for events with amount/currency attributes)
    }]
  }
}
```

## getMessageLog

يعرض معلومات مفصلة حول الرسائل المرسلة.

`POST` `https://api.pushwoosh.com/api/v2/statistics/getMessageLog`

##### Headers


| الاسم | مطلوب | الوصف |
|---|---|---|
| `Authorization` | مطلوب | [API access token](/ar/developer/api-reference/api-access-token/) من Pushwoosh Control Panel. |


##### Request body parameters

| الاسم | مطلوب | النوع | الوصف |
|---|---|---|---|
| `message_id` | لا | Integer | تحديد أحداث الرسائل بواسطة Message ID الذي تم الحصول عليه من سجل الرسائل. مثال: `12345678900`. |
| `message_code` | لا | String | تحديد أحداث الرسائل بواسطة [Message code](/ar/developer/api-reference/api-identifiers/#message-code) الذي تم الحصول عليه من استجابات `/createMessage` API. مثال: `"A444-AAABBBCC-00112233"`. |
| `campaign_code` | لا | String | تحديد أحداث الرسائل بواسطة [Campaign code](/ar/developer/api-reference/api-identifiers/#campaign-code) المحدد في حمولة رسالتك. مثال: `"AAAAA-XXXXX"`. |
| `hwid` | لا | String or Array | تحديد أحداث الرسائل بواسطة [HWID (Hardware ID)](/ar/developer/api-reference/api-identifiers/#hardware-id) أو مصفوفة من HWIDs. |
| `date_from` | مطلوب إذا لم يتم توفير `message_id`, `message_code`, أو `campaign_code` | Datetime | تاريخ البدء لتصفية الرسائل. التنسيق: `"YYYY-MM-DD HH:MM:SS"`. مثال: `"2000-01-25 00:00:00"`. |
| `date_to` | مطلوب إذا لم يتم توفير `message_id`, `message_code`, أو `campaign_code` | Datetime | تاريخ الانتهاء لتصفية الرسائل. التنسيق: `"YYYY-MM-DD HH:MM:SS"`. مثال: `"2000-01-26 00:00:00"`. |
| `limit` | لا | Integer | الحد الأقصى لعدد أحداث الرسائل التي يتم إرجاعها في استجابة واحدة. القيمة القصوى: `100000`. |
| `pagination_token` | لا | String | رمز ترقيم الصفحات (Pagination token) الذي تم الحصول عليه من استجابة `/getMessageLog` سابقة. استخدمه لاسترداد نتائج إضافية. |
| `user_id` | لا | String | تحديد أحداث الرسائل بواسطة [User ID](/ar/developer/api-reference/api-identifiers/#user-id) مخصص. انظر `/registerUser` لمزيد من التفاصيل. |
| `application_code` | نعم | String | تحديد أحداث الرسائل بواسطة [Pushwoosh application code](/ar/developer/api-reference/api-identifiers/#application-code) |
| `actions` | لا | Array | تصفية النتائج حسب إجراءات رسائل محددة. القيم الممكنة: `"sent"`, `"delivered"`, `"opened"`, `"inbox_delivered"`, `"inbox_read"`, `"inbox_opened"`, `"inbox_deleted"`. |
| `platforms` | لا | Array | مصفوفة المنصات المستهدفة لتصفية النتائج. القيم الممكنة: `"ios"`, `"android"`, `"osx"`, `"windows"`, `"amazon"`, `"safari"`, `"chrome"`, `"firefox"`, `"ie"`, `"email"`, `"huawei_android"`. |

##### Example request
```shell
curl --location --request POST 'https://api.pushwoosh.com/api/v2/statistics/getMessageLog' \
--header 'Authorization: Key API_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
   "pagination_token": "PAGINATION_TOKEN_FROM_PREVIOUS_RESPONSE",  // optional, token for pagination
   "limit": 1000,                                  // optional, the max number of entries for a single response
   "application_code": "XXXXX-XXXXX",              // Pushwoosh app code
   "message_code": "A444-AAABBBCC-00112233",       // optional, message code obtained from /createMessaage request
   "message_id": 1234567890,                       // optional, message ID obtained from Pushwoosh Control Panel
   "campaign_code": "AAAAA-XXXXX",                 // optional, code of a campaign to get the log for
   "hwid": "aaazzzqqqqxxx",                        // optional, hardware ID of a specific device targeted with a message
   "user_id": "user_123",                          // optional, ID of a user targeted with the message
   "date_from": "2000-01-25 00:00:00",             // optional, start of the stats period 
   "date_to": "2000-02-10 23:59:59",               // optional, end of the stats period
   "actions": ["opened", "inbox_opened"],          // optional, used for results filtration. Possible values: "sent", "opened", "delivered", "inbox_delivered", "inbox_read", "inbox_opened", "inbox_deleted". The response will include all the messages with the specified action(s).
   "platforms": ["ios", "chrome"]                  // optional, used for results filtration. Possible values: "ios", "android", "osx", "windows", "amazon", "safari", "chrome", "firefox", "ie", "email", "huawei android"
}'
```


<Aside type="caution" title="مهم">
أحد الحقول التالية مطلوب:\
\- _message\_id_\
_- message\_code_\
_- campaign\_code_\
_- hwid_\
_- user\_id_\
_- date\_from_ و _date\_to_

فكر في تطبيق معلمات تصفية مختلفة للحصول على أقصى استفادة من إحصائيات رسائلك.
</Aside>

<details>
  <summary> رموز الاستجابة والأمثلة </summary>
<Tabs>
<TabItem label="200: OK">
```json
{
  "pagination_token": "PAGINATION_TOKEN_FOR_NEXT_REQUEST",
  "data": [{
    "timestamp": "2000-01-25T11:18:47Z",
    "application_code": "XXXXX-XXXXX",
    "message_id": 12345678900,
    "message_code": "A444-AAABBBCC-00112233",
    "campaign_code": "AAAAA-XXXXX",
    "hwid": "aaazzzqqqqxxx",
    "user_id": "user_123",
    "platform": "android",
    "action": "sent",
    "status": "success",
    "push_alerts_enabled": "true"
  }, {
    "timestamp": "2000-01-25T11:18:49Z",
    "application_code": "XXXXX-XXXXX",
    "message_id": 12345678900,
    "message_code": "A444-AAABBBCC-00112233",
    "campaign_code": "AAAAA-XXXXX",
    "hwid": "aaazzzqqqqxxx",
    "user_id": "user_123",
    "platform": "android",
    "action": "delivered",
    "push_alerts_enabled": "true"
  }, {
    "timestamp": "2000-01-25T11:19:23Z",
    "application_code": "XXXXX-XXXXX",
    "message_id": 12345678900,
    "message_code": "A444-AAABBBCC-00112233",
    "campaign_code": "AAAAA-XXXXX",
    "hwid": "aaazzzqqqqxxx",
    "user_id": "user_123",
    "platform": "android",
    "action": "opened",
    "push_alerts_enabled": "true"
  }]
}
```
</TabItem>

<TabItem label="400: Bad Request">
```json
{
  "error": "exceeded the maximum date interval. Max interval: 30 days"
}
```
</TabItem>

<TabItem label="401: Unauthorized">
```json
{
  "error": "account not found"
}
```
</TabItem>

<TabItem label="500: Internal Server Error">

</TabItem>
</Tabs>

</details>



<Aside type="note">
يمكن تنزيل البيانات بحد أقصى 30 يومًا من الوقت الحالي.
</Aside>


<Aside type="tip">
بالنسبة لـ iOS، يرجى التأكد من إضافة Notification Service Extension إلى مشروعك لتتبع تسليم الـ push. [اعرف المزيد](/ar/developer/pushwoosh-sdk/ios-sdk/ios-message-delivery-tracking)
</Aside>

## Email statistics 

### linksInteractions

يعرض إحصائيات حول النقرات على الروابط في رسائل البريد الإلكتروني.

`POST` `https://api.pushwoosh.com/api/v2/statistics/emails/linksInteractions`


##### Headers

| الاسم | مطلوب | الوصف |
|---|---|---|
| `Authorization` | نعم | [API access token](/ar/developer/api-reference/api-access-token/) من Pushwoosh Control Panel. |

##### Request body parameters

| الاسم | مطلوب | النوع | الوصف |
|---|---|---|---|
| `date_range` | لا | Object | يحدد فترة التقرير. يحتوي على `date_from` و `date_to`. |
| `filters` | نعم | Object | فلاتر البريد الإلكتروني. |
| `application` | نعم | String | [Pushwoosh application code](/ar/developer/api-reference/api-identifiers/#application-code) (بدلاً من ذلك، حدد `campaign`, `messages_ids`, أو `message_codes`). |
| `messages_codes` | نعم | Array | [Message codes](/ar/developer/api-reference/api-identifiers/#message-code) (بدلاً من ذلك، حدد `application`, `campaign`, أو `messages_ids`). |
| `campaign` | نعم | String | [Campaign code](/ar/developer/api-reference/api-identifiers/#campaign-code) (بدلاً من ذلك، حدد `application`, `messages_ids`, أو `message_codes`). |
| `messages_ids` | نعم | Array | Message IDs (بدلاً من ذلك، حدد `application`, `campaign`, أو `message_codes`). |
| `link_template` | مطلوب إذا تم تحديد `application` أو `campaign`. | String | تصفية تفاعلات روابط البريد الإلكتروني حسب الكلمة الرئيسية. سيتم إرجاع الروابط التي تتضمن النص المحدد في عنوان URL الخاص بها فقط في استجابة API. على سبيل المثال، إذا كان بريدك الإلكتروني يحتوي على روابط مثل `https://example.com/news` و `https://example.com/shop`، فإن تعيين "link_template": "shop" سيعيد التفاعلات لـ `https://example.com/shop` فقط. |
| `email_content_code` | لا | String | [Unique identifier for the email content](/ar/developer/api-reference/api-identifiers/#email-content-code). |
| `params` | لا | Object | يحدد خيارات استجابة إضافية. يتضمن `with_full_links`، الذي يضيف قائمة بالروابط الكاملة مع الإحصائيات. |

##### Request example 

```shell
curl --location --request POST 'https://api.pushwoosh.com/api/v2/statistics/emails/linksInteractions' \
--header 'Authorization: Api API_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
   "filters": {
      "date_range": {
         "date_from": "string",           // Required format: 2000-01-01
         "date_to": "string"              // Required format: 2000-01-01
      },
      "campaign": "string",               // Campaign code (you can specify application, messages_ids, or message_codes instead)
      "application": "string",            // Application code (you can specify campaign, messages_ids, or message_codes instead)
      "messages_ids": [],                 // Message IDs (you can specify application, campaign, or message_codes instead)
      "messages_codes": [],               // Message codes (you can specify application, campaign, or message_ids instead)
      "link_template": "string",          // Link template (required if application or campaign is specified)
      "email_content_code": "string"      // Unique identifier for the email content.
   },
   "params": {
      "with_full_links": true             // Specify whether to show detailed statistics. A list of full links with statistics will be passed in the full_links array.
   }
}'
``` 

##### Response codes and examples 
<Tabs>
<TabItem label="200: OK">
```json
{
  "items": [{
    "template": "string",
    "link": "string",
    "title": "string",
    "clicks": 0,
    "full_links": [{
      "full_link": "string",
      "clicks": 0
    }]
  }]
}
```
</TabItem>

<TabItem label="400: Bad Request">
```json
{
  "error": "exceeded the maximum date interval. Max interval: 30 days"
}
```
</TabItem>

<TabItem label="401: Unauthorized">
```json
{
  "error": "account not found"
}
```
</TabItem>

<TabItem label="500: Internal Server Error ">

</TabItem>
</Tabs>



### linksInteractionsDevices

يظهر المستخدمين الذين نقروا على الروابط في رسائل البريد الإلكتروني.

`POST` `https://api.pushwoosh.com/api/v2/statistics/emails/linksInteractionsDevices`


##### Headers

| الاسم | مطلوب | الوصف |
|---|---|---|
| `Authorization` | نعم | [API access token](/ar/developer/api-reference/api-access-token/) من Pushwoosh Control Panel. |



##### Request body parameters

| الاسم | مطلوب | النوع | الوصف |
|---|---|---|---|
| `date_range` | لا | Object | يحدد فترة التقرير. يحتوي على `date_from` و `date_to`. |
| `filters` | نعم | Object | فلاتر البريد الإلكتروني. |
| `application` | نعم | String | [Pushwoosh application code](/ar/developer/api-reference/api-identifiers/#application-code) (بدلاً من ذلك، حدد `campaign`, `messages_ids`, أو `message_codes`). |
| `messages_codes` | نعم | Array | [Message codes](/ar/developer/api-reference/api-identifiers/#message-code) (بدلاً من ذلك، حدد `application`, `campaign`, أو `messages_ids`). |
| `campaign` | نعم | String | [Campaign code](/ar/developer/api-reference/api-identifiers/#campaign-code) (بدلاً من ذلك، حدد `application`, `messages_ids`, أو `message_codes`). |
| `messages_ids` | نعم | Array | Message IDs (بدلاً من ذلك، حدد `application`, `campaign`, أو `message_codes`). |
| `link_template` | مطلوب إذا تم تحديد `application` أو `campaign`. | String | تصفية تفاعلات روابط البريد الإلكتروني حسب الكلمة الرئيسية. سيتم إرجاع الروابط التي تتضمن النص المحدد في عنوان URL الخاص بها فقط في استجابة API. على سبيل المثال، إذا كان بريدك الإلكتروني يحتوي على روابط مثل `https://example.com/news` و `https://example.com/shop`، فإن تعيين "link_template": "shop" سيعيد التفاعلات لـ `https://example.com/shop` فقط. |
| `email_content_code` | لا | String | [Unique identifier for the email content](/ar/developer/api-reference/api-identifiers/#email-content-code). |
| `page` | لا | Integer | رقم الصفحة لتقسيم الصفحات. |
| `per_page` | لا | Integer | عدد النتائج لكل صفحة (≤ 1000). |

##### Request example

```shell
curl --location --request POST 'https://api.pushwoosh.com/api/v2/statistics/emails/linksInteractionsDevices' \
--header 'Authorization: Api API_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
   "filters": {
      "date_range": {
         "date_from": "string",         // Required format: 2000-01-01
         "date_to": "string"            // Required format: 2000-01-01
      },
      "campaign": "string",             // Campaign code (you can specify application, messages_ids, or message_codes instead)
      "application": "string",          // Application code (you can specify campaign, messages_ids, or message_codes instead)
      "messages_ids": [],               // Message IDs (you can specify application, campaign, or message_codes instead)
      "messages_codes": [],             // Message codes (you can specify application, campaign, or message_ids instead)
      "link_template": "string",        // Link template (required if application or campaign is specified)
      "email_content_code": "string"    // Unique identifier for the email content.
   },
   "per_page": 100,
   "page": 0
}'
``` 

##### Response codes and examples  
<Tabs>
<TabItem label="200: OK">
```json
{
  "total": 0,
  "items": [{
    "timestamp": "string",
    "link": "string",
    "hwid": "string"
  }]
}
```
</TabItem>

<TabItem label="400: Bad Request">
```json
{
  "error": "exceeded the maximum date interval. Max interval: 30 days"
}
```
</TabItem>

<TabItem label="401: Unauthorized">
```json
{
  "error": "account not found"
}
```
</TabItem>

<TabItem label="500: Internal Server Error">

</TabItem>
</Tabs>


### bouncedEmails

**POST** `https://api.pushwoosh.com/api/v2/statistics/emails/bouncedEmails`

يوفر بيانات حول شكاوى البريد الإلكتروني، والارتدادات الخفيفة (soft bounces)، والارتدادات الصلبة (hard bounces)، بما في ذلك التاريخ، وعنوان البريد الإلكتروني، وسبب كل ارتداد.

##### Authorization

تتم معالجة المصادقة عبر API Access Token في رأس الطلب.

##### Request body parameters

| اسم المعلمة | النوع | الوصف | مطلوب |
|---|---|---|---|
| `application` | string | [Pushwoosh application code](/ar/developer/api-reference/api-identifiers/#application-code) | نعم |
| `message_code` | string | [Message code](/ar/developer/api-reference/api-identifiers/#message-code). | مطلوب إذا لم يتم توفير `date range` أو `campaign` |
| `campaign` | string | [Campaign code](/ar/developer/api-reference/api-identifiers/#campaign-code). | مطلوب إذا لم يتم توفير `message_code` أو `date range` |
| `date_from` | string | تاريخ البدء للبيانات بالتنسيق `YYYY-MM-DDTHH:MM:SS.000Z` (معيار ISO 8601). | مطلوب إذا لم يتم توفير `message_code` أو `campaign` |
| `date_to` | string | تاريخ الانتهاء للبيانات بالتنسيق `YYYY-MM-DDTHH:MM:SS.000Z` (معيار ISO 8601). | مطلوب إذا لم يتم توفير `message_code` أو `campaign` |
| `per_page` | int | عدد الصفوف لكل صفحة، بحد أقصى 5000. | نعم |
| `page` | int | رقم الصفحة، بدءًا من الصفر. | نعم |
| `type` | string | نوع الارتداد: Complaint, Softbounce, Hardbounce. | لا |

##### Request example

```
{
  "application": "XXXXX-XXXXX",               // required. Pushwoosh app code
  "message_code": "XXXXX-XXXXXXXXX-XXXXXXXX", // required if campaign or date range is not provided.
                                              //          Unique message identifier
  "campaign": "XXXXX-XXXXX",                  // required if message_code or date range is not provided.
                                              //          Campaign code
  "date_from": "2024-07-20T00:00:00.000Z",    // required if message_code or campaign is not provided.
                                              //          Start date in ISO 8601 format "YYYY-MM-DDTHH:MM:SS.SSSZ"
  "date_to": "2024-07-20T00:00:00.000Z",      // required if message_code or campaign is not provided.
                                              //          End date in ISO 8601 format "YYYY-MM-DDTHH:MM:SS.SSSZ"
  "per_page": 1000,                           // required. Number of results per page, maximum 5000
  "page": 5,                                  // optional. Page number, starting from zero
  "type": "Softbounce"                        // optional. The type of bounce: Complaint, Softbounce, Hardbounce 
}

```

##### Response fields

| اسم الحقل | النوع | الوصف |
|---|---|---|
| `total` | int | إجمالي عدد الصفوف. |
| `bounced_emails` | array | مصفوفة من تفاصيل البريد الإلكتروني المرتد. |
| ├── `email` | string | عنوان البريد الإلكتروني الذي ارتد. |
| ├── `date` | string | تاريخ الارتداد (التنسيق: `YYYY-MM-DDTHH:MM:SS.000Z`). |
| ├── `reason` | string | سبب الارتداد. |
| └── `type` | string | نوع الارتداد: Complaint, Softbounce, Hardbounce. |

##### Response example

```
{
  "total": 25,                             // Total count of rows.
  "bounced_emails": [{
    "email": "example@example.com",        // Email address that bounced
    "date": "2024-07-20T00:00:00.000Z",    // Bounce date in ISO 8601 format
    "reason": "Invalid recipient address", // Reason for the bounce
    "type": "Hardbounce"                   // Type of bounce: Complaint, Softbounce, Hardbounce
  }]
}
```