1.1/statuses/update.json "code": 32, "message": "Could not authenticate you."


#1

Team,

I’m getting error while executing 1.1/statuses/update.json (https://api.twitter.com/1.1/statuses/update.json?status=)
API and its returns
“code”: 32, “message”: “Could not authenticate you.”

I’m able to get Direct messages from https://api.twitter.com/1.1/direct_messages/events/list.json

Please advice. Do need any setting changes in application level


#2

This sounds like an OAuth issue. Can you share a code snippet that shows how you are invoking that endpoint?


#3

Hello andypiper,

I’m using POSTMAN to trigger this API


#4

Here is my C# code

          var client = new RestClient(directmsg+"?status=TestingTweeting");

            client.Authenticator = OAuth1Authenticator.ForProtectedResource(
                ApplicationConfiguration.TwitterConfiguration.Authorization.ConsumerKey,
                ApplicationConfiguration.TwitterConfiguration.Authorization.ConsumerSecret,
                ApplicationConfiguration.TwitterConfiguration.Authorization.AccessToken,
                ApplicationConfiguration.TwitterConfiguration.Authorization.AccessSecret
                );

            var request = new RestRequest(Method.POST);
            request.AddHeader("postman-token", "36f422a9-2fe4-0c92-991b-106f756fe402");
            request.AddHeader("cache-control", "no-cache");
            IRestResponse response = client.Execute(request);
            var myresponse=response.Content

Result : {“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}


#5

Team,
Can someone help me to solve this issue


#6

I am having the same issue as Chirag24624560.
I am using the python tweepy library and am getting the following error.
tweepy.error.TweepError: [{‘code’: 32, ‘message’: ‘Could not authenticate you.’}]

Here is my code:
https://pastebin.com/VAQDXVzH

Additionally, when I attempt to regenerate my access token and secret I get an “Error Page Not Found” Alert at the top of my screen and the token and secret do not update.
I am attempting to regenerate them at this page.
https://apps.twitter.com/app/APPID/keys

I am able to manually regenerate them by revoking access then generating them again. This does not fix the aforementioned “Could not authenticate you” bug though.


#7

There’s currently an issue where you need to revoke and regenerate tokens on apps.twitter.com, yes.

In both of your cases, this sounds like a general OAuth issue. Things to look at - are you system clocks accurate? Are you properly encoding the request?

@Chirag24624560 I just used the RestSharp code generated by Postman in a new dotnet console application to post a Tweet update. That code looks a little different to the code you’ve posted above.

using System;
using RestSharp;

namespace testclient
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new RestClient("https://api.twitter.com/1.1/statuses/update.json?status=another%20test%20in%20dotnet");
            var request = new RestRequest(Method.POST);
            request.AddHeader("Cache-Control", "no-cache");
            request.AddHeader("Authorization", "OAuth oauth_consumer_key=\"xxx\",oauth_token=\"xxxxr\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"1523311958\",oauth_nonce=\"xxxx\",oauth_version=\"1.0\",oauth_signature=\"xxxx"");
            request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            request.AddHeader("Content-Length", "11964");
            request.AddHeader("Accept-Encoding", "gzip;q=1.0,deflate;q=0.6,identity;q=0.3");
            IRestResponse response = client.Execute(request);
            Console.WriteLine(response.Content);
        }
    }
}

#8

This post was flagged by the community and is temporarily hidden.