Grokking the System Design Interview, Volume II
0% completed
Unique ID Generator: API Design
Step 4: API Specifications
Step 3 showed that making an ID costs almost nothing. So what a client really pays is the call itself.
That makes the shape of this API matter more than anything inside the service. It decides how often clients have to call at all.
We expose one endpoint.
1. Generate IDs
POST /v1/ids- Headers:
Authorization: Bearer <token> - Request Body:
{ "type": "sortable", // or "opaque" "count": 1 // up to 1000 }
- Response:
200 OK. The call creates no addressable resource, so there is nothing for a `201 Created
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%