Set user tags
Set tags for a single user. User tags are used exclusively with the following features:
tip
- Each request must include the full set of tags for the user. Each user can have up to 20 tags.
- Pass an empty array in the
tagsfield to clear all tags for the user.
Request method
POST: https://Base URL/user/tag/set.json
Rate limit: 100 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 |
|---|---|---|---|
userId | String | Yes | The user ID. |
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 /user/tag/set.json HTTP/1.1
Host: api.sg-light-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408706337
Signature: 890b422b75c1c5cb706e4f7921df1d94e69c17f4
Content-Type: application/json
{"userId":"31232","tags":["bj","男"]}
Response
| Field | Type | Description |
|---|---|---|
code | Number | Status code. 200 indicates success. |
Response example
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{"code":200}