Chilkat Online Tools

SQL Server / Zoom API / Update billing information

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/accounts/:accountId/billing'
    EXEC sp_OASetProperty @req, 'ContentType', 'multipart/form-data'
    EXEC sp_OAMethod @req, 'AddParam', NULL, 'first_name', 'fugiat enim occaecat'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'last_name', 'fugiat enim occaecatreprehenderit aliqua Ut'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'email', 'fugiat enim occaecatreprehenderit aliqua Utofficia'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'phone_number', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt ad'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'address', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisi'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'apt', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderit'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'city', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiat'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'state', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequat'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'zip', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequatnostrud ullamco magna'

    EXEC sp_OAMethod @req, 'AddParam', NULL, 'country', 'fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequatnostrud ullamco magnadolore ad'

    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 PATCH
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: multipart/form-data"
	--form 'first_name=fugiat enim occaecat'
	--form 'last_name=fugiat enim occaecatreprehenderit aliqua Ut'
	--form 'email=fugiat enim occaecatreprehenderit aliqua Utofficia'
	--form 'phone_number=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt ad'
	--form 'address=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisi'
	--form 'apt=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderit'
	--form 'city=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiat'
	--form 'state=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequat'
	--form 'zip=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequatnostrud ullamco magna'
	--form 'country=fugiat enim occaecatreprehenderit aliqua Utofficiasint veniam sunt adofficia nisinisi reprehenderitfugiattempor quis incididunt consequatnostrud ullamco magnadolore ad'
https://api.zoom.us/v2/accounts/:accountId/billing

Postman Collection Item JSON

