Accept data subscription¶
Accept a data subscription and specify the subscription database name in the target workspace.
POST $CLOUDSIGMA_API_BASE/data-share/subscriptions/{id}/subscribe
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the data subscription list and confirm the subscription to be accepted. Prepare the personal access token, target workspace ID, subscription ID, and local subscription name that can access the target workspace.
Confirm that the current identity has the data_subscription.create permission of the target workspace.
If you also need to query tables in the subscription, prepare credentials with SELECT permissions on the target table.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/data-share/subscriptions/$SUBSCRIPTION_ID/subscribe" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"sub_name": "sales_subscription"
}'
The subscription database is built under the default shared Catalog, and other locations cannot be specified.
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
Yes |
Subscription ID greater than |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target subscription database name, 1 to 200 characters, no spaces, tabs, or quotes allowed. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": "201",
"pub_name": "sales-share",
"source_database_id": "101",
"mo_database_name": "sales",
"table_scope": {
"mode": "selected",
"object_ids": [
"1001"
]
},
"target_database_id": "301",
"obj_display_name": "sales",
"obj_display_path": "catalog/sales",
"source_workspace_id": "ws-001",
"source_workspace_name": "数据工作区",
"publisher": "user-001",
"published_at": "2026-08-18T10:00:00Z",
"status": "subscribed",
"sub_name": "sales_subscription",
"subscribed_by": "user-002",
"created_at": "2026-08-18T10:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
response data. |
|
string |
Subscription ID. |
|
string |
Source release name. |
|
string |
Source database ID. |
|
string |
Source database name. |
|
object |
Publish a shared table range. |
|
string |
The ID of the subscription database in the target workspace. Return after successful acceptance. |
|
string |
The display name of the source database. |
|
string |
The display path of the source database. |
|
string |
Source workspace ID. |
|
string |
Source workspace name. Returned if there is a value. |
|
string |
Publisher. |
|
string |
Release time. |
|
string |
Current subscription status: |
|
string |
The name of the subscription database in the target workspace. |
|
string |
The identity to accept the subscription. |
|
string |
Time to accept subscription. |
|
string |
Range mode: |
|
array of string |
List of table IDs when range mode is |
Error response¶
{
"code": "ErrAlreadySubscribed",
"msg": "数据已订阅",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
Empty on error. |