A short story of what, why and how
Image Credit: cloud-elements.com
In networking context,
Web Service is also used
Image Credit: Maxim Basinski
Communication can be
{
Image Credit: moz.com
This can be implemented in any language
Image Credit: learnx
https://api.twitter.com/1.1/users/suggestions.json?id=foo&name=bar
Protocol
URI
Route
^
Version
Query String
[
{
"name": "Art & Design",
"slug": "art-design",
"size": 20
},
{
"name": "Billboard Music Awards",
"slug": "billboard-music-awards",
"size": 20
},
{
"name": "Books",
"slug": "books",
"size": 20
},
{
"name": "Business",
"slug": "business",
"size": 20
},
{
"name": "CMT Awards",
"slug": "cmt-awards",
"size": 20
},
{
"name": "Charity",
"slug": "charity",
"size": 20
},
{
"name": "Entertainment",
"slug": "entertainment",
"size": 20
},
{
"name": "Faith and Religion",
"slug": "faith-and-religion",
"size": 20
},
{
"name": "Family",
"slug": "family",
"size": 20
},
{
"name": "Fashion",
"slug": "fashion",
"size": 20
},
{
"name": "Food & Drink",
"slug": "food-drink",
"size": 20
},
{
"name": "Funny",
"slug": "funny",
"size": 20
},
{
"name": "Government",
"slug": "government",
"size": 20
},
{
"name": "Health",
"slug": "health",
"size": 20
},
{
"name": "MLB",
"slug": "mlb",
"size": 20
},
{
"name": "MTV Movie Awards",
"slug": "mtv-movie-awards",
"size": 20
},
{
"name": "Music",
"slug": "music",
"size": 20
},
{
"name": "NASCAR",
"slug": "nascar",
"size": 20
},
{
"name": "NBA",
"slug": "nba",
"size": 20
},
{
"name": "NHL",
"slug": "nhl",
"size": 20
},
{
"name": "News",
"slug": "news",
"size": 20
},
{
"name": "PGA",
"slug": "pga",
"size": 20
},
{
"name": "Science",
"slug": "science",
"size": 20
},
{
"name": "Sports",
"slug": "sports",
"size": 20
},
{
"name": "Staff Picks",
"slug": "staff-picks",
"size": 20
},
{
"name": "Technology",
"slug": "technology",
"size": 20
},
{
"name": "Television",
"slug": "television",
"size": 20
},
{
"name": "Travel",
"slug": "travel",
"size": 20
},
{
"name": "Twitter",
"slug": "twitter",
"size": 20
},
{
"name": "US Election 2012",
"slug": "us-election-2012",
"size": 20
}
]
Body
There are standards for HTTP Methods, but it's up to the API author to implement them correctly
Documentation varies widely between API authors, but there are several things you can expect to find
In production, you'll make HTTP requests from your application
However, for testing or learning purposes, you can make and send them directly!
ProTip: Don't forget about the OPTIONS method when learning a new API!