{
  "name": "Update billing information",
  "request": {
    "method": "PATCH",
    "header": [
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "first_name",
          "value": "fugiat enim occaecat",
          "description": "Billing Contact's first name.",
          "type": "text"
        },
        {
          "key": "last_name",
          "value": "reprehenderit aliqua Ut",
          "description": "Billing Contact's last name.",
          "type": "text"
        },
        {
          "key": "email",
          "value": "officia",
          "description": "Billing Contact's email address.",
          "type": "text"
        },
        {
          "key": "phone_number",
          "value": "sint veniam sunt ad",
          "description": "Billing Contact's phone number.",
          "type": "text"
        },
        {
          "key": "address",
          "value": "officia nisi",
          "description": "Billing Contact's address.",
          "type": "text"
        },
        {
          "key": "apt",
          "value": "nisi reprehenderit",
          "description": "Billing Contact's apartment/suite.",
          "type": "text"
        },
        {
          "key": "city",
          "value": "fugiat",
          "description": "Billing Contact's city.",
          "type": "text"
        },
        {
          "key": "state",
          "value": "tempor quis incididunt consequat",
          "description": "Billing Contact's state.",
          "type": "text"
        },
        {
          "key": "zip",
          "value": "nostrud ullamco magna",
          "description": "Billing Contact's zip/postal code.",
          "type": "text"
        },
        {
          "key": "country",
          "value": "dolore ad",
          "description": "Billing Contact's country.",
          "type": "text"
        }
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/accounts/:accountId/billing",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "accounts",
        ":accountId",
        "billing"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "quis officia in reprehenderit",
          "description": "(Required) The account's ID."
        }
      ]
    },
    "description": "Update [billing information](https://support.zoom.us/hc/en-us/articles/201363263-About-Billing) of a sub account.<br><br>\nThis API can only be used by master accounts that pay all billing charges of their associated sub accounts. Zoom allows only [approved partners](https://marketplace.zoom.us/docs/api-reference/master-account-apis) to use master APIs and manage sub accounts' billing information. Email the partner programs team at **partner-success@zoom.us** for more details.<br><br>\n\n**Prerequisites:**\n* Pro or a higher paid account with master account option enabled. <br>\n\n**Scope**:`billing:master`<br>\n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n\n"
  },
  "response": [
    {
      "name": "**Error Code:** `200`<br>\nPlease subscribe a plan for this sub account first.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "first_name",
              "value": "fugiat enim occaecat",
              "description": "Billing Contact's first name.",
              "type": "text"
            },
            {
              "key": "last_name",
              "value": "reprehenderit aliqua Ut",
              "description": "Billing Contact's last name.",
              "type": "text"
            },
            {
              "key": "email",
              "value": "officia",
              "description": "Billing Contact's email address.",
              "type": "text"
            },
            {
              "key": "phone_number",
              "value": "sint veniam sunt ad",
              "description": "Billing Contact's phone number.",
              "type": "text"
            },
            {
              "key": "address",
              "value": "officia nisi",
              "description": "Billing Contact's address.",
              "type": "text"
            },
            {
              "key": "apt",
              "value": "nisi reprehenderit",
              "description": "Billing Contact's apartment/suite.",
              "type": "text"
            },
            {
              "key": "city",
              "value": "fugiat",
              "description": "Billing Contact's city.",
              "type": "text"
            },
            {
              "key": "state",
              "value": "tempor quis incididunt consequat",
              "description": "Billing Contact's state.",
              "type": "text"
            },
            {
              "key": "zip",
              "value": "nostrud ullamco magna",
              "description": "Billing Contact's zip/postal code.",
              "type": "text"
            },
            {
              "key": "country",
              "value": "dolore ad",
              "description": "Billing Contact's country.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/billing",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "billing"
          ],
          "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": "**HTTP Status Code:** `204`<br>\nAccount billing contact information updated.",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "first_name",
              "value": "fugiat enim occaecat",
              "description": "Billing Contact's first name.",
              "type": "text"
            },
            {
              "key": "last_name",
              "value": "reprehenderit aliqua Ut",
              "description": "Billing Contact's last name.",
              "type": "text"
            },
            {
              "key": "email",
              "value": "officia",
              "description": "Billing Contact's email address.",
              "type": "text"
            },
            {
              "key": "phone_number",
              "value": "sint veniam sunt ad",
              "description": "Billing Contact's phone number.",
              "type": "text"
            },
            {
              "key": "address",
              "value": "officia nisi",
              "description": "Billing Contact's address.",
              "type": "text"
            },
            {
              "key": "apt",
              "value": "nisi reprehenderit",
              "description": "Billing Contact's apartment/suite.",
              "type": "text"
            },
            {
              "key": "city",
              "value": "fugiat",
              "description": "Billing Contact's city.",
              "type": "text"
            },
            {
              "key": "state",
              "value": "tempor quis incididunt consequat",
              "description": "Billing Contact's state.",
              "type": "text"
            },
            {
              "key": "zip",
              "value": "nostrud ullamco magna",
              "description": "Billing Contact's zip/postal code.",
              "type": "text"
            },
            {
              "key": "country",
              "value": "dolore ad",
              "description": "Billing Contact's country.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/billing",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "billing"
          ],
          "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": "**HTTP Status Code:** `400`<br>\n**Error Code:** `2100`<br>\nThis sub account is on self pay mode.<br>\nInvalid country parameter: {country}.<br>\nInvalid state parameter: {state}.\n**Error Code:** `300`<br>\nYour request was not accepted because \"{field}\" cont",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "first_name",
              "value": "fugiat enim occaecat",
              "description": "Billing Contact's first name.",
              "type": "text"
            },
            {
              "key": "last_name",
              "value": "reprehenderit aliqua Ut",
              "description": "Billing Contact's last name.",
              "type": "text"
            },
            {
              "key": "email",
              "value": "officia",
              "description": "Billing Contact's email address.",
              "type": "text"
            },
            {
              "key": "phone_number",
              "value": "sint veniam sunt ad",
              "description": "Billing Contact's phone number.",
              "type": "text"
            },
            {
              "key": "address",
              "value": "officia nisi",
              "description": "Billing Contact's address.",
              "type": "text"
            },
            {
              "key": "apt",
              "value": "nisi reprehenderit",
              "description": "Billing Contact's apartment/suite.",
              "type": "text"
            },
            {
              "key": "city",
              "value": "fugiat",
              "description": "Billing Contact's city.",
              "type": "text"
            },
            {
              "key": "state",
              "value": "tempor quis incididunt consequat",
              "description": "Billing Contact's state.",
              "type": "text"
            },
            {
              "key": "zip",
              "value": "nostrud ullamco magna",
              "description": "Billing Contact's zip/postal code.",
              "type": "text"
            },
            {
              "key": "country",
              "value": "dolore ad",
              "description": "Billing Contact's country.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/billing",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "billing"
          ],
          "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:** `2001`<br>\nAccount does not exist: {subAccountId}.\n\n\n\n",
      "originalRequest": {
        "method": "PATCH",
        "header": [
          {
            "description": "Added as a part of security scheme: oauth2",
            "key": "Authorization",
            "value": "<token>"
          }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "first_name",
              "value": "fugiat enim occaecat",
              "description": "Billing Contact's first name.",
              "type": "text"
            },
            {
              "key": "last_name",
              "value": "reprehenderit aliqua Ut",
              "description": "Billing Contact's last name.",
              "type": "text"
            },
            {
              "key": "email",
              "value": "officia",
              "description": "Billing Contact's email address.",
              "type": "text"
            },
            {
              "key": "phone_number",
              "value": "sint veniam sunt ad",
              "description": "Billing Contact's phone number.",
              "type": "text"
            },
            {
              "key": "address",
              "value": "officia nisi",
              "description": "Billing Contact's address.",
              "type": "text"
            },
            {
              "key": "apt",
              "value": "nisi reprehenderit",
              "description": "Billing Contact's apartment/suite.",
              "type": "text"
            },
            {
              "key": "city",
              "value": "fugiat",
              "description": "Billing Contact's city.",
              "type": "text"
            },
            {
              "key": "state",
              "value": "tempor quis incididunt consequat",
              "description": "Billing Contact's state.",
              "type": "text"
            },
            {
              "key": "zip",
              "value": "nostrud ullamco magna",
              "description": "Billing Contact's zip/postal code.",
              "type": "text"
            },
            {
              "key": "country",
              "value": "dolore ad",
              "description": "Billing Contact's country.",
              "type": "text"
            }
          ]
        },
        "url": {
          "raw": "{{baseUrl}}/accounts/:accountId/billing",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "accounts",
            ":accountId",
            "billing"
          ],
          "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": ""
    }
  ]
}