The php sdk of Sina Weibo caused 20007 errors. This article describes how to solve the 20007 error caused by Sina Weibo php sdk. if you encounter such problems, refer. Sina Weibo has an advanced interface statusesupload_url_text (this article will refer to the solution to 20007 errors caused by the php sdk of Sina Weibo. if you encounter such problems, refer.
Sina Weibo has an advanced interface 'statuses/upload_url_text '(You need to apply for an additional interface in open.weibo.com ).
After passing an image URL address and text content, you can send a text microblog
The function corresponding to the php SDK is as follows:
The code is as follows: |
|
? /** * Specify an image URL to capture and upload the image and publish a new microblog at the same time. * * Corresponds to the API: {@ link http://open.weibo.com/wiki/2/statuses/upload_url_text statuses/upload_url_text} * * @ Param string $ status refers to the content of Weibo text to be published. the content cannot exceed 140 Chinese characters. * @ Param string $ url the URL of the image. it must start with http. * @ Return array */ Function upload_url_text ($ status, $ url) { $ Params = array (); $ Params ['status'] = $ status; $ Params ['URL'] = $ url; Return $ this-> oauth-> post ('statuses/upload', $ params, true ); }
|
An obvious error occurred while calling the api: $ this-> oauth-> post ('statuses/upload', $ params, true );
(On the one hand, the request should be statuses/upload_url_text, and on the other hand, the third parameter is incorrect)
As a result, the following error occurs: 20007 (20007: does multipart has image ?)
It will be OK if it is changed:
The code is as follows: |
|
? /** * Specify an image URL to capture and upload the image and publish a new microblog at the same time. * * Corresponds to the API: {@ link http://open.weibo.com/wiki/2/statuses/upload_url_text statuses/upload_url_text} * * @ Param string $ status refers to the content of Weibo text to be published. the content cannot exceed 140 Chinese characters. * @ Param string $ url the URL of the image. it must start with http. * @ Return array */ Function upload_url_text ($ status, $ url) { $ Params = array (); $ Params ['status'] = $ status; $ Params ['URL'] = $ url; Return $ this-> oauth-> post ('statuses/upload_url_text ', $ params, false ); } |
Bytes. Sina Weibo has an advanced interface statuses/upload_url_text (...