Skip to main content

Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Set user subscription

Nexconn allows you to subscribe to user online status. You can set up subscriptions from both the client and server side.

Request method

POST: https://Base URL/user/subscribe/set.json

Signature required: All server API requests require signature verification. See API request signature.

Rate limit: 100 requests per second

Request body

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

ParameterTypeRequiredDescription
subTypeIntNoDefaults to 1 (status subscription).
userIdStringYesThe subscriber's user ID.
subUserIdsStringYesComma-separated list of user IDs to subscribe to. Maximum 200 per request.
opTypeIntYesOperation type. 0 = subscribe. 1 = unsubscribe.
expiryLongNoSubscription duration in seconds. Required when opType is 0.

Request example

HTTP
POST /user/subscribe/set.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

userId=uid1&subUserIds=s_user1,s_user2&opType=0&expiry=60&subType=1

Response

FieldTypeDescription
codeIntStatus code. 200 indicates success.
subUserIdsString[]Returned when code is 26021. Lists users that reached subscription limits.

Error codes

CodeHTTP StatusDescription
200200Success
26001400Invalid request parameters
26003500Internal error
26022403Subscriber limit exceeded
26021200Subscribed user limit reached
26020401Subscription feature not enabled

Response example

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

{"code":200}