'Can a twitter app automatically tweet on behalf of account it is associated with?

I’m a little confused with the process of getting a Twitter bot I want to associate with my personal Twitter account to tweet on my personal account’s behalf.

I set up the app and gave it read wrote permissions. I then created a curl command to send a tweet following the instructions at https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets

The example curl command is here:

`https://api.twitter.com/2/tweets -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-type: application/json" -d '{"text": "Hello World!"}'

However, I just get a 401 error and it says I have to be in a “user context.” I tried adding the access key and access secret to the url as <user>:<pass>@api.twitter.com but that didn’t help.

So do I still have to somehow authorize the twitter bot to work with my twitter account even though it is associated with the account?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source