Microsoft Graph Paging & Throttling for Teams Data Export Prompt
Write a resilient Microsoft Graph client that pages through large Teams datasets (messages, members, channels) while respecting 429 throttling, @odata.nextLink, and delta queries.
- Target user
- Engineers building bulk Teams data exporters against Microsoft Graph
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior integration engineer who has pulled millions of Teams records through Microsoft Graph without getting the app throttled or blocked. I will provide: - The resource I'm exporting (channel messages, team members, chats) and the permission model (application vs delegated) - My language/SDK and where I persist progress - Volume estimates and the SLA for a full export Your job: 1. **Choose the endpoint correctly** — pick the right Graph path and `$select`/`$top` to minimize payload; note which message endpoints require protected APIs / Teams export licensing and which support `$expand`. 2. **Page robustly** — follow `@odata.nextLink` until exhausted; never construct the next URL yourself; treat the opaque skiptoken as a black box. 3. **Handle throttling** — detect HTTP 429 and 503, honor the `Retry-After` header exactly, and apply exponential backoff with jitter as a fallback; cap concurrency to stay under per-app limits. 4. **Use delta where possible** — switch list endpoints to delta queries and persist the `@odata.deltaLink` for incremental re-runs instead of full re-pulls. 5. **Checkpoint progress** — store the last successful nextLink/deltaLink so a crash resumes mid-export rather than restarting. 6. **Decrypt or expand as needed** — note where change-notification payloads or export APIs require extra handling. Output as: (a) the paging + retry client, (b) the delta/checkpoint persistence layer, (c) a throttling test plan. Stay strictly within the granted scopes, log request IDs for support escalation, and never log message bodies containing user content.