Get report status

This code snippet shows you how to obtain the status of a report. It is often used to determine whether a report generation has successfully completed or not.


Variable Required Description
VONAGE_API_KEY Yes Your API key which you can obtain from your Dashboard.
VONAGE_API_SECRET Yes Your API secret which you can obtain from your Dashboard.
REQUEST_ID Yes The request ID of the report to check the status of.

Write the code

Add the following to

Copy to Clipboard

View full source

Run your code

Save this file to your machine and run it:


Try it out

  1. Set the replaceable variables. Parameter validity may vary with product.

  2. Run the script and you receive a response similar to the following:

Copy to Clipboard
  "self_link": "",
  "items_count": 17,
  "reports": [
      "request_id": "ri3p58f-48598ea7-1234-5678-90ab-faabd79abcde",
      "request_status": "SUCCESS",
      "direction": "outbound",
      "product": "SMS",
      "account_id": "abcd1234",
      "date_start": "2020-05-21T13:27:00+0000",
      "date_end": "2020-05-21T13:57:00+0000",
      "include_subaccounts": false,
      "status": "delivered",
      "include_message": false,
      "receive_time": "2020-06-03T15:24:31+0000",
      "start_time": "2020-06-03T15:24:32+0000",
      "_links": {
        "self": {
          "href": ""
        "download_report": {
          "href": ""
      "items_count": 4

The file_id is also returned in the response, in this case e87a2d7c-abcd-1234-aa45-9bf17a1eb2a1. The file_id is used to subsequently download a report Zip file.

See also