Short url/shorten
第6行: | 第6行: | ||
needAuth=false| | needAuth=false| | ||
rateLimit=true| | rateLimit=true| | ||
− | params={{api_args|url_long|true|string| | + | params={{api_args|url_long|true|string|需要转换的长链接,需要URLencoded,最多不超过20个。}}| |
getParam=&url_long=hb6sz1&url_long=hbTPZw| | getParam=&url_long=hb6sz1&url_long=hbTPZw| | ||
postParam=| | postParam=| | ||
第31行: | 第31行: | ||
... | ... | ||
] | ] | ||
− | </pre> | + | </pre>| |
− | useAge= | + | useAge=多个url参数需要使用如下方式:url_long=aaa&url_long=bbb| |
otherInfo=无 | otherInfo=无 | ||
}} | }} |
2010年12月30日 (四) 16:19的版本
目录 |
short_url/shorten
将一个或多个长链接转换成短链接
URL
http://api.t.sina.com.cn/short_url/shorten.(json%7Cxml)
支持格式
XML/JSON
HTTP请求方式
GET
是否需要登录
false
关于授权机制,参见授权机制声明
请求数限制
true
关于请求数限制,参见接口访问权限说明
请求参数
必选 | 类型及范围 | 说明 | |
---|---|---|---|
source | true | string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数) |
url_long | true | string | 需要转换的长链接,需要URLencoded,最多不超过20个。 |
注意事项
多个url参数需要使用如下方式:url_long=aaa&url_long=bbb
返回结果
XML示例
<urls> <url> <url_short>http://t.cn/h4DwT1</url_short> <url_long>http://finance.sina.com.cn/</url_long> <type>0</type> </url> ... </urls>
JSON示例
[ { ”url_short”: ”http://t.cn/h4DwT1”, ”url_long”: ”http://finance.sina.com.cn/”, ”type”: 0 }, ... ]
其他
无