Why https://api.twitter.com/1.1/statuses/home_timeline.json returns null


#1

Dear All

My objective is to retrieve tweets via Twitter API by an string.
When I am trying to get tweets via https://api.twitter.com/1.1/statuses/home_timeline.json. It returns null value. Despite I’ve created token with following command
IToken token = new Token(
ConfigurationManager.AppSettings[“token_AccessToken”],
ConfigurationManager.AppSettings[“token_AccessTokenSecret”],
ConfigurationManager.AppSettings[“token_ConsumerKey”],
ConfigurationManager.AppSettings[“token_ConsumerSecret”]);

Keep this mind that this token was working well with following command like
(1) dynamic lstr_SearchedData = token.ExecuteGETQuery(“https://api.twitter.com/1.1/search/tweets.json?q=” +tbxTexttoSearch.Text.Trim())
this was returning json data but the returned tweets were not same as tweet searched by Twitter manually from its home page.
Then I replaced it with
(2) dynamic lstr_SearchedData = token.ExecuteGETQuery("https://api.twitter.com/1.1/statuses/home_timeline.json"
but it returns null in lstr_SearchedData.

Even if some one can identify the reason behind difference in results of command 1 from Twitter Home Search and give me suggestion for correction,
I’ll be grateful to him/her

Regards
Aamir


#2

I’m not familiar with whichever programming language you’re using, but I would try to further debug the response object you’re getting back. Are there are any HTTP headers, status codes, or error response messages in the body?


#3

Dear Taylor
Thanks for replying

I am using ASP.NET C# and following is my code

IToken token = new Token( ConfigurationManager.AppSettings["token_AccessToken"], ConfigurationManager.AppSettings["token_AccessTokenSecret"], ConfigurationManager.AppSettings["token_ConsumerKey"], ConfigurationManager.AppSettings["token_ConsumerSecret"]);
            WebExceptionHandlingDelegate del = delegate(WebException wex)
            {
                lblMessage.Text = wex.Message;
            };

dynamic lstr_SearchedData = token.ExecuteGETQuery(“https://api.twitter.com/1.1/statuses/home_timeline.json”)

lstr_SearchedData receives null. Only items are using for Authentication which are coming from Application Settings (ConfigurationManager).

Regards
Aamir


#4

Thanks for replying Taylor
I am using ASP.NET C# and adopting the library Tweetinvi maintained by Linvi, recommended on Twitter Developer Documentation.
complete code is as follows:

            IToken token = new Token(
                ConfigurationManager.AppSettings["token_AccessToken"],
                ConfigurationManager.AppSettings["token_AccessTokenSecret"],
                ConfigurationManager.AppSettings["token_ConsumerKey"],
                ConfigurationManager.AppSettings["token_ConsumerSecret"]);

            WebExceptionHandlingDelegate del = delegate(WebException wex)
            {
                lblMessage.Text = wex.Message;
            };
                dynamic lstr_SearchedData = token.ExecuteGETQuery("https://stream.twitter.com/1.1/statuses/filter.json" +
                    "?track=" + tbxTexttoSearch.Text.Trim()
                    //"&count=800"
                    )

Kindly check it guide me for solution.

Regards
Aamir