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

Create Report

Create reports for your WhatsApp Business account.

Create Campaign Specific Report

Create a campaign-specific report for a WhatsApp Business account.

Fetch Report URL

Fetch campaign data by using the report ID.

View Campaign Summary

View campaign summary details for a WhatsApp Business account.

View Report Summary

View report summary details for generated WhatsApp reports.

Optin Create Report

Create a report for user opt-ins.

Download Optin Report

Download the user opt-ins report.

Template Wise Count

Count approved templates associated with a WhatsApp Business account.

Endpoint summary

APIPurposeURL
Create ReportCreate reports for your WhatsApp Business account.https://apis.rmlconnect.net/whatsapp/report/v1/create_report/myaccounts_panel
Create Campaign Specific ReportCreate a campaign-specific report for WhatsApp Business account.https://apis.rmlconnect.net/whatsapp/report/v1/create_campaign_specific_report/myaccounts_panel
Fetch Report URLFetch campaign data by entering the report_id parameter details.https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_specific_report/{report_id}
View Campaign SummaryView the campaign summary for the WhatsApp Business account.https://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_details
View Report SummaryView report summary for the WhatsApp Business account.https://apis.rmlconnect.net/whatsapp/report/v1/fetch_reports
Optin Create ReportReport user opt-ins for receiving messages from a business.https://apis.rmlconnect.net/whatsapp/report/v1/optin-download
Download Optin ReportDownload the user opt-ins report for receiving messages from a business.https://apis.rmlconnect.net/whatsapp/report/v1/summary/download_optin_report
Template Wise CountCount 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.

Available projection fields
FieldDescription
country_codeThe country code of the phone number.
msisdnThe phone number of the customer.
message_typeThe type of the message, such as text, image, video, and document.
message_payloadThe content of the message.
request_idThe request ID of the message.
conversation_idThe conversation ID of the message.
message_idThe message ID of the message.
submit_timestampThe timestamp when the message was submitted.
sent_timestampThe timestamp when the message was sent.
delivery_timestampThe timestamp when the message was delivered.
read_timestampThe timestamp when the message was read.
failed_timestampThe timestamp when the message failed to be delivered.
deleted_timestampThe timestamp when the message was deleted.
extraAny additional metadata associated with the message.
pricing_modelThe pricing model for the message.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/create_report/myaccounts_panel
Authorizationjwt
Request Body schemaapplication/json

Request sample

