Advanced REST API Topics Module #71 Flashcards

1
Q

What is a very important task that needs to be completed before releasing it?

A

It should be load tested.

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

What is the best way to load test an API?

A

Create a staging replicate of the production environment.

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

By what method can we determine who is using our API, limit access to special features etc.

A

Authentication.

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

How do API keys work?

A

It is a string of characters that uniquely identifies you as as a user of the API . The key is passed through every call and the the API will return the data requested.

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

How is abuse of the API and pricing tiers enforced with an API?

A

Through limiting of X requests per hour.

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

Suppose there’s a vast amount of data behind your API, and a request is made for a substantial amount of it, how is the data returned?

A

All of the data cannot be returned at once so, therefore we returned it by using a technique called pagination.

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

Once you have a group of users using your API, is it fairly straight forward to make some basic changes to the API.

A

No, because once users are reliant on a particular way something works, it is difficult to change because the downstream effect is their apps or websites will become broken.

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

What is the basic concept behind pagination?

A

Data is broken down into chunks by the programmer who designs the API. Those chunks are arbitrary and the code uses offsets and limiters such as in these examples:

/posts returns the first 100 items /posts?offset=1 returns the items from 101 to 200 /posts?offset=2 returns the items from 201 to 300

/posts?limit=10 returns the first 10 items /posts?limit=10offset=1 returns the items from 11 to 20

The parameter names of course are a convention and you can use the ones you prefer.

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

If you evolve your API over time making improvements, how can you handle that to avoid breaking client implementations?

A

By using versioning. You can continue to provide version x and then when you come out with a new release it can be a different version.

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

Which number do APIs start at?

A

Version #1

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

Is backward compatibility even important?

A

Yes, if you want to keep your users happy.

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

How can you provide a quick and explicit way to let your users know which version of your API they’re consuming?

A

By implementing the number right in the URL connection string.

Alternatively you can use a different subdomain for separate versions

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