Polyv Help Center

Help Center

Get Live Streaming Product List Interface

Updated: 2022-09-02 18:08:07

Interface URL

http://api.polyv.net/live/v3/channel/product/getListByRank

Interface Description

1、通过频道号和排序号获取排序号之后的上架商品列表
2、不传排序号获取最前面的上架商品列表
2、接口支持https

Supported Format

JSON

Request Method

GET

Request Limit

TRUE

Request Parameters

Parameter Required Type Description
appId Yes string Obtained from API settings, the appId registered in the live streaming system
timestamp Yes long Current 13-digit millisecond timestamp, valid within 3 minutes
sign Yes String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId Yes int Channel ID
rank No int Sort order

Successful Response JSON Example:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "total": 1,
        "content": [
            {
                "productId": 2128,
                "userId": "ee7fe7fbda",
                "channelId": 1779741,
                "name": "goods01",
                "price": null,
                "cover": "//liveimages.videocc.net/uploadimage/20200707/chat_img_1779741_15941158896246.png?x-oss-process=image/crop,x_142,y_142,w_355,h_355",
                "link": "http://www.msuno.cn",
                "status": 1,
                "createdTime": 1594115895000,
                "lastModified": 1597388856000,
                "rank": 11,
                "realPrice": 12.98,
                "type": "live",
                "linkType": 10,
                "pcLink": "",
                "mobileLink": "",
                "wxMiniprogramLink": "",
                "wxMiniprogramOriginalId": ""
            }
        ]
    }
}

Failed Response JSON Examples:

No appId entered

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

Incorrect appId

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

Timestamp error

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

Signature error

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

Field Description

Parameter Type Description
code int Response code: 200 for success, 400 for failure, 401 for signature error, 500 for exception error
status string "success" for success, "error" for failure
message string Error message when an error occurs
data object Response result set
total int Total number of listed products
content array Product list
productId int Unique product ID
userId int User userId
channelId int Channel ID
name int Product name
price int Product price
cover int Product image
link int General product redirect link
status int Product status: 1 for listed, only returns listed status
createdTime int Creation time
lastModified int Modification time
rank int Product sort order
realPrice int Actual product price
type int Product type: "live" for live streaming backend products
linkType int Product redirect type: 10 for general redirect, 11 for multi-platform redirect
pcLink int PC product redirect link
mobileLink int Mobile product redirect link
wxMiniprogramLink int WeChat Mini Program product redirect link
wxMiniprogramOriginalId int Original ID in the WeChat Mini Program product redirect link

Java Request Example

public static void main(String[] args) {
        String url = "http://api.polyv.net/live/v3/channel/product/getListByRank";
        // 用户对应的appId和加密串
        String appId = "xxxxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
        Map<String, String> params = new HashMap<>();
        param.put("channelId", "0000000");
        PolyvTool.setLiveSign(params, appId, appSecret);
        // 调用Polyv的httpClient工具类发送请求
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
    }
联系客服,在线咨询