Obtaining User Subscriptions
Function
This API is used to obtain user subscriptions.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/event-subs
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. For how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 64 characters. Only letters and digits are allowed. Default Value No project ID is involved. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. For details, see Token-based Authentication. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
quota |
Integer |
Definition Subscription quota Constraints N/A Range N/A Default Value 10 |
|
used |
Integer |
Definition Used subscription quota Constraints N/A Range The value is an integer greater than 1. Default Value N/A |
|
eventSubscriptions |
Array of eventSubscriptionsinfo objects |
Definition Subscription details Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition Unique subscription ID Constraints N/A Range The value contains 19 characters, including letters and digits. Default Value N/A |
|
name |
String |
Definition Unique subscription name Constraints N/A Range N/A Default Value N/A |
|
enable |
Boolean |
Definition Subscription status Constraints N/A Range
Default Value N/A |
|
event_ids |
Array |
Definition IDs of events contained in the subscription. Event IDs are separated by commas (,). Each event type corresponds to a fixed event ID. Constraints N/A Range
Default Value N/A |
|
event_streamids |
String |
Definition ID of the subscription stream. If no stream was specified during subscription creation, the IDs of all streams are displayed. If subscription streams were specified, only their IDs are displayed. Constraints N/A Range N/A Default value N/A |
|
event_names |
String |
Definition Name of the subscription stream. If no subscription stream was specified during subscription creation, the names of all streams are displayed. If subscription streams were specified, only their names are displayed. Constraints N/A Range N/A Default value N/A |
|
create_time |
Integer |
Definition Time when a subscription was created. The value is a 13-digit UNIX timestamp. Constraints N/A Range N/A Default Value N/A |
|
topic_name |
String |
Definition Name of the selected stream when the subscription type is DIS Constraints N/A Range N/A Default Value N/A |
Example Requests
Obtain user subscriptions.
GET https://{Endpoint}/v1/{project_id}/event-subs
Example Responses
Status code: 200
Normal response
{
"quota" : 10,
"used" : 1,
"eventSubscriptions" : {
"id" : "s1r0SpFA2qksK7rT5lM",
"name" : "dis_Subscribe",
"enable" : false,
"enableStream" : true,
"eventLatestSend" : 0,
"event_ids" : "- dis_event.001\n- dis_event.002",
"event_streamids" : "E7WZh64GXi6zgW1q04f",
"create_time" : 1628669309208,
"update_time" : 1753774279974,
"topic_name" : "dis-yNkP"
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Normal response |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot