APIs Flashcards

1
Q

What is an API

A

Application Programming Interface. It is the messenger that takes requests and tells a system what you want to do and returns the response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Rest? or a Restful API

A

Representational State Transfer. REST determines how the API looks. It is a set of rules that developers follow when they create their API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the rules of Rest

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A request is made up of four things

A

The endpoint
The method
The headers
The data (or body)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a root endpoint?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is returned by API request ?

A
Most often ..A json object which looks:
{
  "property1": "value1",
  "property2": "value2",
  "property3": "value3"
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the request methods?

A
GET
POST
PUT
PATCH
DELETE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the main http status codes

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly