So I am able to make a post on weibo account using statuses/upload but I am unable to make a post on weibo account using statuses/share.
Both takes access_token, status,pic as mandatory parameter with multipart / form-data.
And I am getting the following error
{"error":"text not find domain!","error_code":10017,"request":"/2/statuses/share.json"}
Now, I narrowed down the source of the exception to status field but I still couldn't solve it:
status field for statuses/share says 用户分享到微博的文本内容,必须做URLencode,内容不超过140个汉字,文本中不能包含“#话题词#”,同时文本中必须包含至少一个第三方分享到微博的网页URL,且该URL只能是该第三方(调用方)绑定域下的URL链接,绑定域在“我的应用 - 应用信息 - 基本应用信息编辑 - 安全域名”里设置。
In english : Users to share text content microblogging, must do URLencode, the content is not more than 140 characters, the text can not contain "# # topic word," while the text must contain at least one third-party web page URL to share micro-blog, and the URL is only URL links under the third party (the caller) binding domain, a binding domain in the "my Apps - application information - basic information editing application - security domain" in the settings.
status field for statuses/upload says 要发布的微博文本内容,必须做URLencode,内容不超过140个汉字。
In English: To publish microblogging text content, must do URLencode, the content is not more than 140 characters.
So, status in statuses/share expects URL, but even though
I am URLencoding it
I have added a domain in security domain secion
I am passing the domain URL in it
status.it still gives me the above error.
So I am assuming status field is looking for some format which I missed. Anyone encountered and fixed such exception?
Sorry for late answer. Hopefully this helps someone in the future.
Weibo API is very unclear regarding the accepted format of parameter it expects.
So, statuses/upload accepts a
picas a binary andstatusas a string, you can pass a URL instatusand it will publish it just fine.however, statuses/share also accepts a
picas a binary andstatusas a string, butstatuswill accept URL if that URL domain is added as one of the security domain in application information of your Weibo Application.Now here's what I doing wrong.
I was adding 'google.com', because the error message on that box says
I later on decided to add the full URL 'www.google.com' and then it worked.
So when you try to save only 'google' in security domain, it won't allow you and will give you an error message. When you try to save 'google.com', it will let you save it but it won't be able to find any URL you provide like 'http://www.google.com' and will give you an error message when you try to send it with statuses/share. You have to save 'www.google.com' in security domain then only you will be able to pass 'http://www.google.com' in status parameter of statuses/share
Hopefully I am able to explain it clearly to those who comes here with this error.