Rest Api Flashcards

1
Q

What is a Rest Api

A

A REST API is a way for two computer systems to communicate using the HTTP technologies found in web browsers and servers. Rest Api is stateless and uses Crud to handle what to do with the resources given. Crud is Create which is a post request, Read which is a get request, Update which is a put or patch request and Delete which is a delete request. Once the client sends over the request there is typically an http response code sent back, most commonly a code of 200 for successful and 500 for an error.

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

How are Rest Apis stateless

A

Stateful apps store client data on there own servers. Rest architecture requires that the clients state is not stored on the server. Each http request from the client should contain all the information that is needed for that particular http method.

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

Explain the http methods

A

Crud: Create, Read, Update, Delete. The Get method fetches a resource from the server, Post requests for a resource to be created on the server, Put requests for a resource to be updated, Delete requests for a resource to be deleted from the server.

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

Explain the Http status codes

A

Restful web services use http status codes in server responses. The most common http status codes are 200 which represent a successful request and response. The 400 codes represent a client side error. The 500 codes represent a server side error.

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

What is a Uri

A

Uri is a Uniform Resource Identifier it identifies every resource in the Rest architecture. There are 2 types, Urn which identifies a resource through a unique and persistent name and a Url which is your typical web address which is usually used when designing web apis.

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

What are best practices in making the URI for restful web services

A

Uris should be mostly standardized when developing a restful web service. Some best practices are: Develop them with the understanding that forward slashes indicate hierarchy, use plural nouns for branches, use hyphens for multiple words, use lowercase and refrain from using file extensions.

You have your domain/server url first then your resource and then the values, ids or other params.

GET /customers/{id}

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

what is the difference between soap and rest api

A

SOAP uses XML for its message format, and it’s protocol-specific, whereas REST can use JSON, XML, or other formats and is protocol agnostic (though HTTP is common).

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

Difference between authentication and authorization.

A

Authentication verifies the identity of a user, while authorization determines what actions or resources the authenticated user is allowed to access.

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

What is OAuth?

A

OAuth allows third-party services to exchange user credentials for access tokens.

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

Explain the purpose of API endpoints.

A

API endpoints refer to the specific URL where an API can be accessed to perform a specific operation. Each endpoint is associated with a particular HTTP method and a particular set of functionalities.

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

What are API rate limits, and why are they used?

A

API rate limits restrict the number of API calls a user or system can make in a specified time frame. They’re used to prevent abuse, control resource usage, and ensure fair access.

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

Why are API keys used, and how do they work?

A

API keys are unique identifiers used to authenticate the source of API calls. They’re sent along with the request, and the server uses them to identify and validate the caller.

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

What is the purpose of API documentation?

A

API documentation provides a detailed description of how to use the API, the endpoints available, request-response formats, authentication methods, and examples. It’s essential for developers who want to integrate or work with the API.

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