How to Post a Tweet Using a .NET 8 Web API 🐦
Vložit
- čas přidán 8. 07. 2024
- 🚀 Get the .NET 8 Web Dev Jump-Start Course for FREE: dotnet8.patrickgod.com
💖 Support me on Patreon for exclusive source code access: / _patrickgod
🐦 Let's get social on Twitter/X: x.com/_PatrickGod
Table of Contents:
00:00 How to Post a Tweet Using a .NET 8 Web API 🐦
00:47 Get Twitter API Keys
05:21 How I Got to the Solution
06:37 The .NET 8 Web API Project
06:58 Install Tweetinvi
07:39 Add a new Model
08:49 Add a Controller
10:14 How OAuth 1.0a works with the Twitter API
12:24 Implement the PostTweet Method
19:11 Run the App
#DotNet #Twitter #DotNet8
Just dropping this here in case someone is as lost as I was: To use the v2 tweets endpoint to post tweets you need an Access token and secret with Read, Write permission. If you created one without setting up User authentication first, it will only create it with the Read permission, so first you need to set up User authentication and then re generate the Access token and secret for it to have write permission and be able to create tweets with the api v2 endpoint.
This is great. Something I've been meaning to look into for a while now. Thanks!
Awesome! Glad I could help! 😊
Github code please :(
Great video, any idea on how to tweet an image? I tried it many times but no luck.
Thanks for the video bro
Sure thing! 😁
Failed to fetch.
Possible Reasons:
CORS
Network Failure
URL scheme must be "http" or "https" for CORS request. how can i fix this?
this is great. btw how about get tweets?
Hello Patrick God, Thank you for this video but i couldnt find my twitter (X) API Keys .please how do i do that
You have to register in the Twitter Developer Portal. It's totally free. 😊
@@PatrickGod please Good 😊 morning from this side is there any link to register
thank you i have been able too sign up
@@PatrickGod