Chilkat Online Tools

unicodeC / Zoom API / Update a base plan

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkHttpRequestW.h>
#include <C_CkHttpResponseW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkHttpRequestW req;
    HCkHttpResponseW resp;

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

    http = CkHttpW_Create();

    req = CkHttpRequestW_Create();
    CkHttpRequestW_putHttpVerb(req,L"PUT");
    CkHttpRequestW_putPath(req,L"/v2/accounts/:accountId/plans/base");
    CkHttpRequestW_putContentType(req,L"multipart/form-data");
    CkHttpRequestW_AddStringForUpload2(req,L"",L"",L"",L"",L"mollit ad dolor");

    CkHttpRequestW_AddParam(req,L"hosts",L"mollit ad dolor-93394448");

    CkHttpRequestW_AddParam(req,L"increasing_hosts",L"mollit ad dolor-93394448-86837913");

    CkHttpRequestW_AddHeader(req,L"Authorization",L"Bearer <access_token>");

    resp = CkHttpW_SynchronousRequest(http,L"api.zoom.us",443,TRUE,req);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkHttpRequestW_Dispose(req);
        return;
    }

    wprintf(L"%d\n",CkHttpResponseW_getStatusCode(resp));
    wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp));
    CkHttpResponseW_Dispose(resp);


    CkHttpW_Dispose(http);
    CkHttpRequestW_Dispose(req);

    }

Curl Command

curl -X PUT
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'type=mollit ad dolor'
	--form 'hosts=mollit ad dolor-93394448'
	--form 'increasing_hosts=mollit ad dolor-93394448-86837913'
https://api.zoom.us/v2/accounts/:accountId/plans/base

Postman Collection Item JSON

{
  "name": "Update a base plan",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "type",
          "value": "mollit ad dolor",
          "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
          "type": "text"
        },
        {
          "key": "hosts",
          "value": "-93394448",
          "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
          "type": "text"
        },
        {
          "key": "increasing_hosts",
          "value": "-86837913",
          "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "accounts",
        ":accountId",
        "plans",
        "base"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The account's ID."
        }
      ]
    },
    "description": "Update a base plan of a sub account. \n\nThis API can only be used by master accounts that pay all billing charges of their associated Pro or higher subaccounts. Zoom allows only [approved partners](https://marketplace.zoom.us/docs/api-reference/master-account-apis) to use master APIs and manage subaccounts' subscriptions. Email the partner programs team at **partner-success@zoom.us** for more details.\n\n**Scopes:** `billing:master`<br>**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`\n\n**Prerequisites:**<br>\n* The subaccount must have a Pro or a higher plan."
  },
  "response": [
    {
      "name": "**Error Code:** `200`\nFree trial and VIP account can't update sub plan.<br>\nYou do not have a subscription yet.<br>\n\n",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "type",
              "value": "mollit ad dolor",
              "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
              "type": "text"
            },
            {
              "key": "hosts",
              "value": "-93394448",
              "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            },
            {
              "key": "increasing_hosts",
              "value": "-86837913",
              "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "plans",
            "base"
          ],
          "variable": [
            {
              "key": "accountId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The account's ID."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTPS Status Code:** `204`<br>\nBase plan updated.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "type",
              "value": "mollit ad dolor",
              "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
              "type": "text"
            },
            {
              "key": "hosts",
              "value": "-93394448",
              "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            },
            {
              "key": "increasing_hosts",
              "value": "-86837913",
              "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "plans",
            "base"
          ],
          "variable": [
            {
              "key": "accountId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The account's ID."
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**Error Code:** `300`<br>\nInsufficient number of hosts for business plan type.<br>\nInsufficient number of hosts for education plan type.<br>\nPlan types do not match, oldPlanType: {oldPlanType} newPlanType: {newPlanType}.<br>\n",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "type",
              "value": "mollit ad dolor",
              "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
              "type": "text"
            },
            {
              "key": "hosts",
              "value": "-93394448",
              "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            },
            {
              "key": "increasing_hosts",
              "value": "-86837913",
              "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "plans",
            "base"
          ],
          "variable": [
            {
              "key": "accountId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The account's ID."
            }
          ]
        }
      },
      "status": "Multiple Choices",
      "code": 300,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `400`<br>\n**Error Code:** `2100`<br> \nThis sub account is on self pay mode.<br>\nCannot makes updates when account is subscribed to a bundle plan.<br>\nThis account is not under a free trial plan.<br>\nThe account currently has {0} paid",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "type",
              "value": "mollit ad dolor",
              "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
              "type": "text"
            },
            {
              "key": "hosts",
              "value": "-93394448",
              "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            },
            {
              "key": "increasing_hosts",
              "value": "-86837913",
              "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "plans",
            "base"
          ],
          "variable": [
            {
              "key": "accountId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The account's ID."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "**HTTP Status Code:** `404`<br>\n**Error Code:** `1001`<br>\nUser does not exist.\n**Error Code:** `2001`<br>\nAccount does not exist: {subAccountId}.",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "type",
              "value": "mollit ad dolor",
              "description": "(Required) The account's [Base plan type](https://marketplace.zoom.us/docs/api-reference/other-references/plans#base-plans).",
              "type": "text"
            },
            {
              "key": "hosts",
              "value": "-93394448",
              "description": "(Required) The account plan's number of hosts: \n* For a Pro plan, provide a value between `1` and `9`. \n* For a Business Plan, provide a value between `10` and `49`. \n* For a Education Plan, provide a value between `20` and `149`. \n* For a Free Trial Plan, provide a value between `1` and `9999`. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            },
            {
              "key": "increasing_hosts",
              "value": "-86837913",
              "description": "An optional number of additional hosts to add to the account's Base plan. \n\nYou **must** provide at least one positive integer value for the `hosts` or the `increasing_hosts` field.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/plans/base",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "plans",
            "base"
          ],
          "variable": [
            {
              "key": "accountId",
              "value": "quis officia in reprehenderit",
              "description": "(Required) The account's ID."
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}