Chilkat Online Tools

Android / Zoom API / Update Zoom Room location profile

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;

    CkHttpRequest req = new CkHttpRequest();
    req.put_HttpVerb("PATCH");
    req.put_Path("/v2/rooms/locations/:locationId");
    req.put_ContentType("multipart/form-data");

    CkJsonObject jsonFormData1 = new CkJsonObject();
    jsonFormData1.UpdateString("name","nulla ex");
    jsonFormData1.UpdateString("\"description \"","tempor aute esse");
    jsonFormData1.UpdateString("timezone","ullamco adipisicing");
    jsonFormData1.UpdateString("address","elit dolor laborum");
    jsonFormData1.UpdateString("support_email","rjaufhdQp@rmDcNdJjULbWbatHJEWThNonzYiPKxO.qq");
    jsonFormData1.UpdateString("support_phone","aliqua ut Excepteur ullamco");
    jsonFormData1.UpdateString("room_passcode","reprehende");
    jsonFormData1.UpdateBool("required_code_to_ext",false);
    req.AddParam("basic",jsonFormData1.emit());

    req.AddHeader("Authorization","Bearer <access_token>");

    CkHttpResponse resp = http.SynchronousRequest("api.zoom.us",443,true,req);
    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 -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": "{}"
    }
  ]
}