Comments (2)
Hi @j4p 👋
Thank you for creating this issue.
Twitter has an unfortunate error response saying that you're not authorized, while in fact, it's like not to be the case.
Most likely there's a problem with how the encoding/decoding works internally.
It's a bug on our side - we will investigate 😊
Thank you.
from twitter-api-client.
Hi @SimonHoiberg
Thank you for your response!
Please do not worry too much since I believe this is not a bug in your code but rather simply an incompetence on my end.
First, allow me to explain to you the bot that I am trying to make.
Basically, the bot works by tweeting whatever is sent to it through the DM.
I made the bot with Twitter Account Activity API using the help of Twitter Autohook.
I followed this particular tutorial of which the whole code can be found here.
Everything was great, I only needed to modify the DM response part with a tweet instead.
However, as you might have known, the tweet API endpoint receives query params instead of a JSON object.
Here, I decided to use this client so that I don't have to deal with OAuth signing etc.
So everything went great, but then I decided to implement a feature such that it can also tweet the media attached to the DM.
This is where I am stuck. I managed to retrieve the media URL, however I am not authorized to access it.
Do keep in mind that I am not using the client in this part yet (I only use it for tweeting and plan to use it to upload the attached media later).
I tried making a GET request to the URL with Postman + Authorization header and it worked.
I might be able to do it with the node-fetch module but, again, I don't want to deal with OAuth signing.
So my question is:
- Can I make a GET request to fetch the image using this client so that I don't have to deal with OAuth signing, or
- Can I somehow get myself in an "authorized session" using this client so that I can fetch and upload the media right away, or
- Is there a better way to do what I am trying to achieve (maybe like directly upload the attached media from media URL or media ID using this client)
Afterthoughts
Upon writing this comment I looked back into the full code from the tutorial and decided that I need to look into the Request module.
I avoided using it because it says that it is deprecated.
I will report back to you later on whether it works or not.
Thanks!
from twitter-api-client.
Related Issues (20)
- 403 on twitter.accountsAndUsers.accountUpdateProfileBanner() HOT 1
- Many methods won't work correctly without `stringify_ids` set to true HOT 1
- twitter-api-client should throw `Error`s, not objects
- `accountsAndUsers.friendshipsNoRetweetsIds()` returns Promise<unknown>
- Cannot use tweetsV2.searchAllTweets
- Using OAuth 2.0 as authorization to log in.
- Installation twitter-api-client HOT 3
- require
- Access token and secret required for pre-access token OAuth 1.0 steps HOT 4
- CORS Error HOT 3
- tweets.statusesHomeTimeline uses wrong StatusesHomeTimeline return type HOT 1
- How to make calls using Bearer token? HOT 1
- Include an example on how to upload an image with a tweet HOT 3
- Support for scheduling tweets HOT 1
- Deno Support
- `oauth_token` is a required parameter for the access_token endpoint HOT 2
- Parameters for TwitterClient.directMessages.eventsNew method is not clear in documentation HOT 1
- Can you edit your biography?
- how to only authenticate a request?
- StatusesHomeTimeline type missing retweeted_status property HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-api-client.