Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP通过媒体(照片)Twitter API发送直接消息_Php_Twitter_Twitter Oauth - Fatal编程技术网

使用PHP通过媒体(照片)Twitter API发送直接消息

使用PHP通过媒体(照片)Twitter API发送直接消息,php,twitter,twitter-oauth,Php,Twitter,Twitter Oauth,我使用“Thematthharris”OAUTH库阅读和发送推文以及直接消息,我能够发送 新推特 在推特上回复 通过媒体回复推文 我使用了下面给出的Twitter状态更新API调用 https://api.twitter.com/1.1/statuses/update.json (for Tweets without media) https://api.twitter.com/1.1/statuses/update_with_media.json (for Tweets with media)

我使用“Thematthharris”OAUTH库阅读和发送推文以及直接消息,我能够发送

  • 新推特
  • 在推特上回复
  • 通过媒体回复推文
  • 我使用了下面给出的Twitter状态更新API调用

    https://api.twitter.com/1.1/statuses/update.json (for Tweets without media)
    https://api.twitter.com/1.1/statuses/update_with_media.json (for Tweets with media)
    
    作为响应,我能够获得
    Tweet对象(json_编码)
    ,通过它我可以保存在我的数据库中

    当我尝试对
    直接消息
    (twitter用户名前的“D”之前)执行相同操作时,回复成功转到
    twitter
    网站&我能够看到直接消息,但在
    twitter
    响应
    中,它返回的是最后一个
    Tweet对象
    ,而不是
    消息对象

    我还研究了
    twitter直接消息API

    https://api.twitter.com/1.1/direct_messages/new.json
    
    但它没有媒体上传的参数

    有人能帮我吗

    基本上我想用媒体发送直接消息&作为回应,我应该得到直接消息对象,而不是最后一个TWEET对象。


    提前感谢

    这太晚了,但答案是您无法通过媒体直接发送消息: