Chilkat Online Tools

PowerBuilder / Zoom API / Update a TSP account

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Req
oleobject loo_Resp
integer li_RespStatusCode

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

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Req = create oleobject
li_rc = loo_Req.ConnectToNewObject("Chilkat_9_5_0.HttpRequest")

loo_Req.HttpVerb = "PATCH"
loo_Req.Path = "/v2/users/:userId/tsp/:tspId"
loo_Req.ContentType = "multipart/form-data"
loo_Req.AddParam("conference_code","exercit")

loo_Req.AddParam("leader_pin","exercitculpa")

loo_Req.AddParam("dial_in_numbers","exercitculpa[{~"code~":~"minim~",~"number~":~"consequat ~",~"type~":~"toll~",~"country_label~":~"Ut ~"},{~"code~":~"ut i~",~"number~":~"mi~",~"type~":~"media_link~",~"country_label~":~"sed de~"}]")

loo_Req.AddParam("tsp_bridge","exercitculpa[{~"code~":~"minim~",~"number~":~"consequat ~",~"type~":~"toll~",~"country_label~":~"Ut ~"},{~"code~":~"ut i~",~"number~":~"mi~",~"type~":~"media_link~",~"country_label~":~"sed de~"}]EU_TSP_TB")

loo_Req.AddHeader("Authorization","Bearer <access_token>")

loo_Resp = loo_Http.SynchronousRequest("api.zoom.us",443,1,loo_Req)
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Req
    return
end if

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode <> 204 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Response Body:"
    Write-Debug loo_Resp.BodyStr
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    destroy loo_Req
    return
end if

destroy loo_Resp
Write-Debug "Success."


destroy loo_Http
destroy loo_Req

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'conference_code=exercit'
	--form 'leader_pin=exercitculpa'
	--form 'dial_in_numbers=exercitculpa[{"code":"minim","number":"consequat ","type":"toll","country_label":"Ut "},{"code":"ut i","number":"mi","type":"media_link","country_label":"sed de"}]'
	--form 'tsp_bridge=exercitculpa[{"code":"minim","number":"consequat ","type":"toll","country_label":"Ut "},{"code":"ut i","number":"mi","type":"media_link","country_label":"sed de"}]EU_TSP_TB'
https://api.zoom.us/v2/users/:userId/tsp/:tspId

Postman Collection Item JSON

{
  "name": "Update a TSP account",
  "request": {
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "conference_code",
          "value": "exercit",
          "description": "(Required) Conference code: numeric value, length is less than 16.",
          "type": "text"
        },
        {
          "key": "leader_pin",
          "value": "culpa",
          "description": "(Required) Leader PIN: numeric value, length is less than 16.",
          "type": "text"
        },
        {
          "key": "dial_in_numbers",
          "value": "[{\"code\":\"minim\",\"number\":\"consequat \",\"type\":\"toll\",\"country_label\":\"Ut \"},{\"code\":\"ut i\",\"number\":\"mi\",\"type\":\"media_link\",\"country_label\":\"sed de\"}]",
          "description": "List of dial in numbers.",
          "type": "text"
        },
        {
          "key": "tsp_bridge",
          "value": "EU_TSP_TB",
          "description": "Telephony bridge (This can only be one of US_TSP_TB,EU_TSP_TB)",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/users/:userId/tsp/:tspId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "users",
        ":userId",
        "tsp",
        ":tspId"
      ],
      "variable": [
        {
          "key": "userId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
        },
        {
          "key": "tspId",
          "value": "2",
          "description": "(Required) TSP account ID."
        }
      ]
    },
    "description": "Update a user's TSP account.<br><br>\n**Scopes:** `tsp:write:admin` `tsp:write`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:**`204` **No Content**<br>\nTSP account updated.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "conference_code",
              "value": "incididunt",
              "description": "(Required) Conference code: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "leader_pin",
              "value": "nostrud offi",
              "description": "(Required) Leader PIN: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "dial_in_numbers",
              "value": "[{\"code\":\"anim \",\"number\":\"Exc\",\"type\":\"media_link\",\"country_label\":\"non q\"},{\"code\":\"do \",\"number\":\"aliquip nis\",\"type\":\"toll\",\"country_label\":\"aute o\"}]",
              "description": "List of dial in numbers.",
              "type": "text"
            },
            {
              "key": "tsp_bridge",
              "value": "EU_TSP_TB",
              "description": "Telephony bridge (This can only be one of US_TSP_TB,EU_TSP_TB)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users/:userId/tsp/:tspId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "tsp",
            ":tspId"
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            },
            {
              "key": "tspId",
              "value": "2",
              "description": "(Required) TSP account ID."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400`<br>\nBad request.<br>\n**Error Code:**`2024`<br>\nAccount has not enabled TSP.<br>\n**Error Code:**`300`<br>\nThe TSP id provided does not exist.<br>\n**Error Code:**`300`<br>\nTSP Config does not exist.<br>\n**Error Code:**`300`<br>\nA",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "conference_code",
              "value": "incididunt",
              "description": "(Required) Conference code: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "leader_pin",
              "value": "nostrud offi",
              "description": "(Required) Leader PIN: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "dial_in_numbers",
              "value": "[{\"code\":\"anim \",\"number\":\"Exc\",\"type\":\"media_link\",\"country_label\":\"non q\"},{\"code\":\"do \",\"number\":\"aliquip nis\",\"type\":\"toll\",\"country_label\":\"aute o\"}]",
              "description": "List of dial in numbers.",
              "type": "text"
            },
            {
              "key": "tsp_bridge",
              "value": "EU_TSP_TB",
              "description": "Telephony bridge (This can only be one of US_TSP_TB,EU_TSP_TB)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users/:userId/tsp/:tspId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "tsp",
            ":tspId"
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            },
            {
              "key": "tspId",
              "value": "2",
              "description": "(Required) TSP account ID."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nNot Found.<br>\n**Error Code:** `1001`<br>\nUser does not exist: $userId.<br>\n**Error Code:**`1120`<br>\nA valid invitation to join the Zoom account was not found for this user.<br>\nThis error is thrown if you added a user in ",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "conference_code",
              "value": "incididunt",
              "description": "(Required) Conference code: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "leader_pin",
              "value": "nostrud offi",
              "description": "(Required) Leader PIN: numeric value, length is less than 16.",
              "type": "text"
            },
            {
              "key": "dial_in_numbers",
              "value": "[{\"code\":\"anim \",\"number\":\"Exc\",\"type\":\"media_link\",\"country_label\":\"non q\"},{\"code\":\"do \",\"number\":\"aliquip nis\",\"type\":\"toll\",\"country_label\":\"aute o\"}]",
              "description": "List of dial in numbers.",
              "type": "text"
            },
            {
              "key": "tsp_bridge",
              "value": "EU_TSP_TB",
              "description": "Telephony bridge (This can only be one of US_TSP_TB,EU_TSP_TB)",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/users/:userId/tsp/:tspId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "users",
            ":userId",
            "tsp",
            ":tspId"
          ],
          "variable": [
            {
              "key": "userId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The user ID or email address of the user. For user-level apps, pass the `me` value for this parameter."
            },
            {
              "key": "tspId",
              "value": "2",
              "description": "(Required) TSP account ID."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}