Skip to content

Instantly share code, notes, and snippets.

@rashedtalukder
Last active May 28, 2019 05:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rashedtalukder/d9a6af36f38f7de1560270240315d5ea to your computer and use it in GitHub Desktop.
Save rashedtalukder/d9a6af36f38f7de1560270240315d5ea to your computer and use it in GitHub Desktop.
Twitter Consumable API
#%RAML 1.0
title: Twitter-GetStarted
version: v1
baseUri: https://956df5a2.ngrok.io/api/twitter/{version}
mediaType: application/json
description: Twitter is an online social networking and microblogging service that enables users to send and read short 140-character text messages, called "tweets." This service allows users to post a tweet to the corporate Twitter account.
/tweet:
post:
description: Updates the authenticating user's current status, also known as tweeting.
body:
application/json:
type: object
properties:
status:
type: string
description: |
The text of your status update, typically up to 140 characters. URL encode as necessary. t.co link wrapping may effect character counts. There are some special commands in this field to be aware of. For instance, preceding a message with "D " or "M " and following it with a screen name can create a direct message to that user if the relationship allows for it.
required: true
maxLength: 140
example: { "status" : "My tweet"}
responses:
200:
body:
application/json:
example: {
"coordinates": null,
"favorited": false,
"created_at": "Wed Sep 05 00:37:15 +0000 2012",
"truncated": false,
"id_str": "243145735212777472",
"entities": {
"urls": [],
"hashtags": [
{
"text": "peterfalk",
"indices": [
35,
45
]
}
],
"user_mentions": []
},
"in_reply_to_user_id_str": null,
"text": "Maybe he'll finally find his keys. #peterfalk",
"contributors": null,
"retweet_count": 0,
"id": 243145735212777470,
"in_reply_to_status_id_str": null,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"place": null,
"user": {
"name": "Jason Costa",
"profile_sidebar_border_color": "86A4A6",
"profile_sidebar_fill_color": "A0C5C7",
"profile_background_tile": false,
"profile_image_url": "http://a0.twimg.com/profile_images/1751674923/new_york_beard_normal.jpg",
"created_at": "Wed May 28 00:20:15 +0000 2008",
"location": "",
"is_translator": true,
"follow_request_sent": false,
"id_str": "14927800",
"profile_link_color": "FF3300",
"entities": {
"url": {
"urls": [
{
"expanded_url": "http://www.jason-costa.blogspot.com/",
"url": "http://t.co/YCA3ZKY",
"indices": [
0,
19
],
"display_url": "jason-costa.blogspot.com"
}
]
},
"description": {
"urls": []
}
},
"default_profile": false,
"contributors_enabled": false,
"url": "http://t.co/YCA3ZKY",
"favourites_count": 883,
"utc_offset": -28800,
"id": 14927800,
"profile_image_url_https": "https://si0.twimg.com/profile_images/1751674923/new_york_beard_normal.jpg",
"profile_use_background_image": true,
"listed_count": 150,
"profile_text_color": "333333",
"protected": false,
"lang": "en",
"followers_count": 8760,
"time_zone": "Pacific Time (US & Canada)",
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme6/bg.gif",
"verified": false,
"profile_background_color": "709397",
"notifications": false,
"description": "Platform at Twitter",
"geo_enabled": true,
"statuses_count": 5532,
"default_profile_image": false,
"friends_count": 166,
"profile_background_image_url": "http://a0.twimg.com/images/themes/theme6/bg.gif",
"show_all_inline_media": true,
"screen_name": "jasoncosta",
"following": false
},
"source": "<a href=\"http://jason-costa.blogspot.com\" rel=\"nofollow\">My Shiny App</a>",
"in_reply_to_screen_name": null,
"in_reply_to_status_id": null
}
400:
description: |
The request was invalid or cannot be otherwise served. An accompanying
error message will explain further. In API v1.1, requests withou
authentication are considered invalid and will yield this response.
401:
description: Authentication credentials were missing or incorrect.
403:
description: |
The request is understood, but it has been refused or access is no
allowed. An accompanying error message will explain why. This code is
used when requests are being denied due to update limits.
404:
description: |
The URI requested is invalid or the resource requested, such as a user,
does not exists. Also returned when the requested format is not supported
by the requested method.
406:
description: |
Returned by the Search API when an invalid format is specified in the
request.
410:
description: |
This resource is gone. Used to indicate that an API endpoint has been
turned off. For example: "The Twitter REST API v1 will soon stop
functioning. Please migrate to API v1.1."
420:
description: |
Returned by the version 1 Search and Trends APIs when you are being rate
limited.
422:
description: |
Returned when an image uploaded to POST account/update_profile_banner is
unable to be processed.
429:
description: |
Returned in API v1.1 when a request cannot be served due to the
application's rate limit having been exhausted for the resource. See Rate
Limiting in API v1.1.
500:
description: |
Something is broken. Please post to the group so the Twitter team can
investigate.
502:
description: Twitter is down or being upgraded.
503:
description: |
The Twitter servers are up, but overloaded with requests. Try again later.
504:
description: |
The Twitter servers are up, but the request couldn't be serviced due to
some failure within our stack. Try again later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment