From breaking news and entertainment to sports and politics, get the full story with all the live commentary. Use a Twitter developer app you've created to send API requests.
Go to siteimport { axios } from "@pipedream/platform"
import twitter from "@pipedream/twitter"
export default defineComponent({
props: {
twitter
},
async run({steps, $}) {
const config = {
url: `https://api.twitter.com/2/users/me`,
params: {
"user.fields": `created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,url,username,verified,withheld`,
expansions: `pinned_tweet_id`,
},
}
const headers = this.twitter._getAuthHeader(config)
return await axios($, {
...config,
headers
})
},
})
In order to connect your Twitter account to Pipedream, you'll need to create a developer project and app.
https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback
Emit new event when the specified User receives a Follower See docs here
Emit new event when the specified User follows a List See docs here
Emit new event when a Tweet is liked by the specified User See docs here
Emit new event when the specified User posts a Tweet See docs here
Emit new event when a Tweet is posted in the specified list See docs here
Below are some of the most common issues we see.
If you run into an error during the app connection process, make sure to doublecheck the below configurations:
developer_consumer_key
and developer_consumer_secret
in Pipedream. These map to Twitter's "API Key" and "API Key Secret" in the "Keys & Tokens" section in their dashboard.https://api.pipedream.com/connect/oauth/oa_gk6iBa/callback
Twitter uses OAuth authentication. When you connect your Twitter account, Pipedream will open a popup window where you can sign into Twitter and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Twitter API.
Pipedream requests the following authorization scopes when you connect your account:
do not use
POST
https://api.twitter.com/oauth/request_token
GET
https://api.twitter.com/oauth/authenticate
?
client_id={{oauth.client_id}}
&
force_login=true
&
oauth_token={{oauth.token}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
state={{oauth.state}}
POST
https://api.twitter.com/oauth/access_token
content-type: application/x-www-form-urlencoded
accept: application/json
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
&
code_verifier=challenge