-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't post tweet using Twitter free developer plan #485
Comments
the library works fine with free plan. Just an idea, Check in your developer platform dashboard under User Authentication Settings that you have enabled "read/write" access under oauth 1.0 settings...... so that your keys are allowed to tweet |
Same here ! My code, which I run every few days, stopped working after 2023/6/13. My environment is here.
Here is a part of my code.
and I got a error when
|
@ry0y4n I think v1 API endpoints available in v2 API have been removed from free plan. |
Wow! Thank you for your information!
|
I've regenerated all the 4 keys/secrets and in the section "Access Token and Secret" there's the message "Created with Read and Write permissions" Still, using the code at the original post doesn't work, returning 403 with this error: Authenticating with Unknown is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context]. What am I missing? Surely something as @ry0y4a was able to use the v2.tweet() function. As additional context I'm using Node 14 with this library. Maybe the version for 14 differs greatly from the version for Node 18? Even if in package.json the version is 1.15.0 something could be different? |
After several tests, I discovered that the secret wasn't being passed correctly to my function. The library works well! |
I was using v2 tweet since last month, but it stopped working sometime this week with the 403 error. My issue was I had to include the App, which was standalone, inside the Project in the developer portal. All these Twitter restructuring jargons, sigh. |
It was in the error message all along, should have started there with debug before jumping to "the entire library is faulty". Lessons for next time! |
thanks! using v2 work for me |
After enabling read/write - regenerating the tokens worked This needs to be in the documentation import Twitter from 'twitter-api-v2';
const client = new Twitter({
appKey: process.env.TWITTER_API_KEY,
appSecret: process.env.TWITTER_API_SECRET,
accessToken: process.env.TWITTER_ACCESS_TOKEN,
accessSecret: process.env.TWITTER_ACCESS_SECRET,
});
export function tweet(tweet: string) {
client.v2.tweet(tweet);
}
` |
In my case I had to wait for a couple of minutes before it worked. |
Describe the bug
I'm following the library docs to authorize and post a tweet but it doesn't work with client.v1.tweet(). I've tried changing it to client.v2.tweet() but Twitter returns:
"Authenticating with Unknown is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context]".
To Reproduce
Here's the code snippet I'm using:
Expected behavior
Using the correct credentials the library should allow us to post a tweet correctly.
Is it even possible to use the library to tweet using the free developer plan?
The text was updated successfully, but these errors were encountered: