---
updatedAt: 2026-08-24T18:49:27.000Z
agentTools:
  siteIndex: https://developer.rmlconnect.net/llms.txt
  projectIndex: https://developer.rmlconnect.net/route-mobile-project/llms.txt
---

# WhatsApp Reports

> **Use the WhatsApp Reports APIs to create message reports, fetch report URLs, view campaign summaries, download opt-in reports, and count templates.**

## API overview

<Cards>
  <Card title="Create Report" icon="fa-solid fa-file-circle-plus">
    Create reports for your WhatsApp Business account.
  </Card>
  <Card title="Create Campaign Specific Report" icon="fa-solid fa-chart-simple">
    Create a campaign-specific report for a WhatsApp Business account.
  </Card>
  <Card title="Fetch Report URL" icon="fa-solid fa-link">
    Fetch campaign data by using the report ID.
  </Card>
  <Card title="View Campaign Summary" icon="fa-solid fa-table-list">
    View campaign summary details for a WhatsApp Business account.
  </Card>
  <Card title="View Report Summary" icon="fa-solid fa-file-lines">
    View report summary details for generated WhatsApp reports.
  </Card>
  <Card title="Optin Create Report" icon="fa-solid fa-user-check">
    Create a report for user opt-ins.
  </Card>
  <Card title="Download Optin Report" icon="fa-solid fa-download">
    Download the user opt-ins report.
  </Card>
  <Card title="Template Wise Count" icon="fa-solid fa-layer-group">
    Count approved templates associated with a WhatsApp Business account.
  </Card>
</Cards>

## Endpoint summary

| API                             | Purpose                                                                  | URL                                                                                               |
| ------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| Create Report                   | Create reports for your WhatsApp Business account.                       | <https://apis.rmlconnect.net/whatsapp/report/v1/create_report/myaccounts_panel>                   |
| Create Campaign Specific Report | Create a campaign-specific report for WhatsApp Business account.         | <https://apis.rmlconnect.net/whatsapp/report/v1/create_campaign_specific_report/myaccounts_panel> |
| Fetch Report URL                | Fetch campaign data by entering the `report_id` parameter details.       | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_specific_report/{report_id}>       |
| View Campaign Summary           | View the campaign summary for the WhatsApp Business account.             | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_details>                           |
| View Report Summary             | View report summary for the WhatsApp Business account.                   | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_reports>                                    |
| Optin Create Report             | Report user opt-ins for receiving messages from a business.              | <https://apis.rmlconnect.net/whatsapp/report/v1/optin-download>                                   |
| Download Optin Report           | Download the user opt-ins report for receiving messages from a business. | <https://apis.rmlconnect.net/whatsapp/report/v1/summary/download_optin_report>                    |
| Template Wise Count             | Count approved templates associated with a WhatsApp Business account.    | <https://apis.rmlconnect.net/whatsapp/report/v1/template-count>                                   |

## Create Report

Create reports for your WhatsApp Business account. Use the projections while creating a new report.

<Accordion title="Available projection fields" icon="fa-solid fa-list-check">

| Field | Description |
| ----- | ----------- |
| country_code | The country code of the phone number. |
| msisdn | The phone number of the customer. |
| message_type | The type of the message, such as text, image, video, and document. |
| message_payload | The content of the message. |
| request_id | The request ID of the message. |
| conversation_id | The conversation ID of the message. |
| message_id | The message ID of the message. |
| submit_timestamp | The timestamp when the message was submitted. |
| sent_timestamp | The timestamp when the message was sent. |
| delivery_timestamp | The timestamp when the message was delivered. |
| read_timestamp | The timestamp when the message was read. |
| failed_timestamp | The timestamp when the message failed to be delivered. |
| deleted_timestamp | The timestamp when the message was deleted. |
| extra | Any additional metadata associated with the message. |
| pricing_model | The pricing model for the message. |

</Accordion>

**Endpoint details**

| Field               | Value                                                                           |
| ------------------- | ------------------------------------------------------------------------------- |
| URL                 | <https://apis.rmlconnect.net/whatsapp/report/v1/create_report/myaccounts_panel> |
| Authorization       | jwt                                                                             |
| Request Body schema | application/json                                                                |

**Request sample**

