Api method users/lookup returns empty string


#1

When I call api.twitter.com/1.1/users/lookup.json method with correct autorization params I take empty string. No errors, no warnings - nothing. Without autorization data(or with incorrect data) it mathod return error(code 215 or 35).
With correct autorization data I can post twits, but cannot take any info abiut user.

What am I doing wrong?


#2

Are you able to demonstrate how you’re calling the API, and with what parameters? (please do not share API key or secrets). Are you using a particular API library?


#3

I use this code. It work in Unity 5.
First function work fine, second function not work.

private const string PostTweetURL = “https://api.twitter.com/1.1/statuses/update.json”;
private const string UsersLookupURL = “https://api.twitter.com/1.1/users/lookup.json”;

public static IEnumerator PostTweet(string text, string consumerKey, string consumerSecret, AccessTokenResponse response, PostTweetCallback callback)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add(“status”, text);

        // Add data to the form to post.
        WWWForm form = new WWWForm();
        form.AddField("status", text);

        // HTTP header
        var headers = new Dictionary<string, string>();
        headers.Add("Authorization", GetHeaderWithAccessToken("POST", PostTweetURL, consumerKey, consumerSecret, response, parameters));
        
        WWW web = new WWW(PostTweetURL, form.data, headers);
        yield return web;

        Debug.Log(web.bytes.Length.ToString());
        Debug.Log(Encoding.UTF8.GetString(web.bytes));
    }

public static IEnumerator GetUserFullInfo(string consumerKey, string consumerSecret, AccessTokenResponse response)
{
var parameters = new Dictionary<string, string>();
parameters.Clear();

        var headers = new Dictionary<string, string>();

        headers.Add("Authorization", GetHeaderWithAccessToken("GET", UsersLookupURL, consumerKey, consumerSecret, response, parameters));
        var getInfo = "?screen_name=ITD_test";

        WWW web = new WWW(UsersLookupURL + getInfo, new byte[0] { }, headers);    
        yield return web;

        Debug.Log(web.bytes.Length.ToString());
        Debug.Log(Encoding.UTF8.GetString(web.bytes));
    }

This is examlpe of autorization data

OAuth realm=“Twitter API”,
oauth_consumer_key="",
oauth_nonce="
",
oauth_signature_method=“HMAC-SHA1”,
oauth_timestamp="",
oauth_token="
",
oauth_version=“1.0”,
oauth_signature="*"