Skip to content
CogniSkill

LESSON 1 OF 4

An endpoint contract comes before a module command

Practice notesBooks for further learning

Your practical task

Build a paginated Graph-style report that detects loops and keeps a failed collection separate from a complete empty result.

You need a user inventory, not permission to change accounts. First shape a supplied sample object locally; then design the optional Graph access. The core exercise requires no tenant and stores no tokens.

How the system works

An API page is not the whole dataset. A next-link indicates more data, and its full URL is part of the service’s paging contract. Treating the first page as complete can produce a convincing but incomplete access or inventory report. In this offline lab the page URLs are keys in a fixture, so you can practise traversal without a tenant or access token.

Pagination also needs a termination rule. If a next-link repeats, a naïve loop can run forever. The HashSet records visited page keys and stops when a key appears twice. That is a collection failure, not permission to return whatever happened to be collected before the loop. Production code should preserve a partial result only when the report explicitly marks it incomplete.

Read-only permissions still need least privilege and approved use. The permission required depends on the endpoint, delegated or application context, and the properties you request. A working sample is not proof that broad directory permissions are necessary. For a live extension, select the exact documented endpoint, review its permission table and token context, and avoid placing tokens in logs or exported CSV files.

An endpoint contract comes before a module command

For a Microsoft Graph request, identify resource path, operation, access mode, required permission and expected response shape. Installing the SDK does not grant authorization. Delegated and application access are different contexts; a user sign-in in a browser is not evidence for an unattended collector.

This course's fixture simulates Graph-shaped pages. It deliberately avoids tenant access, credentials and consent. Use it to learn control flow and failure handling before adapting a collector to a documented endpoint. Record collection scope so a later report does not treat a filtered result as an organization-wide inventory.

Reasoning model

An API report is complete only when every required page has been retrieved successfully under a known filter and permission scope. A successful first response is not a complete inventory. Follow the service-provided continuation mechanism rather than reconstructing offsets. A retry loop needs bounds and must distinguish transient throttling from persistent authorization failure. Record completion state so a partial report cannot masquerade as an empty or final inventory.

Official reference for further study

COGNISKILL BOOKS

Go deeper with a related book

This short course practises a focused skill. Related CogniSkill books offer an optional longer learning and preparation path; this course does not claim full exam coverage.

Sign in to save lesson completion. Reading position is separate from completion.

Practice notes — your working space

Save predictions, outputs and explanations as you work. Notes stay on this browser, not your account; people sharing this browser can access them. Avoid passwords and sensitive data. Export to keep a portable copy, or clear your notes before leaving a shared device.

How was this lesson?

Help us improve this lesson.