Query Default Template - Viewing Conditions
Updated: 2024-09-02 09:58:44
API Description
1、查询默认模板-观看条件
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/global/auth/get
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| 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 never 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 details: Signature Generation Rules |
| timestamp | true | String | Current 13-digit millisecond timestamp, valid for 3 minutes |
Example
http://api.polyv.net/live/v4/global/auth/get?appId=frlr1zazn3&sign=7E5AFF654E8CF7960F94D81EC9A516AC×tamp=1680493605309
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| data | Array | Data for successful response See details: Data Parameter Description |
| error | Object | Error information when status code is not 200 See details: Error Parameter Description |
| requestId | String | Request ID, a unique UUID generated for each request, only for troubleshooting and debugging, not for business logic |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| authEnabled | String | Authorization switch, Y: enabled, N: disabled |
| authType | String | Authorization type none: No restrictions code: Verification code viewing pay: Paid viewing phone: Whitelist viewing info: Registration viewing custom: Custom authorization viewing external: External authorization viewing direct: Direct authorization viewing |
| subAuthType | String | Corresponding value when authType is none, public-public viewing, wx-WeChat authorization |
| whiteListEntryText | String | Used when authType is phone, whitelist entry text, max length 64 |
| whiteListInputTips | String | Used when authType is phone, whitelist input prompt, max length 64 |
| authTips | String | Used when authType is phone, whitelist welcome title, max length 64 |
| payAuthTips | String | Used when authType is pay, paid viewing welcome title, max length 64 |
| price | Float | Used when authType is pay, viewing price |
| trialWatchEnabled | String | Used when authType is pay, trial watch toggle |
| trialWatchEndTime | String | Used when authType is pay, trial watch end time |
| trialWatchTime | Integer | Used when authType is pay, trial watch duration, in minutes |
| validTimePeriod | Integer | Used when authType is pay, viewing validity period |
| watchEndTime | String | Used when authType is pay, viewing end time |
| authCode | String | Used when authType is code, verification code, max length 64 |
| codeAuthTips | String | Used when authType is code, verification code welcome title, max length 64 |
| qcodeImg | String | Used when authType is code, verification code official account QR code, max length 256 |
| qcodeTips | String | Used when authType is code, verification code prompt text, max length 256 |
| infoAuthTips | String | Used when authType is info, registration viewing welcome title, max length 64 |
| infoDesc | String | Used when authType is info, registration viewing prompt message, max length 64 |
| infoFields | Array | Used when authType is info, registration viewing information, up to 10 items See details: InfoFields Parameter Description |
| customKey | String | Used when authType is custom, custom authorization key, max length 64 |
| customUri | String | Used when authType is custom, custom authorization URL, max length 128 |
| externalEntryText | String | Used when authType is external, external authorization entry text, max length 24 |
| externalKey | String | Used when authType is external, external authorization key, max length 64 |
| externalRedirectUri | String | Used when authType is external, external authorization redirect URL, max length 350 |
| externalUri | String | Used when authType is external, external authorization URL, max length 128 |
| directKey | String | Used when authType is direct, direct authorization key, max length 64 |
| privacyParam | Array | Used when authType is code, phone, info, privacy statement data, [{"authType":"phone" , "status":"Y" , "content":"Privacy Statement"}] See details: PrivacyParam Parameter Description |
| expectedArrivalEnabled | String | Used when authType is phone, attendance list toggle, Y: enabled, N: disabled |
| onceWhitelistEnabled | String | Whitelist cannot be reused, default is N, Y: Yes, N: No |
PrivacyParam Parameter Description
| Parameter | Type | Description |
|---|---|---|
| authType | String | Authorization type code: Verification code viewing pay: Paid viewing phone: Whitelist viewing info: Registration viewing custom: Custom authorization viewing external: External authorization viewing direct: Direct authorization viewing |
| channelId | Integer | Channel ID |
| content | String | Privacy statement content |
| status | String | Privacy statement toggle, Y: enabled, N: disabled |
InfoFields Parameter Description
| Parameter | Type | Description |
|---|---|---|
| name | String | Information title |
| options | String | Options |
| placeholder | String | Information description |
| smsEnabled | String | SMS verification, Y: enabled, N: disabled |
| type | String | Type, name: Name, text: Text, mobile: Phone number, number: Number, option: Dropdown option |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error reason |
| desc | String | Error description, corresponds to error.code |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded 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(getClass());
/**
* 查询默认模板-观看条件
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void authGetTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/global/auth/get";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
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",
"requestId": "def302387cab4451ad9258639feaa15c.6086.16804937190327583",
"data": [
{
"authType": "custom",
"authEnabled": "Y",
"payAuthTips": null,
"price": null,
"trialWatchEnabled": null,
"trialWatchEndTime": null,
"trialWatchTime": null,
"validTimePeriod": null,
"watchEndTime": null,
"authTips": null,
"whiteListEntryText": null,
"whiteListInputTips": null,
"infoAuthTips": null,
"infoDesc": null,
"infoFields": [],
"authCode": null,
"codeAuthTips": null,
"qcodeImg": null,
"qcodeTips": null,
"customKey": "122112121212",
"customUri": "http://baidu.com",
"externalKey": null,
"externalUri": null,
"externalRedirectUri": null,
"externalEntryText": null,
"directKey": null,
"privacyParam": null
},
{
"authType": "phone",
"authEnabled": "Y",
"payAuthTips": null,
"price": null,
"trialWatchEnabled": null,
"trialWatchEndTime": null,
"trialWatchTime": null,
"validTimePeriod": null,
"watchEndTime": null,
"authTips": "123",
"whiteListEntryText": "白名单入口文本",
"whiteListInputTips": null,
"infoAuthTips": null,
"infoDesc": null,
"infoFields": [],
"authCode": null,
"codeAuthTips": null,
"qcodeImg": null,
"qcodeTips": null,
"customKey": null,
"customUri": null,
"externalKey": null,
"externalUri": null,
"externalRedirectUri": null,
"externalEntryText": null,
"directKey": null,
"privacyParam": [
{
"channelId": null,
"authType": "phone",
"status": "Y",
"content": "隐私声明数据"
}
]
}
],
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
