What you’ll build
A console app that authenticates with an API key, lists the first page of items in a tenant, and prints their keys. Five minutes start to finish.1. New project
2. Provision an API key
If you don’t already have one, mint one via the CLI:rawKey field — capture the value (ek_live_...) once. The backend never returns it again. Set it on your shell:
3. Write the program
ReplaceProgram.cs:
4. Run
What just happened
EksoClientwas constructed againsthttps://acme.ekso.appwith bearer-token auth.client.Api.Field.GetAsync()issued aGET /api/fieldand deserialized the response into a typedFieldCollection.client.Api.Item.List.PostAsync(...)issued aPOST /api/item/listwith anItemListRequestbody and deserialized into a typedItemListResponse.- The
EksoAuthExceptionandEksoApiExceptioncatches surface specific failure shapes — see Error handling for the full hierarchy.
Next ideas
Now that you have a working client, try:client.Api.* — maps 1-to-1 to the operations in the API Reference. Auto-completion in your IDE is the fastest discovery path.
Production hardening
- Don’t hard-code keys. Read from a secrets manager, not from environment variables on a developer’s laptop.
- Catch the right exceptions.
EksoRateLimitException.RetryAftertells you exactly how long to back off;EksoNetworkExceptionis the only one you should reflexively retry without thought. - Set a sensible HTTP timeout. The SDK uses Kiota’s default — wrap calls in
CancellationTokenif you need tighter bounds. - Use
RefreshableBearerAuthif you’re acting on behalf of a user — token rotation is the right model.ApiKeyAuthis for service identities.
Next steps
- Authentication —
ApiKeyAuthvsRefreshableBearerAuth. - Error handling — exception hierarchy + retry strategies.
- CLI/SDK marker — operations that are gated for SDK callers.