Polyv Help Center

Help Center

Query Field Information for Channel Registration Viewing Settings

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

API Description

1、获取频道或全局的登记观看字段
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/auth/get-record-field

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls are subject to rate limits. See details

Request Parameters

Parameter Required Type Description
appId true String Account appId [See Get Secret Key]
timestamp true Long Current 13-digit millisecond timestamp, valid within 3 minutes
sign true 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 stored or used directly on the client. 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]
rank true Integer Primary viewing condition is 1, secondary viewing condition is 2
channelId false String Channel ID, leave empty for global retrieval

Example

http://api.polyv.net/live/v3/channel/auth/get-record-field?appId=frlr1zazn3&sign=A9BFED5A4CD52C57BD0384827628C73C&rank=1&channelId=1965681&timestamp=1621844135149

Response Parameters

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure [See Global Error Description]
status String Response status text
message String Response description, provides error details when code is 400 or 500
data Array Contains data on success, empty string on error [See data field description]

data Field Description

Parameter Type Description
type String Registration viewing type
name: Name
mobile: Phone number
number: Number
option: Dropdown selection
text: Text
name String Registration viewing information title
placeholder String Registration viewing information description
options String Options for dropdown selection, separated by commas
sms String SMS verification toggle
Y: On
N: Off

Java Request Example

For quick integration of basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the download file.

It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.

private static final Logger log = LoggerFactory.getLogger(WatchConditionTest.class);
/**
 * 查询频道登记观看设置的字段信息
 * @throws IOException
 */
@Test
public void testGetRecordField() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId=super.appId;
    String appSecret=super.appSecret;
    String userId = super.userId;
    String timestamp=String.valueOf(System.currentTimeMillis());
    //业务参数
    String channelId = "1965681";
    String url = "http://api.polyv.net/live/v3/channel/auth/get-record-field";
    String rank = "1";

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);

    requestMap.put("rank", rank);
    requestMap.put("channelId",channelId);
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试查询频道登记观看设置的字段信息接口返回值:{}",response);
    //do somethings

}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": [{
        "type": "name",
        "name": "姓名",
        "options": null,
        "placeholder": "请输入姓名",
        "sms": null
    }, {
        "type": "number",
        "name": "年龄",
        "options": null,
        "placeholder": "请输入您的年龄",
        "sms": null
    }, {
        "type": "option",
        "name": "来自何方",
        "options": "大唐,东方",
        "placeholder": "来自哪里呢?",
        "sms": null
    }]
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询
在线咨询