Chilkat Online Tools

SQL Server / Zoom API / Update a base plan

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
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @req int
    -- Use "Chilkat_9_5_0.HttpRequest" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.HttpRequest', @req OUT

    EXEC sp_OASetProperty @req, 'HttpVerb', 'PUT'
    EXEC sp_OASetProperty @req, 'Path', '/v2/accounts/:accountId/plans/base'
    EXEC sp_OASetProperty @req, 'ContentType', 'multipart/form-data'
    EXEC sp_OAMethod @req, 'AddStringForUpload2', @success OUT, '', '', '', '', 'mollit ad dolor'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'hosts', 'mollit ad dolor-93394448'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'increasing_hosts', 'mollit ad dolor-93394448-86837913'

    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
        RETURN
      END

    EXEC sp_OAGetProperty @resp, 'StatusCode', @iTmp0 OUT
    PRINT @iTmp0
    EXEC sp_OAGetProperty @resp, 'BodyStr', @sTmp0 OUT
    PRINT @sTmp0
    EXEC @hr = sp_OADestroy @resp


    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @req


END
GO

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": ""
    }
  ]
}