VL api ?s

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/188

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:51 PM on 5/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

189 Terms

1
New cards
What is an API?
An API is an interface that lets two pieces of software communicate
2
New cards
What is the client in an API interaction?
The client is the system making the request
3
New cards
What is the server in an API interaction?
The server receives requests
4
New cards
What is an endpoint?
An endpoint is a specific URL and HTTP method combination
5
New cards
What is a resource in REST API design?
A resource is the main object being acted on
6
New cards
How should REST endpoints usually be named?
Use nouns instead of verbs
7
New cards
Why use plural nouns in REST endpoints?
Plural nouns like /units or /test-results represent collections of resources and are a common REST convention.
8
New cards
What is a good endpoint for getting one unit by serial number?
GET /units/{serial_number}
9
New cards
What is a good endpoint for creating a unit?
POST /units
10
New cards
What is a good endpoint for updating a unit's status?
PATCH /units/{serial_number}/status
11
New cards
What is a good endpoint for getting a unit's history?
GET /units/{serial_number}/history
12
New cards
What is a good endpoint for uploading test results?
POST /test-results
13
New cards
What is a good endpoint for dashboard summary data?
GET /dashboard/summary
14
New cards
What is the difference between /units and /units/{id}?
/units usually refers to the collection of units; /units/{id} refers to one specific unit.
15
New cards
What is the difference between a collection endpoint and an item endpoint?
A collection endpoint works with many resources
16
New cards
What is a nested route?
A route that shows a relationship between resources
17
New cards
When should you use a nested route?
Use a nested route when the child resource clearly belongs to the parent
18
New cards
When should you avoid deeply nested routes?
Avoid routes like /factories/1/lines/2/stations/3/units/4/results because they become hard to maintain and use.
19
New cards
What is the difference between query parameters and request body?
Query parameters usually filter or modify retrieval; request body usually contains data to create or update.
20
New cards
When should filters go in query parameters?
Use query parameters for filtering lists
21
New cards
When should data go in the request body?
Use request body for creating or updating resources
22
New cards
What is filtering in an API?
Filtering lets clients request only matching records
23
New cards
What is sorting in an API?
Sorting lets clients choose result order
24
New cards
What is pagination in an API?
Pagination splits large result sets into smaller pages
25
New cards
Why is pagination important?
It prevents huge responses
26
New cards
What is offset-based pagination?
Pagination using page/limit or offset/limit
27
New cards
What is cursor-based pagination?
Pagination using a cursor token pointing to the next set of results; better for large or frequently changing datasets.
28
New cards
When is offset pagination okay?
It is okay for small or moderate datasets where records are not changing too rapidly.
29
New cards
When is cursor pagination better?
It is better for large datasets
30
New cards
What should a paginated response include?
It should include data plus metadata like page
31
New cards
What is a typical paginated response shape?
{ "data": [...]
32
New cards
What is response shape consistency?
APIs should return responses in predictable formats so clients can handle them easily.
33
New cards
Why is consistent response format important?
It makes frontend and integration code simpler
34
New cards
What is a good success response for creating a resource?
Return 201 Created and the created resource or its ID.
35
New cards
What should POST /units return after creating a unit?
It should return 201 Created with the new unit data
36
New cards
What should PATCH /units/{serial}/status return?
It should return 200 OK with the updated unit or status transition result.
37
New cards
What should DELETE usually return?
It can return 204 No Content if deletion succeeded and no body is needed.
38
New cards
What does HTTP 204 mean?
The request succeeded but there is no response body.
39
New cards
What does HTTP 422 mean?
Unprocessable Entity; the request format is valid but semantic validation failed
40
New cards
What does HTTP 429 mean?
Too Many Requests; the client exceeded a rate limit.
41
New cards
What does HTTP 503 mean?
Service Unavailable; the server or dependency is temporarily unavailable.
42
New cards
When would you use 400 vs 422?
Use 400 for malformed/missing input; use 422 for well-formed input that fails business validation.
43
New cards
When would you use 409 Conflict?
Use 409 when the request conflicts with current state
44
New cards
What is a good error response shape?
{ "error": { "code": "INVALID_STATUS"
45
New cards
Why include machine-readable error codes?
They let clients handle errors programmatically instead of parsing human text.
46
New cards
Why avoid exposing stack traces in API responses?
Stack traces can leak implementation details and security-sensitive information.
47
New cards
What should be logged for API errors?
Request ID
48
New cards
What is a request ID?
A unique identifier assigned to a request so logs can be traced across services.
49
New cards
Why are request IDs useful?
They make debugging easier by connecting logs from the same request.
50
New cards
What is authentication?
Authentication verifies identity
51
New cards
What is authorization?
Authorization checks what an authenticated user or service is allowed to do.
52
New cards
What is the difference between 401 and 403?
401 means not authenticated; 403 means authenticated but not allowed.
53
New cards
What is an API key?
A secret token used by a service or client to authenticate API requests.
54
New cards
When might a test station use an API key?
A manufacturing test station might use an API key or device token to upload test results securely.
55
New cards
What is a bearer token?
A token sent in the Authorization header
56
New cards
What is JWT?
A JSON Web Token is a signed token that can carry identity/claims for authentication or authorization.
57
New cards
What is session-based authentication?
The server stores login state in a session and the browser sends a session cookie with requests.
58
New cards
What is token-based authentication?
The client sends a token
59
New cards
What is role-based access control?
Permissions are based on roles such as operator
60
New cards
What roles might exist in a manufacturing internal tool?
Operator
61
New cards
Why use separate service accounts for integrations?
They allow least-privilege permissions and easier auditing for machine-to-machine API calls.
62
New cards
What is least privilege in API design?
Give each user or service only the minimum permissions needed.
63
New cards
What is input validation?
Checking that request data has required fields
64
New cards
What fields should be validated when uploading test results?
serial_number
65
New cards
What is business rule validation?
Validation based on workflow rules
66
New cards
What is schema validation?
Checking that JSON/request data matches the expected structure and data types.
67
New cards
What is a required field?
A field that must be present for the API to process the request
68
New cards
What is type validation?
Checking that fields have the correct type
69
New cards
What is range validation?
Checking numeric values are within acceptable limits
70
New cards
What is enum validation?
Checking a value belongs to a fixed set
71
New cards
Why validate on backend even if frontend validates?
Frontend validation improves UX
72
New cards
What is idempotency in API design?
A retry-safe design where repeated identical requests do not create duplicate side effects.
73
New cards
Which HTTP methods are usually idempotent?
GET
74
New cards
Is GET idempotent?
Yes. Repeating a GET should not change server state.
75
New cards
Is POST idempotent by default?
No. Repeating POST /test-results could create duplicates unless you design idempotency.
76
New cards
Is PATCH idempotent?
It depends on the operation. Setting status to testing can be idempotent; incrementing a counter is not.
77
New cards
What is an idempotency key?
A unique client-provided key that lets the server recognize retries of the same operation.
78
New cards
Where can an idempotency key be sent?
In a request header like Idempotency-Key or in the request body.
79
New cards
How would idempotency work for test uploads?
The server stores the idempotency_key with the result. If the same key arrives again
80
New cards
What is an upsert?
An operation that inserts a row if it does not exist or updates it if it does.
81
New cards
When might you use upsert in integrations?
When syncing records from another system where the same record may be processed more than once.
82
New cards
What is a retry?
Trying a failed request again
83
New cards
When is retrying safe?
Retrying is safe when the operation is idempotent or protected by an idempotency key.
84
New cards
When is retrying dangerous?
Retrying non-idempotent operations can create duplicates or repeated side effects.
85
New cards
What is exponential backoff?
A retry strategy that waits longer after each failure
86
New cards
What is a timeout?
A maximum wait time before giving up on a slow request.
87
New cards
Why are timeouts important?
They prevent clients or servers from hanging forever when a dependency is slow or unavailable.
88
New cards
What is a circuit breaker?
A reliability pattern that temporarily stops calling a failing service to prevent cascading failures.
89
New cards
What is a dependency in API design?
Another service/database/API that your endpoint relies on.
90
New cards
What is graceful degradation?
Continuing to provide partial functionality when one dependency fails.
91
New cards
How could a dashboard degrade gracefully?
Show last known data with a stale warning if live refresh fails.
92
New cards
What is API latency?
The time between a client sending a request and receiving a response.
93
New cards
What is API throughput?
The number of requests an API can handle per unit time.
94
New cards
What is payload size?
The amount of data sent in a request or response.
95
New cards
Why reduce payload size?
Large payloads increase latency
96
New cards
How can you reduce API response payload size?
Return only needed fields
97
New cards
What is field selection?
Allowing clients to request specific fields
98
New cards
What is overfetching?
Returning more data than the client needs.
99
New cards
What is underfetching?
Returning too little data so the client must make many extra requests.
100
New cards
What is N+1 API problem?
A client makes one request for a list and then one request per item for details