Chilkat Online Tools

Android / Zoom API / Get telephone reports

Back to Collection Items

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http = new CkHttp();
    boolean success;

    CkJsonObject queryParams = new CkJsonObject();
    queryParams.UpdateInt("type",1);
    queryParams.UpdateString("query_date_type","start_time");
    queryParams.UpdateString("from","1989-05-07");
    queryParams.UpdateString("to","1989-05-07");
    queryParams.UpdateInt("page_size",30);
    queryParams.UpdateInt("page_number",1);
    queryParams.UpdateString("next_page_token","quis officia in reprehenderit");

    // Adds the "Authorization: Bearer <access_token>" header.
    http.put_AuthToken("<access_token>");

    CkHttpResponse resp = http.QuickRequestParams("GET","https://api.zoom.us/v2/report/telephone",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        Log.i(TAG, http.lastErrorText());
        return;
        }

    CkStringBuilder sbResponseBody = new CkStringBuilder();
    resp.GetBodySb(sbResponseBody);

    CkJsonObject jResp = new CkJsonObject();
    jResp.LoadSb(sbResponseBody);
    jResp.put_EmitCompact(false);

    Log.i(TAG, "Response Body:");
    Log.i(TAG, jResp.emit());

    int respStatusCode = resp.get_StatusCode();
    Log.i(TAG, "Response Status Code = " + String.valueOf(respStatusCode));
    if (respStatusCode >= 400) {
        Log.i(TAG, "Response Header:");
        Log.i(TAG, resp.header());
        Log.i(TAG, "Failed.");

        return;
        }


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

Curl Command

curl -G -d "type=1"
	-d "query_date_type=start_time"
	-d "from=1989-05-07"
	-d "to=1989-05-07"
	-d "page_size=30"
	-d "page_number=1"
	-d "next_page_token=quis%20officia%20in%20reprehenderit"
	-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/report/telephone

Postman Collection Item JSON

{
  "name": "Get telephone reports",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/report/telephone?type=1&query_date_type=start_time&from=1989-05-07&to=1989-05-07&page_size=30&page_number=1&next_page_token=quis officia in reprehenderit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "report",
        "telephone"
      ],
      "query": [
        {
          "key": "type",
          "value": "1",
          "description": "Audio types:<br>`1` - Toll-free Call-in & Call-out.<br>`2` - Toll <br>\n`3` - SIP Connected Audio"
        },
        {
          "key": "query_date_type",
          "value": "start_time",
          "description": "The type of date to query: \n* `start_time` — Query by call start time. \n* `end_time` — Query by call end time. \n* `meeting_start_time` — Query by meeting start time. \n* `meeting_end_time` — Query by meeting end time. \n\nThis value defaults to `start_time`."
        },
        {
          "key": "from",
          "value": "1989-05-07",
          "description": "(Required) Start date in 'yyyy-mm-dd' format. The date range defined by the \"from\" and \"to\" parameters should only be one month as the report includes only one month worth of data at once."
        },
        {
          "key": "to",
          "value": "1989-05-07",
          "description": "(Required) End date."
        },
        {
          "key": "page_size",
          "value": "30",
          "description": "The number of records returned within a single API call."
        },
        {
          "key": "page_number",
          "value": "1",
          "description": "The page number of the current page in the returned records. This field is **not** available if the `query_date_type` parameter is the `meeting_start_time` or `meeting_end_time` value. \n\n**DEPRECATED** — This field is deprecated and we will no longer support it in a future release. Instead, use the `next_page_token` query parameter for pagination."
        },
        {
          "key": "next_page_token",
          "value": "quis officia in reprehenderit",
          "description": "The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes."
        }
      ]
    },
    "description": "The [telephone report](https://support.zoom.us/hc/en-us/articles/206514816-Telephone-reports) allows you to view who dialed into meetings via phone (Audio Conferencing or SIP Connected Audio) and which number they dialed into and other details. Use this API to get telephone report for a specified period of time.\n\n**Scopes:** `report:read:admin`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>**Prerequisites:**<br>\n* Pro or higher plan."
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `200`<br>\nTelephone report returned.<br>\nThis is only available for paid account:{accountId}.<br>\nThe requested report cannot be generated for this account because this account has not subscribed to toll-free audio conference plan.<b",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/report/telephone?type=1&query_date_type=start_time&from=1989-05-07&to=1989-05-07&page_size=30&page_number=1&next_page_token=quis officia in reprehenderit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "report",
            "telephone"
          ],
          "query": [
            {
              "key": "type",
              "value": "1"
            },
            {
              "key": "query_date_type",
              "value": "start_time"
            },
            {
              "key": "from",
              "value": "1989-05-07"
            },
            {
              "key": "to",
              "value": "1989-05-07"
            },
            {
              "key": "page_size",
              "value": "30"
            },
            {
              "key": "page_number",
              "value": "1"
            },
            {
              "key": "next_page_token",
              "value": "quis officia in reprehenderit"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "\"{\\n  \\\"from\\\": \\\"2019-06-20\\\",\\n  \\\"to\\\": \\\"2019-07-20\\\",\\n  \\\"page_count\\\": 1,\\n  \\\"page_number\\\": 1,\\n  \\\"page_size\\\": 30,\\n  \\\"total_records\\\": 1,\\n  \\\"telephony_usage\\\": [\\n    {\\n      \\\"meeting_id\\\": 00000,\\n      \\\"phone_number\\\": \\\"000002001\\\",\\n      \\\"host_name\\\": \\\"John Dev\\\",\\n      \\\"host_email\\\": \\\"example@example.com\\\",\\n      \\\"dept\\\": \\\"Billing\\\",\\n      \\\"start_time\\\": \\\"2019-07-15T23:24:52Z\\\",\\n      \\\"end_time\\\": \\\"2019-07-15T23:30:19Z\\\",\\n      \\\"duration\\\": 6,\\n      \\\"total\\\": 11,\\n      \\\"country_name\\\": \\\"Macau SAR\\\",\\n      \\\"meeting_type\\\": \\\"Meeting\\\",\\n      \\\"call_in_number\\\": \\\"+85123456789\\\"\\n    }\\n  ]\\n}\""
    }
  ]
}