跳转到: 导航, 搜索
(返回数据(JSON))
第1行: 第1行:
==头条文章发布接口==
+
=头条文章发布接口=
===功能===
+
 
发布头条文章
+
==功能==
===调用说明===
+
 
文章服务对外接口是开放平台接口,因此需要通过开放平台的认证,认证说明地址:
+
发布头条文章
http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E
+
 
===HTTP请求方式===
+
 
POST
+
==调用说明==
===请求URL===
+
 
 +
文章服务接口是开放接口,因此需要通过微博OAuth授权认证,取得用户授权后使用,认证说明地址:
 +
http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E
 +
 
 +
==HTTP请求方式==
 +
 
 +
POST
 +
 
 +
 
 +
==请求URL==
 
  https://api.weibo.com/proxy/article/publish.json
 
  https://api.weibo.com/proxy/article/publish.json
===请求参数===
+
 
 +
 
 +
==请求参数==
 +
 
 
<table class="wiki_table">
 
<table class="wiki_table">
 
<tr>
 
<tr>
第53行: 第65行:
 
<td>认证token</td>
 
<td>认证token</td>
 
</tr>
 
</tr>
</table>
+
</table>
注:
+
 
需要urlencode的参数采用的是 PHP 的rawurlencode 函数(也就是将空格编码为%20)
+
注:需要urlencode的参数采用的是 PHP 的rawurlencode 函数(也就是将空格编码为%20)
 +
 
 +
 
 +
==返回数据(JSON)==
  
===返回数据(JSON)===
 
 
<table class="wiki_table">
 
<table class="wiki_table">
 
<tr>
 
<tr>
第96行: 第110行:
 
</table>
 
</table>
  
===其他说明===
+
 
1. PC端查看文章的url地址是:http://weibo.com/ttarticle/p/show?id={id}
+
==其他说明==
2. 手机端查看文章的url地址是http://media.weibo.cn/article?id={id}
+
 
===请求示例===
+
1. PC端查看文章的url地址是:http://weibo.com/ttarticle/p/show?id={id}
 +
 
 +
2. 手机端查看文章的url地址是http://media.weibo.cn/article?id={id}
 +
 
 +
 
 +
==请求示例==
 +
 
 
  见demo
 
  见demo
===响应示例===
+
 
 +
 
 +
==响应示例==
 +
 
 
  见demo
 
  见demo
===错误码对应表===
+
 
 +
 
 +
==错误码对应表==
 +
 
 
<table class="wiki_table">
 
<table class="wiki_table">
 
<tr>
 
<tr>
第135行: 第161行:
 
<td>文章关联微博失败</td>
 
<td>文章关联微博失败</td>
 
</tr>
 
</tr>
 
 
</table>
 
</table>
 +
 +
 +
 +
{{#a:nobtns|noheading}}
 +
__NOTOC__

2016年6月20日 (一) 15:35的版本

头条文章发布接口

功能

发布头条文章


调用说明

文章服务接口是开放接口,因此需要通过微博OAuth授权认证,取得用户授权后使用,认证说明地址: http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E

HTTP请求方式

POST


请求URL

https://api.weibo.com/proxy/article/publish.json


请求参数

参数名称 类型 是否必需 描述
title string 文章标题,限定32个中英文字符以内
content string 正文内容,限制20000个中英文字符内,需要urlencode
cover string 文章封面图片地址url
summary string 文章导语
text string 与其绑定短微博内容,限制120个中英文字符内
access_token string 认证token

注:需要urlencode的参数采用的是 PHP 的rawurlencode 函数(也就是将空格编码为%20)


返回数据(JSON)

参数名称 类型 描述
code string 返回码,成功返回100000,失败返回其他
msg string 默认为空,code不为100000返回错误信息,错误描述详见错误对照表
data json 结果数据,成功时返回,失败返回空
|__ object_id string 对象id
|__ url string 文章url
|__ mid string 短微博对象id


其他说明

1. PC端查看文章的url地址是:http://weibo.com/ttarticle/p/show?id={id}

2. 手机端查看文章的url地址是http://media.weibo.cn/article?id={id}


请求示例

见demo


响应示例

见demo


错误码对应表

错误码 错误信息 描述
10001 system error 系统错误
10008 param xxx invalid 参数xxx不符合要求
11001 sass check error 发布过于频繁
11002 create statuses error 微博发送失败
11003 bind error 文章关联微博失败