Commit 78b208bbab201b620b9737cbf9d5bc5b42d09864
1 parent
9218f130
add hd
Showing
12 changed files
with
732 additions
and
0 deletions
05.互动云/1.1 评论-评论一条节目.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 1.1 评论一条节目 | ||
| 3 | + Sort: 11 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/commentServices/commentForHd/insertComment?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>id</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>节目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>sid</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>用户ID</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>comment</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>评论内容</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>plat</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td>sign</td> | ||
| 51 | + <td>true</td> | ||
| 52 | + <td>string</td> | ||
| 53 | + <td>签名</td> | ||
| 54 | + </tr> | ||
| 55 | +</table> | ||
| 56 | + | ||
| 57 | +----- | ||
| 58 | +#### 返回格式说明: | ||
| 59 | +``` | ||
| 60 | +{ | ||
| 61 | + errorCode:"0", | ||
| 62 | + errorMsg:"成功" | ||
| 63 | +} | ||
| 64 | +{ | ||
| 65 | + errorCode:"xxx", //错误代码(非0) | ||
| 66 | + errorMsg:"失败" //错误信息 | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +``` | ||
| 0 | \ No newline at end of file | 70 | \ No newline at end of file |
05.互动云/1.2 评论-评论点赞.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 1.2 评论点赞 | ||
| 3 | + Sort: 12 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/commentServices/commentForHd/praiseComment?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>id</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>节目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>sid</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>用户ID</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>commentId</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>评论ID</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>plat</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td>sign</td> | ||
| 51 | + <td>true</td> | ||
| 52 | + <td>string</td> | ||
| 53 | + <td>签名</td> | ||
| 54 | + </tr> | ||
| 55 | +</table> | ||
| 56 | + | ||
| 57 | +----- | ||
| 58 | +#### 返回格式说明: | ||
| 59 | +``` | ||
| 60 | +{ | ||
| 61 | + errorCode:"0", | ||
| 62 | + errorMsg:"成功" | ||
| 63 | +} | ||
| 64 | +{ | ||
| 65 | + errorCode:"xxx", //错误代码(非0) | ||
| 66 | + errorMsg:"失败" //错误信息 | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +``` | ||
| 0 | \ No newline at end of file | 70 | \ No newline at end of file |
05.互动云/1.3 评论-评论列表.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 1.3 评论列表 | ||
| 3 | + Sort: 13 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/commentServices/commentForHd/readAllComment?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>id</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>节目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>page</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>页号</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>pageSize</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>每页显示的条数</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>plat</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td>sign</td> | ||
| 51 | + <td>true</td> | ||
| 52 | + <td>string</td> | ||
| 53 | + <td>签名</td> | ||
| 54 | + </tr> | ||
| 55 | +</table> | ||
| 56 | + | ||
| 57 | +----- | ||
| 58 | +#### 返回格式说明: | ||
| 59 | +``` | ||
| 60 | +{ | ||
| 61 | + "next_cursor": "0", | ||
| 62 | + "previous_cursor": "0", | ||
| 63 | + "total_number": "1", 总页数 | ||
| 64 | + "total_columns": "1", 总条数 | ||
| 65 | + "comments": [ | ||
| 66 | + { | ||
| 67 | + "id": "11", | ||
| 68 | + "pid": "17", | ||
| 69 | + "uid": "145680", | ||
| 70 | + "nick": "nicknick", | ||
| 71 | + "facepath": "http://www.cnlive.com", | ||
| 72 | + "content": "我爱宠物第一条评论", | ||
| 73 | + "created_at": "2014-05-29 10:35", | ||
| 74 | + "praise":"2", | ||
| 75 | + "plat": "i" | ||
| 76 | + }, | ||
| 77 | + { | ||
| 78 | + "id": "12", | ||
| 79 | + "pid": "17", | ||
| 80 | + "uid": "145680", | ||
| 81 | + "nick": "nicknick", | ||
| 82 | + "facepath": "http://www.cnlive.com", | ||
| 83 | + "content": "我爱宠物第一条评论", | ||
| 84 | + "created_at": "2014-05-29 10:35", | ||
| 85 | + "praise":"5", | ||
| 86 | + "plat": "i" | ||
| 87 | + } | ||
| 88 | + ] | ||
| 89 | + | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +``` | ||
| 0 | \ No newline at end of file | 93 | \ No newline at end of file |
05.互动云/2.1 评分-评分.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 2.1 评分 | ||
| 3 | + Sort: 21 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/ctServices/gradeForHd/insertGrade?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>id</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>节目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>sid</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>用户ID</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>userMark</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>用户标识。 用户未登录,userMark必填(客户端建议传设备号,PC建议为uuid)</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>rating</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>int</td> | ||
| 47 | + <td>分值</td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td>plat</td> | ||
| 51 | + <td>true</td> | ||
| 52 | + <td>string</td> | ||
| 53 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 54 | + </tr> | ||
| 55 | + <tr> | ||
| 56 | + <td>sign</td> | ||
| 57 | + <td>true</td> | ||
| 58 | + <td>string</td> | ||
| 59 | + <td>签名</td> | ||
| 60 | + </tr> | ||
| 61 | +</table> | ||
| 62 | + | ||
| 63 | +----- | ||
| 64 | +#### 返回格式说明: | ||
| 65 | +``` | ||
| 66 | +{ | ||
| 67 | + errorCode: "0" | ||
| 68 | + errorMessage: "8.0,7.2" (根据ids顺序,返回评分值) | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | +``` | ||
| 0 | \ No newline at end of file | 72 | \ No newline at end of file |
05.互动云/2.2 评分-读取评分.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 2.2 读取评分 | ||
| 3 | + Sort: 22 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/ctServices/gradeForHd/readGrade?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>ids</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>节目ID(多个以英文,号分割)</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>plat</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>sign</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>签名</td> | ||
| 42 | + </tr> | ||
| 43 | +</table> | ||
| 44 | + | ||
| 45 | +----- | ||
| 46 | +#### 返回格式说明: | ||
| 47 | +``` | ||
| 48 | +{ | ||
| 49 | + errorCode: "0" | ||
| 50 | + errorMessage: "8.0,7.2" | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +``` | ||
| 0 | \ No newline at end of file | 54 | \ No newline at end of file |
05.互动云/2.3 评分-读取评分排行.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 2.3 读取评分排行 | ||
| 3 | + Sort: 23 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/ctServices/gradeForHdV2/readGradeRank?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>columnId</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>栏目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>count</td> | ||
| 33 | + <td>int</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>Top N</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>plat</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>sign</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>签名</td> | ||
| 48 | + </tr> | ||
| 49 | +</table> | ||
| 50 | + | ||
| 51 | +----- | ||
| 52 | +#### 返回格式说明: | ||
| 53 | +``` | ||
| 54 | +{ | ||
| 55 | + errorCode: "0" | ||
| 56 | + errorMessage: "1,2" (前count个评分排行的节目ID) | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +``` | ||
| 0 | \ No newline at end of file | 60 | \ No newline at end of file |
05.互动云/2.4 评分-评分V2.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 2.4 评分V2 | ||
| 3 | + Sort: 24 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/ctServices/gradeForHdV2/insertGrade?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>columnId</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>栏目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>id</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>节目ID</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>sid</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>用户ID</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>userMark</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>用户标识。用户未登录,userMark必填(客户端建议传设备号,PC建议为uuid)</td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td>rating</td> | ||
| 51 | + <td>int</td> | ||
| 52 | + <td>string</td> | ||
| 53 | + <td>分值</td> | ||
| 54 | + </tr> | ||
| 55 | + <tr> | ||
| 56 | + <td>plat</td> | ||
| 57 | + <td>true</td> | ||
| 58 | + <td>string</td> | ||
| 59 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 60 | + </tr> | ||
| 61 | + <tr> | ||
| 62 | + <td>sign</td> | ||
| 63 | + <td>true</td> | ||
| 64 | + <td>string</td> | ||
| 65 | + <td>签名</td> | ||
| 66 | + </tr> | ||
| 67 | +</table> | ||
| 68 | + | ||
| 69 | +----- | ||
| 70 | +#### 返回格式说明: | ||
| 71 | +``` | ||
| 72 | +{ | ||
| 73 | + errorCode:"0", | ||
| 74 | + errorMsg:"成功" | ||
| 75 | +} | ||
| 76 | +{ | ||
| 77 | + errorCode:"xxx", //错误代码(非0) | ||
| 78 | + errorMsg:"失败" //错误信息 | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | +``` | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
05.互动云/2.5 评分-读取评分V2.md
0 → 100644
| 1 | +/* | ||
| 2 | + Title: 2.5 读取评分V2 | ||
| 3 | + Sort: 25 | ||
| 4 | +*/ | ||
| 5 | +#### URL: http://api.cnlive.com/open/api/ctServices/gradeForHdV2/readGrade?sp_id=xxx&... | ||
| 6 | +----- | ||
| 7 | +#### 请求方式: POST | ||
| 8 | +----- | ||
| 9 | +#### 返回格式: JSON | ||
| 10 | +----- | ||
| 11 | +#### 请求参数说明: | ||
| 12 | +<table class="table table-bordered table-striped table-condensed"> | ||
| 13 | + <tr> | ||
| 14 | + <th>参数</th> | ||
| 15 | + <th>必选</th> | ||
| 16 | + <th>类型</th> | ||
| 17 | + <th>说明</th> | ||
| 18 | + </tr> | ||
| 19 | + <tr> | ||
| 20 | + <td>sp_id</td> | ||
| 21 | + <td>true</td> | ||
| 22 | + <td>string</td> | ||
| 23 | + <td>服务提供商ID</td> | ||
| 24 | + </tr> | ||
| 25 | + <tr> | ||
| 26 | + <td>columnId</td> | ||
| 27 | + <td>true</td> | ||
| 28 | + <td>string</td> | ||
| 29 | + <td>栏目ID</td> | ||
| 30 | + </tr> | ||
| 31 | + <tr> | ||
| 32 | + <td>ids</td> | ||
| 33 | + <td>true</td> | ||
| 34 | + <td>string</td> | ||
| 35 | + <td>节目ID(多个以英文,号分割)</td> | ||
| 36 | + </tr> | ||
| 37 | + <tr> | ||
| 38 | + <td>plat</td> | ||
| 39 | + <td>true</td> | ||
| 40 | + <td>string</td> | ||
| 41 | + <td>客户端平台[i:IOS客户端,a:Android客户端]</td> | ||
| 42 | + </tr> | ||
| 43 | + <tr> | ||
| 44 | + <td>sign</td> | ||
| 45 | + <td>true</td> | ||
| 46 | + <td>string</td> | ||
| 47 | + <td>签名</td> | ||
| 48 | + </tr> | ||
| 49 | +</table> | ||
| 50 | + | ||
| 51 | +----- | ||
| 52 | +#### 返回格式说明: | ||
| 53 | +``` | ||
| 54 | +{ | ||
| 55 | + errorCode: "0" | ||
| 56 | + errorMessage: "8.0,7.2" (根据ids顺序,返回评分值) | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +``` | ||
| 0 | \ No newline at end of file | 60 | \ No newline at end of file |
05.互动云/3.1 创建聊天室接口.md
0 → 100644
| 1 | +/* Title: 3.1 创建聊天室接口 */ | ||
| 2 | +### 创建聊天室接口 | ||
| 3 | +----- | ||
| 4 | +#### URL: http://api.cnlive.com/open/api2/chat/createRoom | ||
| 5 | +----- | ||
| 6 | +#### 请求方式: HTTP GET | ||
| 7 | +----- | ||
| 8 | +#### 返回格式: JSON | ||
| 9 | +----- | ||
| 10 | +#### 请求参数说明: | ||
| 11 | +| 参数名 | 参数类型 | 长度 | 必选 | 参数说明 | | ||
| 12 | +| :----------- | :------: | :------: | :------: | :------: | | ||
| 13 | +| sp_id | String | | true | 应用ID | | ||
| 14 | +| id | String | 不超过30个字符 |true | 业务系统提供的唯一标识(作为聊天室ID) | | ||
| 15 | +| name | String | 不超过50个字符 |false | 业务的活动名(用于后台管理展示)| | ||
| 16 | +| sign | String | |true | 签名规则见<a href="http://help.open.cnlive.com/common.html">签名详情</a> | | ||
| 17 | +----- | ||
| 18 | +#### 返回格式说明: | ||
| 19 | +``` | ||
| 20 | +{ | ||
| 21 | + "errorCode":"0", | ||
| 22 | + "errorMessage":"成功" | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +{ | ||
| 26 | + "errorCode":"53000", | ||
| 27 | + "errorMessage":"聊天室已存在" | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +{ | ||
| 31 | + "errorCode":"53001", | ||
| 32 | + "errorMessage":"聊天室创建失败" | ||
| 33 | +} | ||
| 34 | +``` | ||
| 0 | \ No newline at end of file | 35 | \ No newline at end of file |
05.互动云/3.2 释放聊天室接口.md
0 → 100644
| 1 | +/* Title: 3.2 释放聊天室接口 */ | ||
| 2 | +### 释放聊天室接口 | ||
| 3 | +----- | ||
| 4 | +#### URL: http://api.cnlive.com/open/api2/chat/releaseRoom | ||
| 5 | +----- | ||
| 6 | +#### 请求方式: HTTP GET | ||
| 7 | +----- | ||
| 8 | +#### 返回格式: JSON | ||
| 9 | +----- | ||
| 10 | +#### 请求参数说明: | ||
| 11 | +| 参数名 | 参数类型 | 必选 | 参数说明 | | ||
| 12 | +| :----------- | :------: | :------: | :------: | | ||
| 13 | +| sp_id | String | true | 应用ID | | ||
| 14 | +| id | String | true | 业务系统提供的唯一标识(作为聊天室ID) | | ||
| 15 | +| sign | String | true | 签名规则见<a href="http://help.open.cnlive.com/common.html">签名详情</a> | | ||
| 16 | +----- | ||
| 17 | +#### 返回格式说明: | ||
| 18 | +``` | ||
| 19 | +{ | ||
| 20 | + "errorCode":"0", | ||
| 21 | + "errorMessage":"成功", | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +{ | ||
| 25 | + "errorCode":"53002", | ||
| 26 | + "errorMessage":"聊天室不存在" | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +{ | ||
| 30 | + "errorCode":"53003", | ||
| 31 | + "errorMessage":"聊天室释放失败" | ||
| 32 | +} | ||
| 33 | +``` | ||
| 0 | \ No newline at end of file | 34 | \ No newline at end of file |
05.互动云/3.3 发送聊天信息接口.md
0 → 100644
| 1 | +/* Title: 3.4 发送聊天信息接口 */ | ||
| 2 | +### 发送聊天信息接口 | ||
| 3 | +----- | ||
| 4 | +#### URL: http://api.cnlive.com/open/api2/chat/sendMessage | ||
| 5 | +----- | ||
| 6 | +#### 请求方式: HTTP GET | ||
| 7 | +----- | ||
| 8 | +#### 返回格式: JSON | ||
| 9 | +----- | ||
| 10 | +#### 请求参数说明: | ||
| 11 | +| 参数名 | 参数类型 | 必选 | 参数说明 | | ||
| 12 | +| :----------- | :------: | :------: | :------: | | ||
| 13 | +| sp_id | String | true | 应用ID | | ||
| 14 | +| id | String | true | 业务系统的唯一标识作为聊天室ID | | ||
| 15 | +| uid | String | false | 用户ID | | ||
| 16 | +| img | String | false | 用户头像 | | ||
| 17 | +| msg | String | true | 消息体(含昵称,消息类型,消息信息等) | | ||
| 18 | +----- | ||
| 19 | +#### 返回格式说明: | ||
| 20 | +``` | ||
| 21 | +{ | ||
| 22 | + "errorCode":"0", | ||
| 23 | + "errorMessage":"成功" | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +{ | ||
| 27 | + "errorCode":"53004", | ||
| 28 | + "errorMessage":"发送失败" | ||
| 29 | +} | ||
| 30 | +``` | ||
| 0 | \ No newline at end of file | 31 | \ No newline at end of file |
05.互动云/3.4 聊天室JSSDK接口.md
0 → 100644
| 1 | +/* Title: 3.4 聊天室JSSDK接口 */ | ||
| 2 | +### 聊天室JSSDK接口 | ||
| 3 | +----- | ||
| 4 | +#### URL: http://resweb.cnliveimg.com/sites/cnlive/im_cnlive.min.js | ||
| 5 | +----- | ||
| 6 | +#### 参数说明 类型(JSON) | ||
| 7 | +``` | ||
| 8 | +{ | ||
| 9 | + roomId: '20130816144416',//聊天室房间ID(必填) | ||
| 10 | + jid: addNumber(6),//聊天系统用户URI(非必填,不填采用匿名登录) | ||
| 11 | + pwd: addNumber(6),//密码(非必填,不填采用匿名登录) | ||
| 12 | + nickname: '哈哈',//进入聊天室的昵称 | ||
| 13 | + onMessage: function(msg) { //消息接收回到函数,msg即消息体(必填) | ||
| 14 | + console.log(msg); | ||
| 15 | + }, | ||
| 16 | + rawInputLog: function(data) { //接收日志(非必填) | ||
| 17 | + console.log("RECV:"+data); | ||
| 18 | + }, | ||
| 19 | + rawOuputLog: function(data) { //发送日志(非必填) | ||
| 20 | + console.log("SEND:"+data); | ||
| 21 | + }, | ||
| 22 | + onConnect:function(status){ //连接状态 回到函数(非必填) | ||
| 23 | + if(status == Strophe.Status.CONNFAIL) { | ||
| 24 | + console.log("connection fail......"); | ||
| 25 | + } else if(status == Strophe.Status.AUTHFAIL) { | ||
| 26 | + console.log("login fail......"); | ||
| 27 | + } else if(status == Strophe.Status.DISCONNECTED) { | ||
| 28 | + console.log("connection cutDown......"); | ||
| 29 | + } else if(status == Strophe.Status.CONNECTED || status == Strophe.Status.ATTACHED) { | ||
| 30 | + console.log("start chat......"); | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | +}; | ||
| 34 | + | ||
| 35 | +``` | ||
| 36 | +----- | ||
| 37 | +#### 接口方法 | ||
| 38 | +----- | ||
| 39 | +##### 加入聊天室 | ||
| 40 | +``` | ||
| 41 | + IM.start({ | ||
| 42 | + onMessage: function(msg) { | ||
| 43 | + $("body").append(JSON.stringify(msg)); | ||
| 44 | + }, | ||
| 45 | + roomId: '20130816144416', | ||
| 46 | + nickname: 'dfdddgdf1dddgfdf', | ||
| 47 | + rawInputLog: function(data) { | ||
| 48 | + console.log("RECV:" + data); | ||
| 49 | + }, | ||
| 50 | + rawOuputLog: function(data) { | ||
| 51 | + console.log("SEND:" + data); | ||
| 52 | + }, | ||
| 53 | + onConnect: function(status) { | ||
| 54 | + if(status == Strophe.Status.CONNFAIL) { | ||
| 55 | + console.log("connection fail......"); | ||
| 56 | + | ||
| 57 | + } else if(status == Strophe.Status.AUTHFAIL) { | ||
| 58 | + console.log("login fail......"); | ||
| 59 | + | ||
| 60 | + } else if(status == Strophe.Status.DISCONNECTED) { | ||
| 61 | + console.log("connection cutDown......"); | ||
| 62 | + } else if(status == Strophe.Status.CONNECTED || status == Strophe.Status.ATTACHED) { | ||
| 63 | + console.log("start chat......") | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + }); | ||
| 67 | +``` | ||
| 68 | +----- | ||
| 69 | +##### 禁止触发接收回调函数 | ||
| 70 | +``` | ||
| 71 | + IM.stopAccept(); | ||
| 72 | +``` | ||
| 73 | +----- | ||
| 74 | +##### 打开触发接收回调函数 | ||
| 75 | +``` | ||
| 76 | + IM.restartAccept(); | ||
| 77 | +``` | ||
| 78 | +----- | ||
| 79 | +##### 手动关闭连接 | ||
| 80 | +``` | ||
| 81 | + IM.stop(); | ||
| 82 | +``` | ||
| 0 | \ No newline at end of file | 83 | \ No newline at end of file |