获取视频分类的信息

接口URL

http://v.polyv.net/uc/services/rest?method=getCata

接口说明

作用:获取视频分类

支持格式

JSON

HTTP请求方式

POST,GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
cataid string 视频分类的id
readtoken string 用户的读取钥匙
sign string 签名,为40位大写的SHA1值
format string 默认只返回json格式,无需format

返回结果

{
"error": "0",
"data": [
{
"articles": "1",
"cataename": "",
"userid": "e2e84a7383",
"templateid": "0",
"parentid": "1",
"catatype": "0",
"cataname": "测试1",
"ext": "",
"hostid": "e",
"cataurl": "",
"extype": "\u0000\u0000\u0000",
"lmodify": "1410230776538",
"isdel": "0",
"catasort": "",
"ptime": "1410230776538",
"catatree": "1,1410230776538",
"cataid": "1410230776538"
},
{
"articles": "0",
"cataename": "",
"userid": "e2e84a7383",
"templateid": "0",
"parentid": "1410230776538",
"catatype": "0",
"cataname": "测试1-1",
"ext": "",
"hostid": "e",
"cataurl": "",
"extype": "\u0000\u0000\u0000",
"lmodify": "1410431619199",
"isdel": "0",
"catasort": "",
"ptime": "1410431619199",
"catatree": "1,1410230776538,1410431619199",
"cataid": "1410431619199"
},
{
"articles": "0",
"cataename": "",
"userid": "e2e84a7383",
"templateid": "0",
"parentid": "1410230776538",
"catatype": "0",
"cataname": "测试1-2",
"ext": "",
"hostid": "e",
"cataurl": "",
"extype": "\u0000\u0000\u0000",
"lmodify": "1410431629027",
"isdel": "0",
"catasort": "",
"ptime": "1410431629027",
"catatree": "1,1410230776538,1410431629027",
"cataid": "1410431629027"
},
{
"articles": "1",
"cataename": "",
"userid": "e2e84a7383",
"templateid": "0",
"parentid": "1",
"catatype": "0",
"cataname": "测试2",
"ext": "",
"hostid": "e",
"cataurl": "",
"extype": "\u0000\u0000\u0000",
"lmodify": "1410230787507",
"isdel": "0",
"catasort": "",
"ptime": "1410230787507",
"catatree": "1,1410230787507",
"cataid": "1410230787507"
}
]
}

字段 说明
error 错误提示
articles 视频数目
userid 用户id
templateid 模板id
parentid 父分类id
catatype 分类类型
cataname 分类名称
hostid 主机id
extype 以前的类型
isdel 已经删除
catasort 分类排序
ptime 上传时间
catatree 视频所在分类
cataid 分类id, 如1为根目录

php请求示例

<?php
  $readtoken = "c89b576f-2abd-485f-81f9-245d5ba7807f";
  $cataid = "1499329701906";
  $format ="";
  $secretkey ="E8qVf7rCFo";
  $str = "cataid=".$cataid."&readtoken=".$readtoken.$secretkey;
  $sign = strtoupper(sha1($str));
  $url = "http://v.polyv.net/uc/services/rest?method=getCata&cataid=".$cataid."&readtoken=".$readtoken."&format=".$format."&sign=".$sign;
  $content = file_get_contents($url);
  echo $content;
?>

 

签名规则

将请求参数(sign除外)按照参数名字典顺序排列,用“&”连接参数名与参数值,并在最后加上secretkey的值,生成40位大写SHA1值,作为sign。

以下是示例过程:

1. 将请求参数按照参数名字典顺序排列为:

cataid="1499329701906";
readtoken="c89b576f-2abd-485f-81f9-245d5ba7807f"

2. 连接字符串
用“&”连接参数名与参数值,并在最后加上secretkey的值,生成40位大写SHA1值,作为sign(本示例的值为E8qVf7rCFo),如下:

cataid=1499329701906&readtoken=c89b576f-2abd-485f-81f9-245d5ba7807fE8qVf7rCFo

3. 生成签名sign

sign为40位大写SHA1值:

B827BD4DCB5E931E8CA54B47A824EB7E61A7CE2A
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...