{
  "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

ParameterRequiredTypeDescription
csv_max_linesYesnumberAn integer representing the maximum number of lines to include in the CSV file.
filtersYesobject (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.
projectionsYesArray of stringsAn array of fields that you want to include in the report.

Create Report responses

202 Accepted

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the report.
idintegerThe unique identifier that represents the report.
400 Bad Request

Response

{
  "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

FieldTypeDescription
statusstringThe status of the report.
errorsobjectThe error message details.
401 Authentication Failure

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the report.
errorsstringThe error for not generating the report.

Create Campaign Specific Report

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

Available projection fields
FieldDescription
country_codeThe country code of the recipient's phone number.
msisdnThe recipient's phone number.
message_typeThe type of the message, such as text, image, and video.
message_payloadThe content of the message.
request_idThe unique ID assigned to the message by the WhatsApp Business API.
conversation_idThe ID of the conversation thread.
message_idThe ID of the message.
submit_timestampThe timestamp of when the message was submitted to the API.
sent_timestampThe timestamp of when the message was sent to the recipient.
delivery_timestampThe timestamp of when the message was delivered to the recipient.
read_timestampThe timestamp of when the message was marked as read by the recipient.
failed_timestampThe timestamp of when the message failed to be delivered.
deleted_timestampThe timestamp of when the message was deleted.
extraAdditional information about the message.
pricing_modelThe pricing model used for the message.
scheduled_timeThe scheduled time of the message, if it was a scheduled message.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/create_campaign_specific_report/myaccounts_panel
Authorizationjwt
Request Body schemaapplication/json

Request sample

{
  "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

ParameterRequiredTypeDescription
csv_max_linesYesnumberAn integer representing the maximum number of lines to include in the CSV file.
filtersYesobject (whatsappreportv1create_campaign_specific_reportmyaccounts_panel_filters)An object containing the filters to apply to the report.
projectionsYesArray of stringsAn array of strings representing the fields to include in the report.

Create Campaign Specific Report responses

202 Accepted

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status for the campaign specific report.
idintegerThe unique identifier that represents the campaign specific report.
400 Bad Request

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status for the campaign specific report.
errorsobjectThe object that represents the error messages.
401 Authentication Failure

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
404 Page Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe message response.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status for the campaign specific report.
errorsstringThe error for not generating the report.

Fetch Report URL

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

Endpoint details

Path parameters

ParameterRequiredTypeDescription
report_idYesstringUnique ID of the report.

Fetch Report URL responses

202 Accepted

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
400 Bad Request

Response

{
  "report_url": "url"
}

Response Schema: application/json

FieldTypeDescription
report_urlstringThe URL of the report.
401 Authentication Failure

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
statusstringThe status of the report.
reasonstringThe status for not generating the report.
404 Page Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe message response.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the request or not generating the report.

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

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/fetch_campaign_details
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeDescription
page_numberYesnumberThe page number of the results to be fetched. Default is "1".
downloadYesbooleanExample: download=true A boolean flag indicating whether to download the report or not. Default value is 'false'.
start-dateYesstringThe 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-dateYesstringThe 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

200 Success

Response

{
  "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

FieldTypeDescription
resultArray of objects (inline_response_200_5_result)The campaign summary result.
401 Authentication Failure

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
statusstringThe status of the view campaign summary.
reasonstringThe reason for not generating the generating the view campaign summary.
404 Page Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe message response.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the request or not generating the report.

View Report Summary

View report summary for the WhatsApp Business account.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/fetch_reports
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeDescription
start_dateYesstringThe 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_dateYesstringThe 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_numberNostringThe page number of the paginated results to return. The default value is 1.
page_sizeNostringThe number of results to return per page. The default value is 5.

View Report Summary responses

200 Success

Response

{
  "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

FieldTypeDescription
resultArray of objectsAn array of objects representing the result or response of the operation. Array
file_pathstringThe file path or name associated with the result.
idintegerThe identifier associated with the result.
msisdnstring or nullThe mobile phone number associated with the result.
payloadobjectAdditional payload information related to the result.
statusstringThe status of the result.
timestampstringThe timestamp of the result.
usernamestringThe username associated with the result.
401 Authentication Failure

Response

{
  "status": "Unauthorized"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message.
404 Page Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe message response.

Optin Create Report

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

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/optin-download
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeExampleDescription
from_dateYesstring <date>from_date=2023-08-07The starting date of the user opt-ins for receiving messages.
to_dateYesstring <date>to_date=2023-08-07The end date of the user opt-ins for receiving messages.

Optin Create Report responses

200 Success

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the optin create report.
idintegerThe unique identifier that represents the report.
401 Unauthorized

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not generating the optin create report.
statusstringThe status of the report.
404 Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe response message.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not generating the option create report.
statusstringThe status of the report.

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

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/summary/download_optin_report
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeExampleDescription
from_dateYesstringfrom_date=2023-08-07The starting date of the user opt-ins for receiving messages.
to_dateYesstringto_date=2023-08-07The end date of the user opt-ins for receiving messages.

Download Optin Report responses

200 Success

Response

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

Response Schema: application/json

FieldTypeDescription
country_codestringThe country code of the phone number.
msisdnstringThe phone number of the customer.
timestampstringThe timestamp of the message.
channelstringThe channel through which the user opted in.
statusstringThe status of the optin report download.
extrastringAny additional information related to the optin process.
401 Unauthorized

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the download optin report request.
statusstringThe status of the optin report download.
404 Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe response message.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the optin report download.
messagestringThe response message.
reasonstringThe reason for not processing the download optin report request.

Template Wise Count

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

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/whatsapp/report/v1/template-count
Authorizationjwt
API Keyjwt
Header parameter nameAuthorization

Query parameters

ParameterRequiredTypeDescription
start_dateYesstringThe start date for the template count in "YYYY-MM-DD" format.
end_dateYesstringThe end date for the template count in "YYYY-MM-DD" format.

Template Wise Count responses

200 Success

Response

{
  "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

FieldTypeDescription
resultArray of objectsArray of template count objects.
template_countintegerThe template count number.
template_namestringThe template name.
401 Unauthorized

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the template count request.
statusstringThe status of the template count request.
404 Not Found

Response

{
  "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

FieldTypeDescription
messagestringThe response message.
500 Internal Server Error

Response

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

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
reasonstringThe reason for not processing the template count request.
statusstringThe status of the template count request.


Did this page help you?