微博开放平台
微连接
移动应用
网站接入
电商服务商
电商商家
数据服务
数据服务
合作伙伴
微博支付
轻应用
粉丝服务
文档
推广
我的应用
登录
weibo
开发文档
首页
平台政策与指引
概述
平台公约
新手指南
开发者协议
应用运营管理规范
微连接分级管理办法
应用审核产品指南
应用安全开发注意事项
平台应用设计规范
微服务接入指南
微博登录接入
用微博帐号登录
授权机制
移动应用接入
移动应用介绍
移动应用SSO授权
微博Deep Link
媒体接入平台
头条文章开放接口
视频上传开放接口
电商接入平台
电商服务商接入
电商商家端接入
电商平台能力接口
粉丝服务平台
粉丝服务平台
新手接入指南
微信开发者迁移指南
接收消息
发送消息
自定义菜单
用户管理
生成带参数的二维码
Fans Service Platform
商业接口
商业数据接入指南
订阅服务手册(中文版)
订阅服务手册(英文版)
商业接口-REST API
商业数据常见问题
网站接入
网站接入介绍
微博API
微博API
接口访问频次权限
资源下载
SDK
微博标识下载
常见问题
联系我们
工具箱
链入页面
链出更改
特殊页面
查看源代码
跳转到:
导航
,
搜索
根据下列原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== direct_messages/new == Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters. Request must be a POST. Returns the sent message in the requested format when successful. === URL: === http://api.t.sina.com.cn/direct_messages/new.format ===Formats:=== xml, json === HTTP Method(s): === POST ===Requires Authentication (about authentication):=== true ===API rate limited (about rate limiting):=== false ===Parameters:=== * user: Required. The ID or screen name of the recipient user. In order to support numeric screen names we will accept either of the following two parameters in place of the user parameter: * screen_name: screen name of the recipient user * user_id: user id of the recipient user * text: Required. The text of your direct message. Be sure to URL encode as necessary, and keep it under 140 characters. ===Usage notes:=== * This method is subject to update limits. A HTTP 403 will be returned if this limit has been hit. ===Response (about return values): === XML example (truncated): <?xml version="1.0" encoding="UTF-8"?> <direct_message> <id>88619848</id> <sender_id>1401881</sender_id> <text>all your bases are belong to us.</text> <recipient_id>7004322</recipient_id> <created_at>Wed Apr 08 20:30:04 +0000 2009</created_at> <sender_screen_name>dougw</sender_screen_name> <recipient_screen_name>igudo</recipient_screen_name> <sender> <id>1401881</id> <name>Doug Williams</name> <screen_name>dougw</screen_name> <location>San Francisco, CA</location> <description>Twitter API Support. Internet, greed, users, dougw and opportunities are my passions.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/59648642/avatar_normal.png</profile_image_url> <url>http://www.igudo.com</url> <protected>false</protected> <followers_count>1036</followers_count> <profile_background_color>9ae4e8</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>0000ff</profile_link_color> <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color> <profile_sidebar_border_color>87bc44</profile_sidebar_border_color> <friends_count>290</friends_count> <created_at>Sun Mar 18 06:42:26 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US & Canada)</time_zone> <profile_background_image_url>http://s3.amazonaws.com/twitter_production/profile_background_images/2752608/twitter_bg_grass.jpg</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>3394</statuses_count> <notifications>false</notifications> <following>false</following> <verified>true</verified> </sender> <recipient> <id>7004322</id> <name>Doug Williams</name> <screen_name>igudo</screen_name> <location>North Carolina</location> <description>A character.</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/15446222/twitter_48_48_normal.jpg</profile_image_url> <url>http://www.igudo.com</url> <protected>false</protected> <followers_count>19</followers_count> <profile_background_color>69A1AA</profile_background_color> <profile_text_color>000000</profile_text_color> <profile_link_color>F00</profile_link_color> <profile_sidebar_fill_color>ACBEC1</profile_sidebar_fill_color> <profile_sidebar_border_color>8A8F85</profile_sidebar_border_color> <friends_count>3</friends_count> <created_at>Thu Jun 21 21:16:21 +0000 2007</created_at> <favourites_count>0</favourites_count> <utc_offset>-18000</utc_offset> <time_zone>Eastern Time (US & Canada)</time_zone> <profile_background_image_url>http://static.twitter.com/images/themes/theme1/bg.gif</profile_background_image_url> <profile_background_tile>false</profile_background_tile> <statuses_count>382</statuses_count> <notifications>false</notifications> <following>true</following> <verified>true</verified> </recipient> </direct_message> ===Usage examples: === cURL (about cURL): curl -u user:password -d "text=all your bases are belong to us&user=user_2" http://api.t.sina.com.cn/direct_messages/new.xml
该页面使用的模板:
模板:Api args
(
查看源代码
)
模板:Api desc2
(
查看源代码
)
模板:Param DM
(
查看源代码
)
模板:Param user
(
查看源代码
)
返回到
Direct messages/new
。
反馈
分享
顶部