Chilkat Online Tools

Android / Zoom API / Update a webinar poll

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("PUT");
    req.put_Path("/v2/webinars/:webinarId/polls/:pollId");
    req.put_ContentType("multipart/form-data");
    req.AddParam("title","a");

    req.AddParam("poll_type","a3");

    req.AddParam("anonymous","a3false");

    req.AddParam("questions","a3false[{\"name\":\"ad in ullamco elit\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"in \",\"do sint ipsum\"],\"right_answers\":[\"deserunt id\"],\"prompts\":[{\"prompt_question\":\"sint ipsum irure\",\"prompt_right_answers\":[\"sit officia\",\"irure est nostrud nul\"]},{\"prompt_question\":\"qui\",\"prompt_right_answers\":[\"veniam\",\"voluptate reprehenderit irure\"]}],\"answer_min_character\":29173071,\"answer_max_character\":27567154,\"case_sensitive\":false,\"rating_min_value\":58887175,\"rating_max_value\":-45787201,\"rating_min_label\":\"ea commodo\",\"rating_max_label\":\"ipsum dolore\"},{\"name\":\"ut eiusmod adipisicing exercitation\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"Excepteur Ut\",\"exercitation voluptate\"],\"right_answers\":[\"occaecat do esse\"],\"prompts\":[{\"prompt_question\":\"laboris eiusmod commodo ipsum ut\",\"prompt_right_answers\":[\"ut Lorem dolor do\",\"ullamco cillum tempor pariatur\"]},{\"prompt_question\":\"officia l\",\"prompt_right_answers\":[\"nulla pariatur\",\"voluptate aliqua sint\"]}],\"answer_min_character\":68878731,\"answer_max_character\":-60270992,\"case_sensitive\":false,\"rating_min_value\":61727066,\"rating_max_value\":-36610809,\"rating_min_label\":\"in ut\",\"rating_max_label\":\"proident officia\"}]");

    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;
        }

    int respStatusCode = resp.get_StatusCode();
    Log.i(TAG, "Response Status Code = " + String.valueOf(respStatusCode));
    if (respStatusCode != 204) {
        Log.i(TAG, "Response Header:");
        Log.i(TAG, resp.header());
        Log.i(TAG, "Response Body:");
        Log.i(TAG, resp.bodyStr());
        Log.i(TAG, "Failed.");

        return;
        }

    Log.i(TAG, "Success.");

  }

  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 PUT
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'title=a'
	--form 'poll_type=a3'
	--form 'anonymous=a3false'
	--form 'questions=a3false[{"name":"ad in ullamco elit","type":"rating_scale","show_as_dropdown":false,"answer_required":false,"answers":["in ","do sint ipsum"],"right_answers":["deserunt id"],"prompts":[{"prompt_question":"sint ipsum irure","prompt_right_answers":["sit officia","irure est nostrud nul"]},{"prompt_question":"qui","prompt_right_answers":["veniam","voluptate reprehenderit irure"]}],"answer_min_character":29173071,"answer_max_character":27567154,"case_sensitive":false,"rating_min_value":58887175,"rating_max_value":-45787201,"rating_min_label":"ea commodo","rating_max_label":"ipsum dolore"},{"name":"ut eiusmod adipisicing exercitation","type":"single","show_as_dropdown":false,"answer_required":false,"answers":["Excepteur Ut","exercitation voluptate"],"right_answers":["occaecat do esse"],"prompts":[{"prompt_question":"laboris eiusmod commodo ipsum ut","prompt_right_answers":["ut Lorem dolor do","ullamco cillum tempor pariatur"]},{"prompt_question":"officia l","prompt_right_answers":["nulla pariatur","voluptate aliqua sint"]}],"answer_min_character":68878731,"answer_max_character":-60270992,"case_sensitive":false,"rating_min_value":61727066,"rating_max_value":-36610809,"rating_min_label":"in ut","rating_max_label":"proident officia"}]'
https://api.zoom.us/v2/webinars/:webinarId/polls/:pollId

Postman Collection Item JSON

