Get Twitter Owner ID
GET https://api.twitter.com/1.1/users/show.json?screen_name={{myTwitterHandle}}
Retrieve your Twitter Owner ID using the Twitter API to get users. Make sure your Twitter handle is entered as an environment variable for myTwitterHandle
.
Authorization to make this request to the Twitter API should look something like this under the Authorization tab in Qodex:
](/assets/blogs/https://s3.amazonaws.com/Qodex-static-getQodex-com/Qodex-docs/twitterAuthQodex.png)
Read more about the Twitter API.
Set up Twitter Oauth 1.0 in Qodex:
Create an application in Twitter.
](/assets/blogs/https://s3.amazonaws.com/Qodex-static-getQodex-com/Qodex-docs/sushi-twitter-oauth1.png)
Generate an access token. You will need these credentials for the next step.
](/assets/blogs/https://s3.amazonaws.com/Qodex-static-getQodex-com/Qodex-docs/sushi-twitter-creds-web.png)
Enter these values into the environment. Important: make sure there are no trailing spaces when you paste your credentials.
](/assets/blogs/https://s3.amazonaws.com/Qodex-static-getQodex-com/Qodex-docs/sushi-twitter-credentials.png)
If you look under the Authorization tabs for the two Twitter API requests, you can see that we've selected OAuth 1.0 as our means of authorization, and we are inputting our environment variables using the double curly braces syntax {{variable}}.
](/assets/blogs/https://s3.amazonaws.com/Qodex-static-getQodex-com/Qodex-docs/twitterAuthQodex.png)
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
screen_name | string |
RESPONSES
status: OK
{"id":836103728,"id_str":"836103728","name":"Joyce Lin","screen_name":"PetuniaGray","location":"San Francisco, CA","profile_location":{"id":"5a110d312052166f","url":"https://api.twitter.com/1.1/geo/id/5a110d312052166f.json","place_type":"unknown","name":"San Francisco, CA","full_name":"San Francisco, CA","country_code":"","country":"","contained_within":[],"bounding_box":null,"attributes":{}},"description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":91,"friends_count":41,"listed_count":11,"created_at":"Thu Sep 20 18:26:14 +0000 2012","favourites_count":35,"utc_offset":-18000,"time_zone":"Central Time (US \u0026 Canada)","geo_enabled":false,"verified":false,"statuses_count":175,"lang":"en","status":{"created_at":"Mon Mar 05 16:04:08 +0000 2018","id":970691438445867008,"id_str":"970691438445867008","text":"Last chance to ask @kinlane a question about life, tech, and APIs during the @postmanclient AMA. https://t.co/x2cxJyD0cM","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"kinlane","name":"Kin Lane","id":5954192,"id_str":"5954192","indices":[19,27]},{"screen_name":"postmanclient","name":"Postman","id":517705687,"id_str":"517705687","indices":[77,91]}],"urls":[{"url":"https://t.co/x2cxJyD0cM","expanded_url":"https://twitter.com/postmanclient/status/970684930790445056","display_url":"twitter.com/postmanclient/…","indices":[97,120]}]},"source":"\u003ca href=\"http://twitter.com/download/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c/a\u003e","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":true,"quoted_status_id":970684930790445056,"quoted_status_id_str":"970684930790445056","retweet_count":0,"favorite_count":1,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/2703989903/033e9ae34acb7a0affe2992024767441_normal.jpeg","profile_image_url_https":"https://pbs.twimg.com/profile_images/2703989903/033e9ae34acb7a0affe2992024767441_normal.jpeg","profile_banner_url":"https://pbs.twimg.com/profile_banners/836103728/1466224899","profile_link_color":"7FDBB6","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false,"translator_type":"none","suspended":false,"needs_phone_verification":false}