Use Twitter API from one account to tweet from another account? - twitter

Is it possible to use my twitter API registered account on account X to tweet from another account Y, which is also mine?

Yes, you'd simply have to authenticate as account Y using OAuth 1.0a.
See https://developer.twitter.com/en/docs/basics/authentication/overview and https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a for more information.
If you're using Tweepy, see https://tweepy.readthedocs.io/en/latest/auth_tutorial.html.

It seems like Twitter made it intentionally hard to do this. Let me explain how I to do it, based on how I did it,
Create a developer account from your main account and get it approved
Create a separate Twitter account for your bot
In the developer portal Create a project and add an app
copy all the keys and secret keys while you are doing it
Go to user authentication settings in the app details and turn on oAuth 1.0a and OAuth (copy all the keys and keep it in a notepad)
go to tw-oob-oauth-cli and download the relevant binary with respect to your OS.
remove the part after tw-oob-oauth from the file name.
run ./tw-oob-oauth --key ${your_consumer_key} --secret ${your_consumer_secret}
your_consumer_key means your API key, and your_consumer_secret means your API secret (those are basically at the top of your copied keys or you can find them in the keys and tokens section of your app in the developer portal).
Follow the instructions shown in your command prompt after running the command
Finally You will get an Access Token and Token Secret
Use those two along with API key and secret to run your bot.
Hope it saves some hours of your valuable time, Cheers!

Related

Any way to send a Tweet as someone else without applying to Twitter Dev again?

So I applied as a Twitter Dev to make a bot that tweets stuff. About two days later, I got access. When I ran the code with the tokens it gave me, it posts from my account.
My question: Is there a way for me to make it send as another account (a bot account) without me having to apply again?
Yes, you can use the Sign-in with Twitter flow to authenticate a different user to your app, and then use the Access Token and Access Token Secret for that user to post to that account. This is the correct way to implement things - you should not be applying for multiple developer accounts.
You can also use tools like twurl or another CLI tool to
https://github.com/twitter/twurl/
https://github.com/smaeda-ks/tw-oob-oauth-cli
https://github.com/olithissen/twitter-oob
Did you get elevated access from tweeter or Essential? I have a stack error:
You currently have Essential access which includes access to Twitter API v2 endpoints only.
If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal.
It's hard to get Elevated now.

Paypal SDK Client ID

I'm confused about the Client ID I have to enter here. I found a few similar answers, but they are all old and don't answer my question.
So I have to enter my Client ID's here:
PayPalMobile.initializeWithClientIds(forEnvironments: [PayPalEnvironmentProduction: "HERE", PayPalEnvironmentSandbox: "HERE"])
But I don't know if I have to create REST API credentials or v.zero SDK credentials
I tried REST API first, but it didn't work.
And do I only need client ID's? So I don't have to enter the secrets to the email addresses anywhere?
All you need is to go to paypal developer account then
1- Go to Dashboard.
2- Create app.
3- you will find two tabs(sandbox and production) each one will give you an id to test on either modes.
you should also create testing accounts to make testing payments in sandbox mode
Here is a good documentation for Paypal mobile.

What Twitter access token should I use to automate tweets?

I would like to know what access token I require to achieve the following.
My Meteor app crawls various RSS feeds and makes a daily digest. I would like to automatically tweet about the daily digest when it is created, using the app's Twitter account.
As I see, in the doc, it seems that I need to use application owner access token and create my app using the app's Twitter account. Is this a correct approach?
Yes, that's correct. It's quite simple too.
Go to Twitter Apps and login with your regular twitter account
assuming you have one, if not you need to create one.
Once signed in click on Create New App button.
Fill out the application (Name, description, and whatever else it requires).
Create your key and access tokens. Share those with users that you trust as they'll be used to access the twitter API to read/write information.
Give the application you created a "Read and Write" permission based on what you asked in the question.
Then depending on the software/language you use there's a plenty of existing packages that can help you access and obtain the information from the API.

can't find where to create adwords developer token

