Request Example

Taking Get Item List API as an example, the following steps show how to get sign and how to send this HTTP request.

1. Sort Parameter Pairs

Sort all parameter pairs in query string and header in alphabetic order and concatenate them with sign &. For example:

Request url:
/ark/open_api/v1/items?status=0&page_no=1&page_size=50

Header:
timestamp: 1469902537
app-key: xhs

Then the parameter pairs looks like:
page_no=1
page_size=50
timestamp=1469902537
app-key=xhs

So the parameter pairs string is:
app-key=xhs&page_no=1&page_size=50&timstamp=1469902537

2. Concatenate Url with Parameter String

Concatenate url(starts with slash) with the parameter string:

The url is:
/ark/open_api/v1/items
The result is:
/ark/open_api/v1/items?app-key=xhs&page_no=1&page_size=50&timestamp=1469902537

3. Append App Secret

Append app secret on the string get from last step:

app-secret is:
9a539709cafc1efc9ef05838be468a28
the result is:
/ark/open_api/v1/items?app-key=xhs&page_no=1&page_size=50&status=0&timestamp=14699025379a539709cafc1efc9ef05838be468a28

4. Use MD5 to Generate Sign

Use MD5 to encode the string from last step, and get the sign

The sign for the above request is:
72be6fad4dd0e5104dbdebbcdadb2a06

5. Use HTTP request

Finally, send your request with correct header, method and url. If you need to send request with body, please note that the data format used for all APIs is JSON.

Request url:
http://flssandbox.xiaohongshu.com/ark/open_api/v1/items?page_no=1&page_size=50&status=0

Header:
timestamp:1469902537
app-key:xhs
sign: 72be6fad4dd0e5104dbdebbcdadb2a06
Content-Type: application/json;charset=utf-8

Method: GET