APIs Flashcards
What is an API
Application Programming Interface. It is the messenger that takes requests and tells a system what you want to do and returns the response
What is Rest? or a Restful API
Representational State Transfer. REST determines how the API looks. It is a set of rules that developers follow when they create their API.
What are the rules of Rest
One of these rules states that you should be able to get a piece of data (called a resource) when you link to a specific URL. Each URL is called a request while the data sent back to you is called a response.
A request is made up of four things
The endpoint
The method
The headers
The data (or body)
What is a root endpoint?
The root-endpoint is the starting point of the API you’re requesting from. The root-endpoint of Github’s API is https://api.github.com while the root-endpoint Twitter’s API is https://api.twitter.com.
what is returned by API request ?
Most often ..A json object which looks: { "property1": "value1", "property2": "value2", "property3": "value3" }
What are the request methods?
GET POST PUT PATCH DELETE
What are the main http status codes
200+ means the request has succeeded.
300+ means the request is redirected to another URL
400+ means an error that originates from the client has occurred
500+ means an error that originates from the server has occurred