Chilkat Online Tools

DataFlex / Zoom API / Get telephone reports

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateInt Of hoQueryParams "type" 1 To iSuccess
    Get ComUpdateString Of hoQueryParams "query_date_type" "start_time" To iSuccess
    Get ComUpdateString Of hoQueryParams "from" "1989-05-07" To iSuccess
    Get ComUpdateString Of hoQueryParams "to" "1989-05-07" To iSuccess
    Get ComUpdateInt Of hoQueryParams "page_size" 30 To iSuccess
    Get ComUpdateInt Of hoQueryParams "page_number" 1 To iSuccess
    Get ComUpdateString Of hoQueryParams "next_page_token" "quis officia in reprehenderit" To iSuccess

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "https://api.zoom.us/v2/report/telephone" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
    If (Not(IsComObjectCreated(hoJResp))) Begin
        Send CreateComObject of hoJResp
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
    Set ComEmitCompact Of hoJResp To False

    Showln "Response Body:"
    Get ComEmit Of hoJResp To sTemp1
    Showln sTemp1

    Get ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp


End_Procedure

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}\""
    }
  ]
}