I have a bot running happily under v1 API and thought I’d write a new one but it seems the v1 endpoint for posting a tweet no longer works by default, you need elevated access.
I thought I’d just use v2 instead, namely POST /2/tweets but none of the existing C# libraries have implemented this aspect of v2! They’ve mostly implemented the read-only endpoints, and after two days of swearing I think I can imagine why!
First question, does anyone know of any C# libraries that have implemented v2 posting of tweets? That would be ideal.
Second, trying to do this myself, it seems Twitter docs are a bit split on this:
developer . twitter . com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets#cURL
Says to use: “Authorization: Bearer $ACCESS_TOKEN”
However, when I do that I get the message “Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context]”
The API tool here: developer . twitter . com/apitools/api?endpoint=%2F2%2Ftweets&method=post
Says to use: “Authorization: OAuth $OAUTH_SIGNATURE”
And this is where I’m at - I can’t seem to generate a signature that works here - I just get ‘Unauthorized’
I assumed I’d be able to use Twitter’s auth URL to generate this: api . twitter . com/oauth/authenticate?oauth_token=xxxxx
But this gives me: “The request token for this page is invalid”. I took the auth_token from the app dashboard’s ‘Access Token and Secret’ section.
is this right? Or do I need to get the oauth_token from somewhere else?
I utterly hate oAuth so any step-by-step idiot’s guide to generating this and then an example curl (with dummy values) to POST to the POST /2/tweets would be amazing - I simply don’t know what exactly that $OAUTH_SIGNATURE is supposed to look like.
And I’ve applied for elevated access anyway, see if they give it to me!
Thanks.