I'm truing to figure out how to create an adwords developer token in new google interface. It was in settings tab formerly (right here at the screenshot http://take.ms/9lBlZ) but now it's gone. I looked through almost all links and didn't find an answer. So I really appreciate your help guys! Thanks!
If you create a campaign in your MCC (manager account), the MCC became normal Account, and you cant find "AdWords API Center" option.
I had to re-create another MCC
This thread is kind of old, but I just went through this so I can highlight the things that were confusing to me.
You need to create a legitimate MCC account, AND a test account. In the real one you need to apply for a developer token. You want to put this token in the properties file here api.adwords.developerToken
From your test MCC you need to create a test client. Use the clientId from the TEST client you just created in api.adwords.clientCustomerId in the properties file.
You need to get an API token for your app (and an OAuth token) through Google's developer console https://console.developers.google.com
Make sure the active google account session for your browser is for the email you registered your TEST Account to. Run the script they give to get the refresh token and put it here api.adwords.refreshToken in the properties file.
Now you're using your test developer token from your real account and given permissions to use the test account.
Google made this way more confusing than it had to be in my opinion...hopefully this helps someone figure it out though!
There are two types of Adwords Manager accounts, normal and testing.
How to get a testing account
With the normal one, I got the developer token but I cannot run nothing throught the API because the account was not approved.
So I created a testing account, which allows to work with the API without the need of being approved.
With the testing account I didn't saw the Adwords API Center link under Account Settings.
Reading documentation I saw the developer token of a normal account can be used with a different Adwords account.
So I'm using the info (client_id, client_secret, oauth_token) of a testing Adwords account and the developer token a normal Adwords account.
To get the Oauth_token you can use the OAuth Playground (remember to set the Playground link for redirection on your Oauth credentials).
Instructions to get a OAuth Playground with Adwords
Please complete the billing details after creating MCC account.
Once that is completed you can see API Center option under Tool Icon.
By filling billing details doesn't charge you but its just for verification purpose.
I just had the same issue.
Go here: https://ads.google.com/home/tools/manager-accounts/
Click "Create a manager account", follow the prompts and voila.

Google APIs Console - missing client secret

I tried to create a testing client id for an android app which uses OAUTH 2.0 as login for retrieving user profile. I followed the steps to complete the creation of the client id on google console, but I do not see anywhere the client secret. I'm trying to help my employer with getting google credentials for it's app. I know how to implement OAUTH 2.0 in android, but I need client secret to exchange the code with access token.
First, I selected "Google+ API" from Services tab.
Then followed the on screen steps from API Access tab.
It seems that Google finally ditched the unnecessary client_secret for installable applications and is not yet up-to-date with their documentation.
You should check if you already get an access_token in the initial OAuth request like it's handled on Facebook.
Another possibility would be to fall back to using a Simple API Access key.
Update:
First method seems to not work with Google.
The recommended way for Android is to use AccountManager instead of baking your own requests. Follow this example to see how this is implemented and how you get an AuthToken using a Simple API Access key. Instead of using the Tasks API you can then include the OAuth2 API library to retrieve the userinfo.
Click on "Download JSON "
Is it what you're looking for ?
Since almost everything from the accepted answer has been deprecated, I thought I'd share what I've found.
I needed the People API which requires a client secret. What Google recommends for using People API with Android is,
Select the application type Other, enter the
name "People API Quickstart", and click the Create button.
Found here: https://developers.google.com/people/quickstart/java
(Step 1 part e)
So if you need a client secret, you might consider using the Other type. Of course, follow the documentation for your specific API first.
Just today I found out that on the new Cloud Console we can see the client secret for android apps - while in the old google console we just can't.
To use the new Cloud console, just click on the message "We are improving the experience. Try the new Cloud Console." Google will ask for a SMS confirmation. Now you'll be redirected to the new cloud console
Now, just select your project, click on "Registered Apps" on the left menu, selected your android app, and voilá, on oAuth 2.0 Client Id you'll see your client secret. No idea why on the old google console it's not displayed, but if you really need a client secret key, it's there.
Now that the type Other is unavailable, I used type Desktop since I wish to upload using Visual Studio which is a Desktop app. That worked, I got the client id and client secret.
When you update any changes in the credential, make sure you could see the client ID and secret in the dashboard before downloading.
Google cloud takes at the least 10 seconds to regenerate the client id and add it in the json.
Once json is downloaded you can check for client_secret to be present.
source said that :
Visit the Google Developers Console to obtain OAuth 2.0 credentials such as a client ID and client secret that are known to both Google and your application. The set of values varies based on what type of application you are building. For example, a JavaScript application does not require a secret, but a web server application does.
Another solution is that you have to create a client ID with the type of "Installed Application" then you will have the Client secret

Resources