Closed baumannzone closed 2 years ago
Describe the bug I'm trying to update the Twitter banner of my user. I've created and tested with both v1 and v2 applications in the developer portal.
Here is my code:
const twitterClient = new TwitterClient({ apiKey: process.env.API_KEY, apiSecret: process.env.API_SECRET, accessToken: process.env.CONSUMER_KEY, accessTokenSecret: process.env.CONSUMER_SECRET, }); const uploadBanner = async () => { const base64 = fs.readFileSync('1500x500.png', { encoding: 'base64' }); try { await twitterClient.accountsAndUsers.accountUpdateProfileBanner({ banner: base64, }); } catch (err) { console.log(err); } };
To reproduce Steps to reproduce the behaviour:
TwitterClient
fs
The error: { statusCode: 403, data: '' }
{ statusCode: 403, data: '' }
Expected behaviour The banner was successfully updated on Twitter
Package Manager:
package.json
"twitter-api-client": "^1.5.2"
Additional context AFAIK it has to be less than 700kb. The image size I'm using is ~200kb
Edit: I'm starting to think it's related to the app settings and permissions. I managed to get the latest followers. So, the client connection works.
Solved. I had to regenerate the tokens after changing them from read-only to read and write.
Describe the bug
I'm trying to update the Twitter banner of my user. I've created and tested with both v1 and v2 applications in the developer portal.
Here is my code:
To reproduce
Steps to reproduce the behaviour:
TwitterClient
instancefs
an image (base64)The error:
{ statusCode: 403, data: '' }
Expected behaviour
The banner was successfully updated on Twitter
Package Manager:
package.json
:"twitter-api-client": "^1.5.2"
Additional context
AFAIK it has to be less than 700kb. The image size I'm using is ~200kb
Edit: I'm starting to think it's related to the app settings and permissions. I managed to get the latest followers. So, the client connection works.