Cancel data subscription¶
Cancel an accepted data subscription. Upon success, the subscription database in the target workspace is deleted and the subscription record is restored to a reacceptable invitation.
POST https://moi.matrixorigin.cn/newmoi/data-share/subscriptions/{id}/unsubscribe
Preparation before calling¶
First query the data subscription list and confirm the subscription to be canceled. Prepare the personal access token, target workspace ID, and subscription ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$SUBSCRIPTION_ID: The subscription ID to be canceled, taken from the response of query data subscription list.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/data-share/subscriptions/$SUBSCRIPTION_ID/unsubscribe" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
integer |
A subscription ID greater than |
Successful response¶
Returns 200 on success, data is null.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
Fixed to |
Error response¶
{
"code": "ErrSubscriptionNotFound",
"msg": "数据订阅不存在",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the ID from the subscription list. |
|
|
The current identity does not have the permission to delete subscriptions. |
Request permission to delete data subscriptions. |
|
|
The subscription does not exist or does not belong to the current workspace. |
Verify subscription ID and workspace. |
|
|
The subscription status has changed and cannot be canceled at this time. |
Refresh the subscription list and try again. |
|
|
Data sharing and writing are temporarily under maintenance or migration access. |
Try again later. |
|
|
The server failed to cancel the subscription. |
Try again later. |
Follow-up operations¶
Query data subscription list, confirm that the status of the record has been restored to a re-acceptable subscription invitation.