course-sandbox — the Session 1 practice API =========================================== Reference: /docs (OpenAPI — every parameter, every response) 1. Endpoints GET /v1/me who you are, and what is left of your budget GET /v1/me/stats what your client has done, per endpoint and status GET /v1/orders the shop's orders; filter with since, until, status GET /v1/customers/{id} one customer, with their current segment GET /v1/events an activity feed, newest first GET /v1/fx/{day} EUR reference rates for one day, YYYY-MM-DD 2. Authentication Every /v1 call needs two headers: Authorization: Bearer X-Student: a-z, 0-9 and _, starting with a letter Missing or wrong key: 401. Missing or malformed name: 400. Your name keeps your rate limit, your feed and your stats apart from the rest of the class. Pick one and keep it. 3. Pagination limit is 1..500 (default: 100 for orders, 50 for events). /v1/orders cursor only. Pass next_cursor back as ?cursor=; null on the last page. since is inclusive and until exclusive, both YYYY-MM-DD. /v1/events ?offset= or ?cursor=, not both. The feed is busy: three new events arrive between any two of your calls. 4. Rate limit 60 requests per minute, per student. Each student's minute starts at its own second. Every metered response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix time: when yours resets). Over the limit: 429, with Retry-After in seconds. /v1/me and /v1/me/stats are free. Reference rates are published on weekdays only. They come from an upstream that is not always available, and not always fast.