2.0 Understanding and Using APIs Flashcards

1
Q

T/F - HTTP is a stateless (connectionless) protocol.

A

True

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

T/F - The data is exchanged via HTTP requests and HTTP responses, which are specialized data formats used for HTTP communication. A sequence of requests and responses is called an HTTP session and is initiated by a client by establishing a connection to the server.

A

True

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

T/F - Web APIs are a subset of APIs, accessible over HTTP

A

True

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

What do you call HTTP verbs (or nouns) that are a predefined set of request methods that represent desired actions that should be performed on the resources? They are used in HTTP requests as a part of the request line.

A

HTTP Methods

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

HTTP Method - Requests a representation of a specific resource. Should only retrieve data and is considered safe and idempotent.

A

GET

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

HTTP Method - Used to submit an entity to the specified resource, often causing a state change or side effects on the server. Requests made with this verb should include a request body.

A

POST

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

HTTP Method - Deletes the specified resource. Subsequent calls should not cause any side effects.

A

DELETE

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

HTTP Method - Replaces all current representations of the target resource with the request payload.

A

PUT

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

Asks for a response identical to that of a GET request, but without the response body. Useful for validating resource availability.

A

HEAD

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

Applies partial modification to a resource. Useful for instances where using PUT might be too cumbersome. It is not an idempotent method and is used for merging resources.

A

PATCH

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

What is a predefined set of numerical codes that indicate the status of a specific HTTP request in the response header.

A

HTTP Status Code

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

What are the 5 classes (categories) of HTTP status codes by functionality?

A

1xx Informational, 2xx Successful, 3xx Redirection, 4xx Client Error, 5xx Server Error.

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

Most HTTP Status codes from this category indicate that the request was received and understood. They usually mean that the request processing continues and alerts the client to wait for the final response. Rarely used.

A

1xx Informational

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

HTTP Status Code for a standard response for a successful HTTP request. The information returned depends on the request method.

A

200 (OK)

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

HTTP Status Code that indicates that a resource has been successfully created.

A

201 (Created)

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

HTTP Status Code that the server has successfully fulfilled the request and the response body is empty. Useful when you want to confirm that a POST request was received by the server.

A

204 (No content)

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

HTTP Status Code that this an all future requests should be directed to the given URI.

A

301 (Moved Permanently)

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

HTTP Status Code that the requested resource resides temporarily under a different URI.

A

302 (Found)

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

HTTP Status Code that indicates that the resource has not been modified since the version specified by the request headers. Useful for reducing overhead.

A

304 (Not Modified)

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

HTTP Status Code that the server cannot process the request because of a malformed request (bad syntax, deceptive routing, size too large)

A

400 (Bad Request)

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

HTTP Status Code the request requires a valid authorized user. It usually means that the user is not authenticated or that authentication failed.

A

401 (Unauthorized)

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

HTTP Status Code The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.

A

403 (Forbidden)

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

HTTP Status Code that the server has not found anything matching the request URI. No indication is given whether the condition is temporary or permanent.

A

404 (Not Found)

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

HTTP Status Code which is a generic error message, given when an unexpected condition was encountered and no more specific message is suitable.

A

500 (Internal Server Error)

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

HTTP Status Code that the server does not support the functionality required to fufill the request.

A

501 (Not Implemented)

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

HTTP Status Code that the service cannot handle the request. It is usually a temporary condition attributed to a server crash, maintenance, overload, and so on.

A

503 (Service Unavailable)

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

What is a list of key-value pairs that the client and server use to pass additional information or metadata between them in requests? They consist of a case-insensitive name, followed by a colon (“:”) and then its value.

A

HTTP Headers

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

What are the four distinct types of HTTP headers?

A

General, Request, Response, and Entity

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

HTTP Header - This type is not specific to any particualar kind of message. They are primarly used to communicate information about the message itself and how to process it.

A

General

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

HTTP Header - This type carries information about the resource to be fetched. They also contain information about the client.

A

Request

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

HTTP Header - This type of header hold additional information about the response and the server providing it.

A

Response

32
Q

HTTP Header - These type of headers contain information about the response body.

A

Entity

33
Q

What does a HTTP Request use to identify and locate the resources targeted by the request?

A

HTTP URL

34
Q

