PowerBuilder / Zoom API / Get account's TSP information
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Code
string ls_V_number
string ls_V_type
string ls_Tsp_provider
integer li_Enable
integer li_Tsp_enabled
integer li_Master_account_setting_extended
integer li_Modify_credential_forbidden
integer li_Dial_in_number_unrestricted
string ls_Tsp_bridge
integer i
integer li_Count_i
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
li_Success = loo_Http.QuickGetSb("https://api.zoom.us/v2/tsp",loo_SbResponseBody)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_SbResponseBody
return
end if
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Http.LastStatus
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Http.LastHeader
Write-Debug "Failed."
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "tsp_provider": "someprovidername",
// "enable": true,
// "dial_in_numbers": [
// {
// "code": "111",
// "number": "000000000",
// "type": "toll"
// }
// ],
// "tsp_enabled": true,
// "master_account_setting_extended": false,
// "modify_credential_forbidden": true,
// "dial_in_number_unrestricted": false,
// "tsp_bridge": "string"
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
ls_Tsp_provider = loo_JResp.StringOf("tsp_provider")
li_Enable = loo_JResp.BoolOf("enable")
li_Tsp_enabled = loo_JResp.BoolOf("tsp_enabled")
li_Master_account_setting_extended = loo_JResp.BoolOf("master_account_setting_extended")
li_Modify_credential_forbidden = loo_JResp.BoolOf("modify_credential_forbidden")
li_Dial_in_number_unrestricted = loo_JResp.BoolOf("dial_in_number_unrestricted")
ls_Tsp_bridge = loo_JResp.StringOf("tsp_bridge")
i = 0
li_Count_i = loo_JResp.SizeOfArray("dial_in_numbers")
do while i < li_Count_i
loo_JResp.I = i
ls_Code = loo_JResp.StringOf("dial_in_numbers[i].code")
ls_V_number = loo_JResp.StringOf("dial_in_numbers[i].number")
ls_V_type = loo_JResp.StringOf("dial_in_numbers[i].type")
i = i + 1
loop
destroy loo_Http
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
https://api.zoom.us/v2/tsp
Postman Collection Item JSON
{
"name": "Get account's TSP information",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/tsp",
"host": [
"{{baseUrl}}"
],
"path": [
"tsp"
]
},
"description": "Get information on Telephony Service Provider on an account level.<br><br>\n**Scopes:** `tsp:read:admin` <br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`\n\n**Prerequisites:**<br>\n* A Pro or a higher plan."
},
"response": [
{
"name": "**HTTP Status Code:** `200`<br>\nTSP account detail returned successfully.",
"originalRequest": {
"method": "GET",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"url": {
"raw": "{{baseUrl}}/tsp",
"host": [
"{{baseUrl}}"
],
"path": [
"tsp"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"tsp_provider\": \"someprovidername\",\n \"enable\": true,\n \"dial_in_numbers\": [\n {\n \"code\": \"111\",\n \"number\": \"000000000\",\n \"type\": \"toll\"\n }\n ],\n \"tsp_enabled\": true,\n \"master_account_setting_extended\": false,\n \"modify_credential_forbidden\": true,\n \"dial_in_number_unrestricted\": false,\n \"tsp_bridge\": \"string\"\n}"
}
]
}