Chilkat Online Tools

SQL Server / Zoom API / Update Zoom Room location profile

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @req int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.HttpRequest', @req OUT

    EXEC sp_OASetProperty @req, 'HttpVerb', 'PATCH'
    EXEC sp_OASetProperty @req, 'Path', '/v2/rooms/locations/:locationId'
    EXEC sp_OASetProperty @req, 'ContentType', 'multipart/form-data'

    DECLARE @jsonFormData1 int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jsonFormData1 OUT

    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'name', 'nulla ex'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, '"description "', 'tempor aute esse'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'timezone', 'ullamco adipisicing'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'address', 'elit dolor laborum'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'support_email', 'rjaufhdQp@rmDcNdJjULbWbatHJEWThNonzYiPKxO.qq'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'support_phone', 'aliqua ut Excepteur ullamco'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateString', @success OUT, 'room_passcode', 'reprehende'
    EXEC sp_OAMethod @jsonFormData1, 'UpdateBool', @success OUT, 'required_code_to_ext', 0
    EXEC sp_OAMethod @jsonFormData1, 'Emit', @sTmp0 OUT
    EXEC sp_OAMethod @req, 'AddParam', NULL, 'basic', @sTmp0

    EXEC sp_OAMethod @req, 'AddHeader', NULL, 'Authorization', 'Bearer <access_token>'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'SynchronousRequest', @resp OUT, 'api.zoom.us', 443, 1, @req
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @req
        EXEC @hr = sp_OADestroy @jsonFormData1
        RETURN
      END

    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @resp

        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @req
        EXEC @hr = sp_OADestroy @jsonFormData1
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @resp


    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @req
    EXEC @hr = sp_OADestroy @jsonFormData1
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl -X PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'basic={"name":"nulla ex","description ":"tempor aute esse","timezone":"ullamco adipisicing","address":"elit dolor laborum","support_email":"rjaufhdQp@rmDcNdJjULbWbatHJEWThNonzYiPKxO.qq","support_phone":"aliqua ut Excepteur ullamco","room_passcode":"reprehende","required_code_to_ext":false}'
https://api.zoom.us/v2/rooms/locations/:locationId

Postman Collection Item JSON

{
  "name": "Update Zoom Room location profile",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "basic",
          "value": "{\"name\":\"nulla ex\",\"description \":\"tempor aute esse\",\"timezone\":\"ullamco adipisicing\",\"address\":\"elit dolor laborum\",\"support_email\":\"rjaufhdQp@rmDcNdJjULbWbatHJEWThNonzYiPKxO.qq\",\"support_phone\":\"aliqua ut Excepteur ullamco\",\"room_passcode\":\"reprehende\",\"required_code_to_ext\":false}",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/rooms/locations/:locationId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "rooms",
        "locations",
        ":locationId"
      ],
      "variable": [
        {
          "key": "locationId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) Unique Identifier of the location. This can be retrieved from the [List Zoom Room Locations](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) API."
        }
      ]
    },
    "description": "Each location type of the [Zoom Rooms location hierarchy](https://support.zoom.us/hc/en-us/articles/115000342983-Zoom-Rooms-Location-Hierarchy) has a profile page that includes information such as name of the location, address, support email, etc. Use this API to update information about a specific Zoom Rooms location type such as information about the city where the Zoom Rooms is located.\n\n**Prerequisite:**<br>\n* Account owner or admin permission\n* Zoom Rooms version 4.0 or higher<br>\n**Scopes:** `room:write:admin`<br> \n\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Medium`"
  },
  "response": [
    {
      "name": "Untitled Example",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "basic",
              "value": "{\"name\":\"nulla ex\",\"description \":\"tempor aute esse\",\"timezone\":\"ullamco adipisicing\",\"address\":\"elit dolor laborum\",\"support_email\":\"rjaufhdQp@rmDcNdJjULbWbatHJEWThNonzYiPKxO.qq\",\"support_phone\":\"aliqua ut Excepteur ullamco\",\"room_passcode\":\"reprehende\",\"required_code_to_ext\":false}",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/rooms/locations/:locationId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "rooms",
            "locations",
            ":locationId"
          ],
          "variable": [
            {
              "key": "locationId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) Unique Identifier of the location. This can be retrieved from the [List Zoom Room Locations](https://marketplace.zoom.us/docs/api-reference/zoom-api/rooms-location/listzrlocations) API."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{}"
    }
  ]
}