In relation to a HTTP URL, what is the term that identifies a resource ../people/alice

A

URI

35
Q

In relation to an HTTP URL, what is the term that identifies a resource using a (made-up) scheme urn:people:names:alice

A

URN

36
Q

In HTTP, what is the process of selecting the best representation for a given response when there are multiple representations available.

A

HTTP Content Negotiation

37
Q

What HTTP Header takes care of content negotiation?

A

Accept

38
Q

What is the scale of the quality-factor weighting of Accept HTTP headers?

A

0 to 1

39
Q

RPC

A

Remote Procedure Call

40
Q

SOAP

A

Simple Object Access Protocol

41
Q

What protocol provides mechanisms to install, manipulate, and delete configurations on network devices. It also provides a mechanism for notification subscriptions and asynchronous message delivery.

A

NETCONF

42
Q

NETCONF

A

Network Configuration Protocol

43
Q

T/F - NETCONF is a session based protocol

A

True

44
Q

What does NETCONF use for encapsulation?

A

XML

45
Q

Which API style is optimized for the web, known for its excellent performance scalability, and has a greater simplicity than other styles?

A

REST

46
Q

T/F - A RESTful API needs to be stateless, no client context needs to be stored on the server in between requests.

A

True

47
Q

T/F - A RESTful API needs to be built using Client/Server architecture.

A

True

48
Q

T/F - A RESTful API needs to be a layered system, a client should not be able to know if it is connected to an end point or an intermediary agent (proxy, caching server, etc)

A

True

49
Q

T/F A RESTful API needs a uniform interface to decouple the client from the implementation of the REST service.

A

True

50
Q

CRUD

A

Create, Read, Update, Delete

51
Q

What Python library is used to create a simple HTTP GET request to a member resource on a RESTful API?

A

requests

52
Q

T/F - The best API to use is based on the problem you are trying to solve and the resources you have available.

A

True

53
Q

T/F - Scalability, performance and flexibility are advantages of a REST API

A

True

54
Q

T/F - High Security and Standardization are advantages of a SOAP API

A

True

55
Q

T/F - Less secure and not suitable for distributed environments are disadvantages of a REST API

A

True

56
Q

T/F - Increased complexity and poorer performance are disadvantages of a SOAP API

A

True

57
Q

What message format is used with a SOAP API?

A

XML

58
Q

What transfer protocol is used with a REST API?

A

HTTP

59
Q

What are tools that allow you to react to events and changes in an application. They are commonly referred to as a “reverse API” or a “web callback”.

A

Webhooks

60
Q

What HTTP method is used to update a webhook endpoint?

A

POST

61
Q

How are webhook notifications transported to subscribers?

A

HTTP POST requests

62
Q

What is the biggest benefit of webhooks compared with regular REST API?

A

Webhooks provide real-time data

63
Q

T/F - REST does not use a fixed response format

A

True

64
Q

What is the purpose of content negotiation?

A

to select the best available representation for a given resource

65
Q

T/F - In the case of Cisco, pagination is a part of the Cisco Web API standards and is implemented with RFC 5988

A

True

66
Q

What effectively limits the number of specific requests that can be fulfilled by an API?

A

rate limiting

67
Q

Is it better to implement rate limiting on the client side or server side?

A

Server Side - prevents DOS, prevent misuse of sensitive or destructive API calls.

68
Q

What is the difference between rate limiting and payload limiting?

A

With rate limiting, you limit the rate of API calls toward the API, while with payload limiting, you limit the size of the API request bodies.

69
Q

What is the act of proving the identity of someone?

A

Authentication

70
Q

What specifies the rights and privileges that a specific entity has over resources.

A

Authorization

71
Q

What are the three general approaches to REST API authentication?

A

Basic HTTP Authentication, API Key Authentication, and Custom Token Authentication

72
Q

What authentication method uses a unique, pregenerated, cryptographically strong string as authentication?

A

API Key Authentication

73
Q

How frequently is a new token issued in custom token authentication?

A

When the old one expires

74
Q

What does the term “hardcoding” mean, in relation to security in your code?

A

Including data directly in the source code

75
Q

What type of API communication is where the client requests, and waits for reply?

A

Synchronous

76
Q

What type of API communication is where the client requests, then the reply comes later?

A

Asynchronous