DataFlex / Zoom API / Cancel a base plan
Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vReq
Handle hoReq
Variant vResp
Handle hoResp
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Get Create (RefClass(cComChilkatHttpRequest)) To hoReq
If (Not(IsComObjectCreated(hoReq))) Begin
Send CreateComObject of hoReq
End
Set ComHttpVerb Of hoReq To "PATCH"
Set ComPath Of hoReq To "/v2/accounts/:accountId/plans/base/status"
Set ComContentType Of hoReq To "multipart/form-data"
Send ComAddParam To hoReq "action" "non anim"
Send ComAddParam To hoReq "reason" "non anim4"
Send ComAddParam To hoReq "comment" "non anim4Ut incididunt eu"
Send ComAddHeader To hoReq "Authorization" "Bearer <access_token>"
Get pvComObject of hoReq to vReq
Get ComSynchronousRequest Of hoHttp "api.zoom.us" 443 True vReq To vResp
If (IsComObject(vResp)) Begin
Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
Set pvComObject Of hoResp To vResp
End
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComStatusCode Of hoResp To iTemp1
Showln iTemp1
Get ComBodyStr Of hoResp To sTemp1
Showln sTemp1
Send Destroy of hoResp
End_Procedure
Curl Command
curl -X PATCH
-H "Authorization: Bearer <access_token>"
-H "Content-Type: multipart/form-data"
--form 'action=non anim'
--form 'reason=non anim4'
--form 'comment=non anim4Ut incididunt eu'
https://api.zoom.us/v2/accounts/:accountId/plans/base/status
Postman Collection Item JSON
{
"name": "Cancel a base plan",
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"value": "multipart/form-data"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "action",
"value": "non anim",
"description": "(Required) The action that needs to be taken for this sub account. Value must be set to \"cancel\".",
"type": "text"
},
{
"key": "reason",
"value": "4",
"description": "The reason for the cancellation of plan. Reason options:<br>`1` - I am no longer working remote.<br>`2` - I had challenges getting the support I needed.<br>`3` - Features in the Basic Free Plan are sufficient.<br>`4` - The expense is too high.<br>`5` - I purchased the wrong product.<br> `6` - Paid purchase not needed right now, will repurchase in the future. (This can only be one of 1,2,3,4,5,6)",
"type": "text"
},
{
"key": "comment",
"value": "Ut incididunt eu",
"description": "Additional comments about the cancellation decision.",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/accounts/:accountId/plans/base/status",
"host": [
"{{baseUrl}}"
],
"path": [
"accounts",
":accountId",
"plans",
"base",
"status"
],
"variable": [
{
"key": "accountId",
"value": "quis officia in reprehenderit",
"description": "(Required) "
}
]
},
"description": "[Cancel a base plan](https://support.zoom.us/hc/en-us/articles/203634215-How-Do-I-Cancel-My-Subscription-) for a sub account.\n\nThis API can only be used by master accounts that pay all billing charges of their associated Pro or higher 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' subscriptions. Email the partner programs team at **partner-success@zoom.us** for more details.<br><br>\n\n**Scopes**: `billing:master`<br> \n**[Rate Limit Label](https://marketplace.zoom.us/docs/api-reference/rate-limits#rate-limits):** `Heavy`<br>\n**Prerequisites:**<br>\n* The sub account must have a Pro or a higher plan.\n "
},
"response": [
{
"name": "**Error Code:** `200`<br>\nCannot cancel plan for a sub account which is under free plan.<br>\nYou don’t have a major subscription yet.<br>\nYou should first cancel all additional subscriptions.<br>\nFree trial and VIP accounts can not cancel plans of a sub a",
"originalRequest": {
"method": "PATCH",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "action",
"value": "non anim",
"description": "(Required) The action that needs to be taken for this sub account. Value must be set to \"cancel\".",
"type": "text"
},
{
"key": "reason",
"value": "4",
"description": "The reason for the cancellation of plan. Reason options:<br>`1` - I am no longer working remote.<br>`2` - I had challenges getting the support I needed.<br>`3` - Features in the Basic Free Plan are sufficient.<br>`4` - The expense is too high.<br>`5` - I purchased the wrong product.<br> `6` - Paid purchase not needed right now, will repurchase in the future. (This can only be one of 1,2,3,4,5,6)",
"type": "text"
},
{
"key": "comment",
"value": "Ut incididunt eu",
"description": "Additional comments about the cancellation decision.",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/accounts/:accountId/plans/base/status",
"host": [
"{{baseUrl}}"
],
"path": [
"accounts",
":accountId",
"plans",
"base",
"status"
],
"variable": [
{
"key": "accountId",
"value": "quis officia in reprehenderit",
"description": "(Required) "
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "**HTTP Status Code:** `204`<br>\nPlan cancelled successfully. ",
"originalRequest": {
"method": "PATCH",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "action",
"value": "non anim",
"description": "(Required) The action that needs to be taken for this sub account. Value must be set to \"cancel\".",
"type": "text"
},
{
"key": "reason",
"value": "4",
"description": "The reason for the cancellation of plan. Reason options:<br>`1` - I am no longer working remote.<br>`2` - I had challenges getting the support I needed.<br>`3` - Features in the Basic Free Plan are sufficient.<br>`4` - The expense is too high.<br>`5` - I purchased the wrong product.<br> `6` - Paid purchase not needed right now, will repurchase in the future. (This can only be one of 1,2,3,4,5,6)",
"type": "text"
},
{
"key": "comment",
"value": "Ut incididunt eu",
"description": "Additional comments about the cancellation decision.",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/accounts/:accountId/plans/base/status",
"host": [
"{{baseUrl}}"
],
"path": [
"accounts",
":accountId",
"plans",
"base",
"status"
],
"variable": [
{
"key": "accountId",
"value": "quis officia in reprehenderit",
"description": "(Required) "
}
]
}
},
"status": "No Content",
"code": 204,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{}"
},
{
"name": "**HTTP Status Code:** `400`<br>\n**Error Code:** `2100`<br>\nThis sub account is paid by self.<br>\nYou cannot make cancellation requests for a bundle plan. Contact the Zoom Support team for details.<br>\nMaster accounts with bulk licenses cannot provision, u",
"originalRequest": {
"method": "PATCH",
"header": [
{
"description": "Added as a part of security scheme: oauth2",
"key": "Authorization",
"value": "<token>"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "action",
"value": "non anim",
"description": "(Required) The action that needs to be taken for this sub account. Value must be set to \"cancel\".",
"type": "text"
},
{
"key": "reason",
"value": "4",
"description": "The reason for the cancellation of plan. Reason options:<br>`1` - I am no longer working remote.<br>`2` - I had challenges getting the support I needed.<br>`3` - Features in the Basic Free Plan are sufficient.<br>`4` - The expense is too high.<br>`5` - I purchased the wrong product.<br> `6` - Paid purchase not needed right now, will repurchase in the future. (This can only be one of 1,2,3,4,5,6)",
"type": "text"
},
{
"key": "comment",
"value": "Ut incididunt eu",
"description": "Additional comments about the cancellation decision.",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/accounts/:accountId/plans/base/status",
"host": [
"{{baseUrl}}"
],
"path": [
"accounts",
":accountId",
"plans",
"base",
"status"
],
"variable": [
{
"key": "accountId",
"value": "quis officia in reprehenderit",
"description": "(Required) "
}
]
}
},
"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>User does not exist. <br>\n**Error Code:** `2001`<br>This account does not exist or does not belong to this master account.\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": "action",
"value": "non anim",
"description": "(Required) The action that needs to be taken for this sub account. Value must be set to \"cancel\".",
"type": "text"
},
{
"key": "reason",
"value": "4",
"description": "The reason for the cancellation of plan. Reason options:<br>`1` - I am no longer working remote.<br>`2` - I had challenges getting the support I needed.<br>`3` - Features in the Basic Free Plan are sufficient.<br>`4` - The expense is too high.<br>`5` - I purchased the wrong product.<br> `6` - Paid purchase not needed right now, will repurchase in the future. (This can only be one of 1,2,3,4,5,6)",
"type": "text"
},
{
"key": "comment",
"value": "Ut incididunt eu",
"description": "Additional comments about the cancellation decision.",
"type": "text"
}
]
},
"url": {
"raw": "{{baseUrl}}/accounts/:accountId/plans/base/status",
"host": [
"{{baseUrl}}"
],
"path": [
"accounts",
":accountId",
"plans",
"base",
"status"
],
"variable": [
{
"key": "accountId",
"value": "quis officia in reprehenderit",
"description": "(Required) "
}
]
}
},
"status": "Not Found",
"code": 404,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}