'What are the correct key/secret/token and Twitter authentication settings for posting using Twit?
TL;DR: The goal is to post on Twitter using ttezel/twit. What is the right setup of consumer (API) / access keys/token/secrets supplied to the Twit instance and of enabled authentication methods (OAuth 1 vs. OAuth 2) and Twit config?
According to Twitter API v2 authentication mapping, I should be able to manage (post/delete) Tweets when using OAuth 1.0a User Context, which I am (as described: https://www.npmjs.com/package/twit#twit-api):
{
consumer_key: '...'
, consumer_secret: '...'
, access_token: '...'
, access_token_secret: '...'
}
Also, I am on the Essential level of Twitter API, which only allows for use of APIv2.
So the combination of APIv2 and user context (1.0a) auth should allow me to post. However,
T.post('statuses/update', { status: 'hello world!' },...
returns the following error:
You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal
As if Twit was attempting to use a non-v2 endpoint.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
