APIs Flashcards

1
Q

400 Cause

A

Bad request - invalid request syntax, missing params, incorrect data format

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

400 Resolution

A

Check params, check body of data sent (Content-Type)

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

401 Cause

A

Unauthorized: Missing or invalid auth credentials

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

401 Resolution

A

Check API Token (renew token?), service account key, verify auth method (Bearer token, basic auth)

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

403 Cause

A

Forbidden: User or app doesn’t have permission to access requested resource

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

403 Resolution

A

Confirm API key has necessary permissions, check for RBAC issues, Verify your IP address is whitelisted

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

404 Cause

A

Not Found: Requested resource or endpoint doesn’t exist

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

404 Resolution

A

check URL endpoint and port, ensure correct environment, confirm path exists

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

405 Cause

A

Method Not Allowed: HTTP method is not allowed for the endpoint

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

405 Resolution

A

Check the method being sent to endpoint. Is URL allowed by CORS?

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

408 Cause

A

Request Timeout: Server took too long to process the request

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

408 Resolution

A

Optimize request payload, check server’s performance, increase timeout value

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

429 Cause

A

Too Many Requests: API rate limit has been exceeded

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

429 Resolution

A

Implement rate-limiting logic, get higher limit

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

500 Cause

A

Internal Server Error: server-side error

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

500 Resolution

A

Port occupied, backend api or db req sent back an error, check logs of server

17
Q

502 Cause

A

Bad Gateway: server acting as a gateway received invalid response from upstream server

18
Q

502 Resolution

A

Check queries, API reqs

19
Q

503 Cause

A

Service Unavailable: Server is overloaded or undergoing maintenance

20
Q

504 Cause

A

Gateway Timeout: Upstream server did not respond in time

21
Q

CORS Error

A

Cross-Origin Resource Sharing: Browser blocked request due to mismatch in server’s CORS policy.

22
Q

CORS Resolution

A

Add client’s URL to server’s allowedOrigins list
Verify Access-Control-Allow-Origin header on the server

23
Q

JSON Parsing Error Cause

A

Invalid JSON response or request payload

24
Q

JSON Parsing Error Resolution

A

Make sure valid JSON is being sent as payload and as response