```json
{
  "csv_max_lines": 10000,
  "filters": {
    "end_date": "{end-date}",
    "start_date": "{start-date}"
  },
  "projections": [
    "country_code",
    "msisdn",
    "message_type",
    "message_payload",
    "request_id",
    "conversation_id",
    "message_id",
    "submit_timestamp",
    "sent_timestamp",
    "delivery_timestamp",
    "read_timestamp",
    "failed_timestamp",
    "deleted_timestamp",
    "extra",
    "pricing_model"
  ]
}
```

**Request body parameters**

| Parameter       | Required | Type                                                              | Description                                                                                                                 |
| --------------- | -------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| csv\_max\_lines | Yes      | number                                                            | An integer representing the maximum number of lines to include in the CSV file.                                             |
| filters         | Yes      | object (whatsappreportv1create\_reportmyaccounts\_panel\_filters) | A JSON object that contains the start and end dates for the report. The format of the dates should be in YYYY-MM-DD format. |
| projections     | Yes      | Array of strings                                                  | An array of fields that you want to include in the report.                                                                  |

### Create Report responses

<Accordion title="202 Accepted" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "status": "success",
  "id": 86
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the report. |
| id | integer | The unique identifier that represents the report. |

</Accordion>

<Accordion title="400 Bad Request" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "status": "failed",
  "errors": {
    "filters": {
      "start_date": [
        "Missing data for required field."
      ]
    }
  }
}
```

**Response Schema:** application/json

One of **create_report_400_invalid_start_date/create_report_400_invalid_end_date**

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the report. |
| errors | object | The error message details. |

</Accordion>

<Accordion title="401 Authentication Failure" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the product feed update request. |
| status | string | The status of the product feed update. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "failed",
  "errors": "Contact administration for more info"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the report. |
| errors | string | The error for not generating the report. |

</Accordion>

## Create Campaign Specific Report

Create a campaign-specific report for WhatsApp Business account. The projections field contains a comma-separated list of field names.

<Accordion title="Available projection fields" icon="fa-solid fa-list-check">

| Field | Description |
| ----- | ----------- |
| country_code | The country code of the recipient's phone number. |
| msisdn | The recipient's phone number. |
| message_type | The type of the message, such as text, image, and video. |
| message_payload | The content of the message. |
| request_id | The unique ID assigned to the message by the WhatsApp Business API. |
| conversation_id | The ID of the conversation thread. |
| message_id | The ID of the message. |
| submit_timestamp | The timestamp of when the message was submitted to the API. |
| sent_timestamp | The timestamp of when the message was sent to the recipient. |
| delivery_timestamp | The timestamp of when the message was delivered to the recipient. |
| read_timestamp | The timestamp of when the message was marked as read by the recipient. |
| failed_timestamp | The timestamp of when the message failed to be delivered. |
| deleted_timestamp | The timestamp of when the message was deleted. |
| extra | Additional information about the message. |
| pricing_model | The pricing model used for the message. |
| scheduled_time | The scheduled time of the message, if it was a scheduled message. |

</Accordion>

**Endpoint details**

| Field               | Value                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------- |
| URL                 | <https://apis.rmlconnect.net/whatsapp/report/v1/create_campaign_specific_report/myaccounts_panel> |
| Authorization       | jwt                                                                                               |
| Request Body schema | application/json                                                                                  |

**Request sample**

```json
{
  "csv_max_lines": 100000,
  "filters": {
    "campaign_id": "{campaign-id}",
    "campaign_name": "{campaign-name}",
    "end_date": "{end-date}",
    "start_date": "{start-date}"
  },
  "projections": [
    "country_code",
    "msisdn",
    "message_type",
    "message_payload",
    "request_id",
    "conversation_id",
    "message_id",
    "submit_timestamp",
    "sent_timestamp",
    "delivery_timestamp",
    "read_timestamp",
    "failed_timestamp",
    "deleted_timestamp",
    "extra",
    "pricing_model",
    "scheduled_time"
  ]
}
```

**Request body parameters**

| Parameter       | Required | Type                                                                                  | Description                                                                     |
| --------------- | -------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| csv\_max\_lines | Yes      | number                                                                                | An integer representing the maximum number of lines to include in the CSV file. |
| filters         | Yes      | object (whatsappreportv1create\_campaign\_specific\_reportmyaccounts\_panel\_filters) | An object containing the filters to apply to the report.                        |
| projections     | Yes      | Array of strings                                                                      | An array of strings representing the fields to include in the report.           |

### Create Campaign Specific Report responses

<Accordion title="202 Accepted" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "status": "success",
  "id": 186
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status for the campaign specific report. |
| id | integer | The unique identifier that represents the campaign specific report. |

</Accordion>

<Accordion title="400 Bad Request" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "status": "failed",
  "errors": {
    "filters": {
      "start_date": [
        "Missing data for required field."
      ]
    }
  }
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status for the campaign specific report. |
| errors | object | The object that represents the error messages. |

</Accordion>

<Accordion title="401 Authentication Failure" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the product feed update request. |
| status | string | The status of the product feed update. |

</Accordion>

<Accordion title="404 Page Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The message response. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "failed",
  "errors": "Contact administration for more info"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status for the campaign specific report. |
| errors | string | The error for not generating the report. |

</Accordion>

## Fetch Report URL

Fetch campaign data from the provided URL by entering the `report_id` parameter details.

**Endpoint details**

| Field         | Value                                                                                       |
| ------------- | ------------------------------------------------------------------------------------------- |
| URL           | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_specific_report/{report_id}> |
| Authorization | jwt                                                                                         |

**Path parameters**

| Parameter  | Required | Type   | Description              |
| ---------- | -------- | ------ | ------------------------ |
| report\_id | Yes      | string | Unique ID of the report. |

### Fetch Report URL responses

<Accordion title="202 Accepted" icon="fa-solid fa-clock">

**Response**

```json
{
  "message": "report is not yet generated"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |

</Accordion>

<Accordion title="400 Bad Request" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "report_url": "url"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| report_url | string | The URL of the report. |

</Accordion>

<Accordion title="401 Authentication Failure" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| status | string | The status of the report. |
| reason | string | The status for not generating the report. |

</Accordion>

<Accordion title="404 Page Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The message response. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Exception in Fetch Campaign Report",
  "reason": "reason"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the request or not generating the report. |

</Accordion>

## View Campaign Summary

View the campaign summary for the WhatsApp Business account. Ensure that you provide an authentication token in the request headers for the successful API call.

**Endpoint details**

| Field                 | Value                                                                   |
| --------------------- | ----------------------------------------------------------------------- |
| URL                   | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_details> |
| Authorization         | jwt                                                                     |
| API Key               | jwt                                                                     |
| Header parameter name | Authorization                                                           |

**Query parameters**

| Parameter    | Required | Type    | Description                                                                                                                                                                    |
| ------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| page\_number | Yes      | number  | The page number of the results to be fetched. Default is "1".                                                                                                                  |
| download     | Yes      | boolean | Example: download=true A boolean flag indicating whether to download the report or not. Default value is 'false'.                                                              |
| start-date   | Yes      | string  | The start date in "YYYY-MM-DD" order followed by the time in the "HH:MM:SS" format, that specifies the beginning of the date range for which to fetch campaign summary report. |
| end-date     | Yes      | string  | The end date in "YYYY-MM-DD" order followed by the time in the "HH:MM:SS" format, that specifies the end of the date range for which to fetch campaign summary report.         |

### View Campaign Summary responses

<Accordion title="200 Success" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "result": [
    {
      "campaign_id": "276f63e2-cb36-11ed-af9d-0242ac13xxxx",
      "campaign_name": "rmluxxx1-3",
      "campaign_status": "done",
      "campaign_type": "generalized",
      "delivered": 2,
      "failed": 1,
      "message_payload": {
        "country_code": "+91",
        "media": {
          "lang_code": "en",
          "template_name": "testing_16_03",
          "type": "media_template"
        },
        "phone": "704527xxxx"
      },
      "message_type": "media_template",
      "process_end_timestamp": "2023-03-25 17:55:02.815756",
      "process_start_timestamp": "2023-03-25 17:55:00.051162",
      "read": 1,
      "scheduled_time": "string",
      "sent": 3,
      "submit": 3,
      "user_name": "RMLxxx11"
    },
    {
      "campaign_id": "1fd39188-cb2e-11ed-9866-0242acxxxxx5",
      "campaign_name": "testuxxx1-2",
      "campaign_status": "done",
      "campaign_type": "generalized",
      "delivered": 2,
      "failed": 1,
      "message_payload": {
        "country_code": "+91",
        "media": {
          "lang_code": "en",
          "template_name": "testing_16_03",
          "type": "media_template"
        },
        "phone": "704527xxxx"
      },
      "message_type": "media_template",
      "process_end_timestamp": "2023-03-25 16:58:45.853958",
      "process_start_timestamp": "2023-03-25 16:58:43.181214",
      "read": 1,
      "scheduled_time": "string",
      "sent": 3,
      "submit": 3,
      "user_name": "RMLUxxxx"
    }
  ]
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| result | Array of objects (inline_response_200_5_result) | The campaign summary result. |

</Accordion>

<Accordion title="401 Authentication Failure" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Unable to process request",
  "status": "Failed",
  "reason": "Please check the integrity or validity of the token sent."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| status | string | The status of the view campaign summary. |
| reason | string | The reason for not generating the generating the view campaign summary. |

</Accordion>

<Accordion title="404 Page Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The message response. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "Exception in Fetch Campaign Manager",
  "reason": "'Request' object has no attribute 'username'"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the request or not generating the report. |

</Accordion>

## View Report Summary

View report summary for the WhatsApp Business account.

**Endpoint details**

| Field                 | Value                                                          |
| --------------------- | -------------------------------------------------------------- |
| URL                   | <https://apis.rmlconnect.net/whatsapp/report/v1/fetch_reports> |
| Authorization         | jwt                                                            |
| API Key               | jwt                                                            |
| Header parameter name | Authorization                                                  |

**Query parameters**

| Parameter    | Required | Type   | Description                                                                                                                                                    |
| ------------ | -------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start\_date  | Yes      | string | The start date in "YYYY-MM-DD" order followed by the time in the "HH:MM:SS" format, that specifies the beginning of the date range for which to fetch reports. |
| end\_date    | Yes      | string | The end date in "YYYY-MM-DD" order followed by the time in the "HH:MM:SS" format, that specifies the end of the date range for which to fetch reports.         |
| page\_number | No       | string | The page number of the paginated results to return. The default value is 1.                                                                                    |
| page\_size   | No       | string | The number of results to return per page. The default value is 5.                                                                                              |

### View Report Summary responses

<Accordion title="200 Success" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "result": [
    {
      "file_path": "fa15c156-8dba-11ed-bc2b-0242acxxxxx5.zip",
      "id": "107xxx",
      "msisdn": "string",
      "payload": {
        "csv_max_lines": 100000,
        "filters": {
          "end_date": "2023-01-06",
          "start_date": "2023-01-06"
        },
        "projections": [
          "country_code",
          "msisdn",
          "message_type",
          "message_payload",
          "request_id",
          "conversation_id",
          "message_id",
          "submit_timestamp",
          "sent_timestamp",
          "delivery_timestamp",
          "read_timestamp",
          "failed_timestamp",
          "deleted_timestamp",
          "extra",
          "pricing_model",
          "pricing_category",
          "expiration_timestamp"
        ],
        "request_source": "support_panel"
      },
      "status": "deleted",
      "timestamp": "Fri, 06 Jan 2023 12:09:31 GMT",
      "username": "dxxxxhatsapp"
    }
  ]
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| result | Array of objects | An array of objects representing the result or response of the operation. Array |
| file_path | string | The file path or name associated with the result. |
| id | integer | The identifier associated with the result. |
| msisdn | string or null | The mobile phone number associated with the result. |
| payload | object | Additional payload information related to the result. |
| status | string | The status of the result. |
| timestamp | string | The timestamp of the result. |
| username | string | The username associated with the result. |

</Accordion>

<Accordion title="401 Authentication Failure" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "Unauthorized"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the message. |

</Accordion>

<Accordion title="404 Page Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The message response. |

</Accordion>

## Optin Create Report

The Optin Create Report endpoint is used to report user opt-ins for receiving messages from a business.

**Endpoint details**

| Field                 | Value                                                           |
| --------------------- | --------------------------------------------------------------- |
| URL                   | <https://apis.rmlconnect.net/whatsapp/report/v1/optin-download> |
| Authorization         | jwt                                                             |
| API Key               | jwt                                                             |
| Header parameter name | Authorization                                                   |

**Query parameters**

| Parameter  | Required | Type            | Example               | Description                                                   |
| ---------- | -------- | --------------- | --------------------- | ------------------------------------------------------------- |
| from\_date | Yes      | string `<date>` | from\_date=2023-08-07 | The starting date of the user opt-ins for receiving messages. |
| to\_date   | Yes      | string `<date>` | to\_date=2023-08-07   | The end date of the user opt-ins for receiving messages.      |

### Optin Create Report responses

<Accordion title="200 Success" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "status": "success",
  "id": 5748
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the optin create report. |
| id | integer | The unique identifier that represents the report. |

</Accordion>

<Accordion title="401 Unauthorized" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "unable to process campaign request",
  "reason": "jwt token expired",
  "status": "failure"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not generating the optin create report. |
| status | string | The status of the report. |

</Accordion>

<Accordion title="404 Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "failure",
  "message": "unable to process request",
  "reason": "internal server error"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not generating the option create report. |
| status | string | The status of the report. |

</Accordion>

## Download Optin Report

The Download Optin Report endpoint is used to download the user opt-ins report for receiving messages from a business.

**Endpoint details**

| Field                 | Value                                                                          |
| --------------------- | ------------------------------------------------------------------------------ |
| URL                   | <https://apis.rmlconnect.net/whatsapp/report/v1/summary/download_optin_report> |
| Authorization         | jwt                                                                            |
| API Key               | jwt                                                                            |
| Header parameter name | Authorization                                                                  |

**Query parameters**

| Parameter  | Required | Type   | Example               | Description                                                   |
| ---------- | -------- | ------ | --------------------- | ------------------------------------------------------------- |
| from\_date | Yes      | string | from\_date=2023-08-07 | The starting date of the user opt-ins for receiving messages. |
| to\_date   | Yes      | string | to\_date=2023-08-07   | The end date of the user opt-ins for receiving messages.      |

### Download Optin Report responses

<Accordion title="200 Success" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "country_code": "91",
  "msisdn": "973905xxxx",
  "timestamp": "2022 - 09 - 06 10: 47: 01.198255",
  "channel": "whatsapp-api",
  "status": "optin",
  "extra": ""
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| country_code | string | The country code of the phone number. |
| msisdn | string | The phone number of the customer. |
| timestamp | string | The timestamp of the message. |
| channel | string | The channel through which the user opted in. |
| status | string | The status of the optin report download. |
| extra | string | Any additional information related to the optin process. |

</Accordion>

<Accordion title="401 Unauthorized" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "unable to process campaign request",
  "reason": "jwt token expired",
  "status": "failure"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the download optin report request. |
| status | string | The status of the optin report download. |

</Accordion>

<Accordion title="404 Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "failure",
  "message": "unable to process request",
  "reason": "internal server error"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| status | string | The status of the optin report download. |
| message | string | The response message. |
| reason | string | The reason for not processing the download optin report request. |

</Accordion>

## Template Wise Count

The Template Wise Count endpoint is used to count approved templates associated with a WhatsApp Business account.

**Endpoint details**

| Field                 | Value                                                           |
| --------------------- | --------------------------------------------------------------- |
| URL                   | <https://apis.rmlconnect.net/whatsapp/report/v1/template-count> |
| Authorization         | jwt                                                             |
| API Key               | jwt                                                             |
| Header parameter name | Authorization                                                   |

**Query parameters**

| Parameter   | Required | Type   | Description                                                   |
| ----------- | -------- | ------ | ------------------------------------------------------------- |
| start\_date | Yes      | string | The start date for the template count in "YYYY-MM-DD" format. |
| end\_date   | Yes      | string | The end date for the template count in "YYYY-MM-DD" format.   |

### Template Wise Count responses

<Accordion title="200 Success" icon="fa-solid fa-circle-check">

**Response**

```json
{
  "result": [
    {
      "template_count": 8,
      "template_name": "bilan"
    },
    {
      "template_count": 3,
      "template_name": "bmntest12"
    },
    {
      "template_count": 1,
      "template_name": "delhi_metro_english_quick_n"
    },
    {
      "template_count": 4,
      "template_name": "demo202"
    },
    {
      "template_count": 7,
      "template_name": "xyzz888"
    }
  ]
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| result | Array of objects | Array of template count objects. |
| template_count | integer | The template count number. |
| template_name | string | The template name. |

</Accordion>

<Accordion title="401 Unauthorized" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "message": "unable to process campaign request",
  "reason": "jwt token expired",
  "status": "failure"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |
| reason | string | The reason for not processing the template count request. |
| status | string | The status of the template count request. |

</Accordion>

<Accordion title="404 Not Found" icon="fa-solid fa-circle-exclamation">

**Response**

```json
{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The response message. |

</Accordion>

<Accordion title="500 Internal Server Error" icon="fa-solid fa-triangle-exclamation">

**Response**

```json
{
  "status": "failure",
  "message": "unable to process request",
  "reason": "internal server error"
}
```

**Response Schema:** application/json

| Field | Type | Description |
| ----- | ---- | ----------- |
| message | string | The message response. |
| reason | string | The reason for not processing the template count request. |
| status | string | The status of the template count request. |

</Accordion>

<br />