Introducing API Flashcards

1
Q

What is a REST API?

A

a programming interface that communicates over http while adhering to the principles of the REST architectural style

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

What are the six principles of the REST architecture style

A
Client-Server
Stateless
Cache
Uniform Interface
Layered System
Code-On-Demand (Optional)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the protocols of HTTP

A

HTTP requests/responses
HTTP verbs
HTTP status codes
HTTP headers/body

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

What are the four major componets of an API

A

Uniform Resource identifier (URI)
Http method
Header
Body

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

What is a Uniform Resource identifier (URI) or Uniform Resource Locator (URL)

A

identifes which resource the client wants to manipulate

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

What is the syntax of a URL

A

Scheme
Authority
Path
Query

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

What is a scheme in a URL

A

Specifies which HTTP protocol should be used

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

What are the two options for scheme in a url

A

http

https

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

What are the three reasons for using API

A

Automaton tasks
Data integration
Functionality

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

What is a benefit of syncrhonous API design

A

enables the app to receive data immediately

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

What is a con of synchronous design

A

Bottlenecks can occur because of waiting for data to come

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

What is a Remote Procedure Call (RPC)

A

a request-response model that enables an application to make a procedure call to another app

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

How does RPC work

A

client is usually unaware that the procedure request is being executed remotely because the request is made to a layer that hides those details. As far as the client is concerned, these procedure calls are simply actions that it wants to perform. In other words, to a client, a Remote Procedure Call is just a method with arguments and when it’s called, the method gets executed and the results get returned.

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

What is Simple Object Access Protocol (SOAP)

A

a messaging protocol for communicating between applications that may be on different platforms or built with different programming languages. It is an XML-based protocol that was developed by Microsoft.

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

What are the three characteristics of SOAP

A

independent
Extensible
Neutral

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

What is REpresentational State Transfer (REST)

A

A modern type of API

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

Name the six constraints applied to elements with the architecture

A
Client-Server
Stateless
Cache
Uniform Interface
Layered System
Code-On-Demand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Describe Client-Server of RESTFUL api

A

The client and server should be independent of each other, enabling the client to be built for multiple platforms and simplifying the server side components.

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

Describe Stateless constraint of an RESTFUL api

A

Requests from the client to the server must contain all of the information the server needs to make the request. The server cannot contain session states.

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

Describe the CACHE constraint of RESTFUL api

A

Responses from the server must state whether the response is cacheable or non-cacheable. If it is cacheable, the client can use the data from the response for later requests.

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

Describe the Layered system contraint in RESTFUl api

A

The system is made up of different hierarchical layers in which each layer provides services only to the layer above it. As a result, it consumes services from the layer below.

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

Describe Code-on-demand constraint in RESTFUl api

A

references the fact that information returned by a REST service can include executable code (e.g., javascript) or links to such code, intended to usefully extend client functionality.

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

Name the four principle of Uniform interface

A

Identification of resources
Manipulation of resources through representations:
Self-descriptive messages
Hypermedia as the engine of application state

24
Q

What is an REST APi

A

programming interface that communicates over HTTP while adhering to the principles of the REST architectural style.

25
Q

What are the conceots if the HTTP protocol

A

HTTP requests/responses
HTTP verbs
HTTP status codes
HTTP headers/body

26
Q

What is a rest api request

A

are essentially HTTP requests that follow the REST principles. These requests are a way for an application (client) to ask the server to perform a function. Since it is an API, these functions are predefined by the server and must follow the provided specification.

27
Q

What is a REST API request made up of

A

Uniform Resource Identifier (URI)
HTTP Method
Header
Body

28
Q

What is a Inform Resource Identifier (URI)

A

sometimes referred to as Uniform Resource Locator (URL), identifies which resource the client wants to manipulate.

29
Q

What are the four parts of a (URI)

A

Scheme
Authority
Path
Query

30
Q

Identify each part of a (URI)

http: //localhost8080 /v1/books/ ?q=DevNet

A

Scheme - Authority - Path - Query

31
Q

What is a scheme

A

The scheme specifies which HTTP protocol should be used. For a REST API, the two options are:

http – connection is open
https – connection is secure

32
Q

What is an authority

A

The authority, or destination, consists of two parts that are preceded with two forward slashes ( // ):

Host
Port

33
Q

What is PATH

A

For a REST API, the path is usually known as the resource path, and represents the location of the resource, the data or object, to be manipulated on the server. The path is preceded by a slash ( / ) and can consists of multiple segments that are separated by a slash ( / ).

34
Q

What is the Query

A

The query, which includes the query parameters, is optional. The query provides additional details for scope, for filtering, or to clarify a request. If the query is present, it is preceded with a question mark ( ? ). There isn’t a specific syntax for query parameters, but it is typically defined as a set of key-value pairs that are separated by an ampersand ( & ). For example:

http://example.com/update/person?id=42&email=person%40example.com

35
Q

What is an http request method

A

defines a set of request methods to indicate the desired action to be performed for a given resource

36
Q

What are all of the HTTP methods

A
POST
GET
PUT
PATCH
DELETE
37
Q

What odes the post http method do

A

Create - Create a new object or resource

38
Q

What does the GET http method do

A

READ - Retrieve resource details from the system

39
Q

What does the PUT http method do

A

Update - Replace or update an existing resource

40
Q

What does the DELETE http method do

A

DELETE - Remove a resource from the system

41
Q

What is a request header

A

include additional information that doesn’t relate to the content of the message.

42
Q

What are entity headers

A

Entity headers are additional information that describes the content of the body of the message.

43
Q

What is the body

A

contains the data pertaining to the resource that the client wants to manipulate.

44
Q

Describe 1XX status codes

A

Inforamtional - are for informational purposes, indicating that the server received the request but is not done processing it. The client should expect a full response later. These responses typically do not contain a body.

45
Q

Describe 2XX status codes

A

success- the server received and accepted the request. For synchronous APIs, these responses contain the requested data in the body if applicable. For asynchronous APIs, the responses typically do not contain a body and the 2xx status code is a confirmation that the request was received but still needs to be fulfilled.

46
Q

Describe 3XX status codes

A

redirection - the client has an additional action to take in order for the request to be completed. Most of the time a different URL needs to be used. Depending on how the REST API was invoked, the user might be automatically redirected without any manual action.

47
Q

Describe the status code 4XX

A

client error - the request contains an error, such as bad syntax or invalid input, which prevents the request from being completed. The client must take action to fix these issues before resending the request.

48
Q

Describe the status 5XX status codes

A

Server error - the server is unable to fulfill the request even though the request itself is valid. Depending on which particular 5xx status code it is, the client may want to retry the request at a later time.

49
Q

What does the status code 200 mean

A

OK - Request was successfully and typically contains a payload (body)

50
Q

What does the 201 code mean

A

Created - Request was fulfilled and the requested resource was created

51
Q

What does the status code 202 mean

A

Accepted - Request has been accepted for processing but is not complete

52
Q

What does the status code 400 mean

A

Bad request - Request will not be processed due to an error with the request

53
Q

What does the status code 403 mean

A

Forbidden - Request was understood but has been rejected by the server

54
Q

What does the status code 404 mean

A

Not found - Request cannot be fulfilled because the resource path of the request was not found on the server

55
Q

What does the status code 500 mean

A

Internal Server Error - Request cannot be fulfilled due to a server error

56
Q

What does the status code 503 mean

A

Service Unavailable - Request cannot be fulfilled because currently the server cannot handle the request