Skip to main content

Query User Subscription Relationship

You can use this API to query a user's subscription relationship.

Enable the Service​

You can enable the service through the RC Console. In the Console, navigate to Chat settings > Chat pricing plans -> Subscription User Status, and enable the service.

Enable Subscription User Status

Request Method​

POST: https://Data Center Domain/user/subscribe/query.json

Signature Rule: All server API requests must follow the signature rule. For details, refer to API Request Signature.

Rate Limit: 100 requests per second

Request Body Parameters​

The HTTP request body data format is application/x-www-form-urlencoded, and supports the following HTTP form parameters:

ParameterTypeRequiredDescription
subTypeintNoDefault is 1, which represents status subscription
userIdStringYesSubscriber ID
pageTokenStringNoPage token, defaults to empty (first page). Set to the pageToken returned from the previous page.
pageSizeintNoDefault is 200, maximum is 200, minimum is 50.

Request Example​

POST /user/subscribe/update.json HTTP/1.1
Host: api-cn.ronghub.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX(最大长度36)

userId=uid1

Response​

FieldTypeDescription
codeIntReturn code, 200 indicates success.
hasNextbooleanWhether there is a next page
subscriptionsList<UserSubscriptionRecord>Subscription list
pageTokenStringNext page PageToken.
  • UserSubscriptionRecord Structure:

    FieldTypeDescription
    subUserIdsString[]Subscribed users
    subTypeintSubscription type
    subTimelongSubscription time
    expiryLongSubscription expiration time

Error Codes​

codehttpStatusDescription
200200Success
26001400Invalid request parameters
26003500Internal error
26022403Subscribed user limit exceeded
26021200Subscribed user limit reached
26020401Subscription service not enabled

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX

{
"code": 200,
"hasNext": false,
"pageToken": "1712909941322_2_3881222167",
"subscriptions": [
{
"subUserIds": [
"4",
"5"
],
"subType": 1,
"subTime": 1712909941322,
"expiry": 1000000
}
]
}