Knowledge check
PhotoRobot API V2 Fundamentals
12 questions in pool · live exam draws 5
I01
Q1 multiple-choice · auth-header In PhotoRobot API V2, how is the API key passed to authenticate a request?
Source: I01 textbook §2 (Authentication).
Explanation: V2 requires the API key in Authorization: Bearer <api-key> header. V1 supported query-string ?api_key=... but that’s deprecated in V2 — never put credentials in URLs (they leak into server logs, browser history, referer headers). Cookie + body-field auth are not used by PhotoRobot.
Q2 multiple-choice · response-wrapper A V2 list endpoint returns items where exactly in the response?
Source: I01 textbook §3 (Response shape).
Explanation: V2 wraps responses in a { "data": [...], "meta": {...}, "links": {...} } envelope. The actual payload is in data. V1 returned items at the root; this is one of the most common migration footguns when moving V1 → V2.
Q3 scenario · v1-v2-migration · weight 2 You’re maintaining a V1 integration that parses item objects directly from the JSON root (response.id, response.name, etc.). You migrate to V2 and your integration silently breaks — no parse errors, no exceptions, just empty results.
Source: I01 textbook §4 (V1 → V2 migration).
Explanation: The data wrapper is one of the named V2 migration footguns. Integrations that silently look at the wrong path get empty results without explicit errors. Fix: update all parsers to expect data envelope. Migration tip from §4: do this before migrating the call code — keeps error handling consistent.
Q4 multiple-choice · rate-limit-header PhotoRobot’s API returns a 429 status code. Which header tells you how long to wait before retrying?
Source: I01 textbook §5 (Rate limits + backoff).
Explanation: Retry-After is the canonical HTTP header (per RFC) for “wait N seconds before retrying”. PhotoRobot uses it on 429 responses. X-RateLimit-Reset is also present but is the timestamp when the window resets, not the recommended pause. Production integrations should honor Retry-After and combine it with exponential backoff for resilience.
Q5 multiple-choice · backoff-jitter Why is jitter important in exponential backoff for API retries?
Source: I01 textbook §5 (Rate limits + backoff — jitter).
Explanation: When many client integrations all back off after a 429 with exactly Retry-After + base_delay, they all retry at the same moment and immediately re-trigger rate limits. Random jitter (e.g., adding Math.random() * 1000 ms) spreads the retry herd across a wider window so the recovery window is not slammed.
Q6 scenario · monitoring-contract · weight 2 Your team built a PhotoRobot integration 8 months ago, deployed it, and moved on. Today, a customer complains their items aren’t reaching the DAM. You check the integration’s logs and discover it has been silently failing for 6 weeks — every webhook returns 500 from the DAM and PhotoRobot has been retrying (and failing) ever since.
Source: I01 textbook §8 (Production deployment patterns — monitoring contract) + B26 §10 (failure pattern).
Explanation: Both B26 and I01 emphasize: every integration needs a monitoring contract . Without one, integrations rot silently — they ship working, customer-side data drifts or downstream APIs change, and no one notices until customer pain reaches escalation. The structural fix is process: monitoring contract signed (named owner, alert thresholds, SLA) BEFORE production deploy. Never optional.
Q7 multiple-choice · request-id-logging Why is logging the request_id from V2 error responses important?
Source: I01 textbook §3 (Error shape) + §9 (Common pitfalls).
Explanation: When you escalate “this call failed with error X” to PhotoRobot support, the request_id is the single most valuable piece of information. It tells support exactly which call in their server logs to look at — without it, they have to guess based on timestamp + endpoint + customer, which is much slower. Always log it.
Q8 scenario · polling-vs-webhook · weight 2 Your integration polls GET /api/v2/items?modified_since=<timestamp> every 30 seconds to detect new or changed items. The integration works but consumes a large fraction of the customer’s rate-limit quota.
Source: I01 textbook §5 (Rate limits — webhook over polling) + I02 (forthcoming, but referenced).
Explanation: Polling to detect change is an anti-pattern when the API offers webhooks. Webhooks push events to your endpoint when something changes — zero overhead between events, near-real-time response, no rate-limit consumption. Polling is appropriate only when no webhook exists for the event you care about. I02 (Webhook Architecture, forthcoming) covers the full subscription + handling discipline.
Q9 multiple-choice · api-key-storage Where should a PhotoRobot API key be stored?
Source: I01 textbook §2 (Authentication — security rules).
Explanation: API keys never go in source code (visible in git history), client-side JavaScript (visible to anyone with browser dev tools), or config files (often committed to repo). They go in a server-side secrets vault, accessed at runtime. Compromised keys must be rotatable without code change — secret vault makes that easy, hardcoded values make it impossible.
Q10 scenario · phased-rollout · weight 2 You finished building a PhotoRobot integration for a customer with 200 PhotoRobot studios. QA passed all tests in staging.
Source: I01 textbook §8 (Production deployment patterns — phased rollout).
Explanation: Phased rollout (pilot → cohort → GA) catches integration issues at low volume where they cost a small number of items, before they affect 200 studios with thousands of items. Big-bang deploys catch issues when they’re catastrophic. The 50/50 split is closer to right but still too risky — you want progressive exposure with measurable pauses between phases.
Q11 true-false · data-wrapper-presence PhotoRobot API V2 returns single-resource responses without a data wrapper — only list endpoints wrap.
Source: I01 textbook §3 (Response shape — single-resource endpoints).
Explanation: Both list AND single-resource endpoints wrap responses under data. List endpoints return { "data": [...], "meta": {}, "links": {} }; single-resource endpoints return { "data": { ... } }. Consistent wrapping simplifies client parsers — one envelope shape for everything.
Q12 multiple-choice · contract-tests What’s the purpose of running contract tests against the PhotoRobot OpenAPI spec in your CI pipeline?
Source: I01 textbook §7 (Integration testing — mock server / contract tests).
Explanation: Contract tests load the PhotoRobot OpenAPI spec into a mock server and verify your integration’s request/response handling matches the spec. When PhotoRobot updates the spec (deprecating a field, adding a required parameter), CI fails immediately — you fix the integration before it deploys to production. Without contract tests, you discover the change weeks later when a customer reports broken behavior.
Ready to commit? You can review and change your answers before submitting. Once submitted, this attempt is final and we'll show you your score, correct answers, and explanations.
Submit final answers