Batch set user tags
Set tags for one or more users in a single request. User tags are used exclusively with the following features:
tip
- Each request must include the full set of tags. All specified users (
userIds) will have their tags replaced with the providedtags. Each user can have up to 20 tags. - Pass an empty array in the
tagsfield to clear all tags for the specified users.
Request method
POST: https://Base URL/v4/user/tag/batch/set
Rate limit: 10 requests per second
Signature required: All server API requests require signature verification. See API request signature.
Request body
The request body is in application/json format and supports the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
userIds | String[] | Yes | User IDs. Maximum 1,000 per request. All specified users will have their tags replaced. |
tags | String[] | Yes | User tags. Maximum 20 tags per user. Each tag must not exceed 40 bytes and cannot contain special characters. Each request replaces all existing tags. Pass an empty array to clear all tags. |
Request example
HTTP
POST /v4/user/tag/batch/set HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408706337
Signature: 890b422b75c1c5cb706e4f7921df1d94e69c17f4
Content-Type: application/json
{"userIds":["id1","id2"],"tags":["bj","男"]}
Response
| Field | Type | Description |
|---|---|---|
code | Number | Status code. 0 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":0}