I’m trying to do api that will share my short post and photo. I’m getting this error:
You are trying to load data from a www stream which had the following error when downloading.
403 Forbidden
UnityEngine.WWW:get_text()
I’m doing it in Unity. When I was sharing only text - it was working. When I changed a code to share media - I don’t know why it stopped work. That’s fragment of my code:
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("status", text);
parameters.Add ("media[]", texture);
Debug.Log(parameters);
// Add data to the form to post.
WWWForm form = new WWWForm();
form.AddField("status", text);
form.AddField("media[]", texture);
// HTTP header
var headers = new Hashtable();
headers["Authorization"] = GetHeaderWithAccessToken("POST", PostTweetURL, consumerKey, consumerSecret, response, parameters);
WWW web = new WWW(PostTweetURL, form.data, headers);
yield return web;
if (!string.IsNullOrEmpty(web.error))
{
Debug.Log(string.Format("PostTweet - failed. {0}\n{1}", web.error, web.text));
callback(false);
}
I’m basing on this http://stevenyau.wordpress.com/2013/12/26/working-with-twitter-api-1-1-with-unity/
I don’t have authorization mistakes etc, everything works, I’m getting tokens etc. I just have ERROR403. I have chosen all permissions - it didn’t help. Any ideas? I’m trying to do it since week and I completely lost ideas.