{
  "name": "Update a webinar poll",
  "request": {
    "auth": {
      "type": "oauth2"
    },
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "title",
          "value": "a",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "poll_type",
          "value": "3",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "anonymous",
          "value": "false",
          "description": "undefined",
          "type": "text"
        },
        {
          "key": "questions",
          "value": "[{\"name\":\"ad in ullamco elit\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"in \",\"do sint ipsum\"],\"right_answers\":[\"deserunt id\"],\"prompts\":[{\"prompt_question\":\"sint ipsum irure\",\"prompt_right_answers\":[\"sit officia\",\"irure est nostrud nul\"]},{\"prompt_question\":\"qui\",\"prompt_right_answers\":[\"veniam\",\"voluptate reprehenderit irure\"]}],\"answer_min_character\":29173071,\"answer_max_character\":27567154,\"case_sensitive\":false,\"rating_min_value\":58887175,\"rating_max_value\":-45787201,\"rating_min_label\":\"ea commodo\",\"rating_max_label\":\"ipsum dolore\"},{\"name\":\"ut eiusmod adipisicing exercitation\",\"type\":\"single\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"Excepteur Ut\",\"exercitation voluptate\"],\"right_answers\":[\"occaecat do esse\"],\"prompts\":[{\"prompt_question\":\"laboris eiusmod commodo ipsum ut\",\"prompt_right_answers\":[\"ut Lorem dolor do\",\"ullamco cillum tempor pariatur\"]},{\"prompt_question\":\"officia l\",\"prompt_right_answers\":[\"nulla pariatur\",\"voluptate aliqua sint\"]}],\"answer_min_character\":68878731,\"answer_max_character\":-60270992,\"case_sensitive\":false,\"rating_min_value\":61727066,\"rating_max_value\":-36610809,\"rating_min_label\":\"in ut\",\"rating_max_label\":\"proident officia\"}]",
          "description": "undefined",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/webinars/:webinarId/polls/:pollId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "webinars",
        ":webinarId",
        "polls",
        ":pollId"
      ],
      "variable": [
        {
          "key": "webinarId",
          "value": "68423085",
          "description": "(Required) The webinar's ID."
        },
        {
          "key": "pollId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The poll ID"
        }
      ]
    },
    "description": "Update a webinar's [poll](https://support.zoom.us/hc/en-us/articles/203749865-Polling-for-Webinars).<br><br>\n**Scopes:** `webinar:write:admin` `webinar:write`<br>\n \n **[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Light`<br>\n\n"
  },
  "response": [
    {
      "name": "**HTTP Status Code:** `204`<br>\nWebinar Poll Updated",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "title",
              "value": "fugiat exercitation proident magna ullamco",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "poll_type",
              "value": "1",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "anonymous",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "questions",
              "value": "[{\"name\":\"irure ex velit consectetur\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo in in ad\",\"do officia dolore eu\"],\"right_answers\":[\"laborum officia\"],\"prompts\":[{\"prompt_question\":\"minim in mollit\",\"prompt_right_answers\":[\"in cillum amet\",\"cupida\"]},{\"prompt_question\":\"eiusmod culpa\",\"prompt_right_answers\":[\"irure fugiat\",\"eiusmod et occaecat magna sed\"]}],\"answer_min_character\":93145901,\"answer_max_character\":91006906,\"case_sensitive\":false,\"rating_min_value\":37530130,\"rating_max_value\":-38740448,\"rating_min_label\":\"quis non proident Duis\",\"rating_max_label\":\"irure pariatur nisi\"},{\"name\":\"labore cillum\",\"type\":\"rank_order\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"in aliqua cillum\",\"irure fugiat qui et\"],\"right_answers\":[\"dolor in u\"],\"prompts\":[{\"prompt_question\":\"occaecat reprehenderit\",\"prompt_right_answers\":[\"reprehenderit deserunt\",\"c\"]},{\"prompt_question\":\"occaecat velit\",\"prompt_right_answers\":[\"ut mollit eu ipsum\",\"qui et tempor aute\"]}],\"answer_min_character\":72197843,\"answer_max_character\":-2000739,\"case_sensitive\":false,\"rating_min_value\":25766114,\"rating_max_value\":-12152537,\"rating_min_label\":\"adipisicing mollit in et\",\"rating_max_label\":\"Lorem magna non id\"}]",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/polls/:pollId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "polls",
            ":pollId"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            },
            {
              "key": "pollId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The poll ID"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400` **Bad Request** <br>\n **Error Code:** `4400` <br>\n* Webinar polls disabled. To enable this feature, enable the \"Webinar Polls/Quizzes\" setting in the Zoom web portal's \"Settings\" interface. \n* Advanced webinar polls disabled. T",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "title",
              "value": "fugiat exercitation proident magna ullamco",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "poll_type",
              "value": "1",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "anonymous",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "questions",
              "value": "[{\"name\":\"irure ex velit consectetur\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo in in ad\",\"do officia dolore eu\"],\"right_answers\":[\"laborum officia\"],\"prompts\":[{\"prompt_question\":\"minim in mollit\",\"prompt_right_answers\":[\"in cillum amet\",\"cupida\"]},{\"prompt_question\":\"eiusmod culpa\",\"prompt_right_answers\":[\"irure fugiat\",\"eiusmod et occaecat magna sed\"]}],\"answer_min_character\":93145901,\"answer_max_character\":91006906,\"case_sensitive\":false,\"rating_min_value\":37530130,\"rating_max_value\":-38740448,\"rating_min_label\":\"quis non proident Duis\",\"rating_max_label\":\"irure pariatur nisi\"},{\"name\":\"labore cillum\",\"type\":\"rank_order\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"in aliqua cillum\",\"irure fugiat qui et\"],\"right_answers\":[\"dolor in u\"],\"prompts\":[{\"prompt_question\":\"occaecat reprehenderit\",\"prompt_right_answers\":[\"reprehenderit deserunt\",\"c\"]},{\"prompt_question\":\"occaecat velit\",\"prompt_right_answers\":[\"ut mollit eu ipsum\",\"qui et tempor aute\"]}],\"answer_min_character\":72197843,\"answer_max_character\":-2000739,\"case_sensitive\":false,\"rating_min_value\":25766114,\"rating_max_value\":-12152537,\"rating_min_label\":\"adipisicing mollit in et\",\"rating_max_label\":\"Lorem magna non id\"}]",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/polls/:pollId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "polls",
            ":pollId"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            },
            {
              "key": "pollId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The poll ID"
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\nWebinar poll not found.<br>\n**Error Code:** `3001`<br>\nWebinar {webinarId} not found or has expired.<br>",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "title",
              "value": "fugiat exercitation proident magna ullamco",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "poll_type",
              "value": "1",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "anonymous",
              "value": "false",
              "description": "undefined",
              "type": "text"
            },
            {
              "key": "questions",
              "value": "[{\"name\":\"irure ex velit consectetur\",\"type\":\"rating_scale\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"commodo in in ad\",\"do officia dolore eu\"],\"right_answers\":[\"laborum officia\"],\"prompts\":[{\"prompt_question\":\"minim in mollit\",\"prompt_right_answers\":[\"in cillum amet\",\"cupida\"]},{\"prompt_question\":\"eiusmod culpa\",\"prompt_right_answers\":[\"irure fugiat\",\"eiusmod et occaecat magna sed\"]}],\"answer_min_character\":93145901,\"answer_max_character\":91006906,\"case_sensitive\":false,\"rating_min_value\":37530130,\"rating_max_value\":-38740448,\"rating_min_label\":\"quis non proident Duis\",\"rating_max_label\":\"irure pariatur nisi\"},{\"name\":\"labore cillum\",\"type\":\"rank_order\",\"show_as_dropdown\":false,\"answer_required\":false,\"answers\":[\"in aliqua cillum\",\"irure fugiat qui et\"],\"right_answers\":[\"dolor in u\"],\"prompts\":[{\"prompt_question\":\"occaecat reprehenderit\",\"prompt_right_answers\":[\"reprehenderit deserunt\",\"c\"]},{\"prompt_question\":\"occaecat velit\",\"prompt_right_answers\":[\"ut mollit eu ipsum\",\"qui et tempor aute\"]}],\"answer_min_character\":72197843,\"answer_max_character\":-2000739,\"case_sensitive\":false,\"rating_min_value\":25766114,\"rating_max_value\":-12152537,\"rating_min_label\":\"adipisicing mollit in et\",\"rating_max_label\":\"Lorem magna non id\"}]",
              "description": "undefined",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/webinars/:webinarId/polls/:pollId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "webinars",
            ":webinarId",
            "polls",
            ":pollId"
          ],
          "variable": [
            {
              "key": "webinarId",
              "value": "68423085",
              "description": "(Required) The webinar's ID."
            },
            {
              "key": "pollId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The poll ID"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}