List contexts
Lists the contexts of the Organization where the API key holds at least one API permission.
GET /organizations/{organizationId}/contexts
Permission: Organization (Read). See API permissions.
Returns one page of contexts, ordered by name. items is empty when
the API key holds a permission in no context.
- A context where the API key has None on every API is not listed. An API key that holds only the Organization permission receives an empty page.
- A permission granted or removed in a context can take up to 45 seconds to show in the list. Operations on a context check the permissions of the API key on every request.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | The Organization ID of the API key. Any other ID returns 404. |
limit | Query | integer | No | Contexts per page, 1 to 100. Default 20. |
cursor | Query | string | No | The nextCursor of the previous page. Leave it out for the first page. |
Request example
curl "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts?limit=20" \ -H "Authorization: Bearer $NCP_API_TOKEN"Response
Section titled “Response”A page of contexts.
| Field | Type | Description |
|---|---|---|
items[].contextId | string | The context ID, {contextId} in the paths of the operations on the context. |
items[].type | string | The kind of context. This version has one value, SIGN_IN: a Sign-In Context, which has the operations of the Sign In API. New values can be added within v2. |
items[].name | string | The name of the context. |
Response example
{ "items": [ { "contextId": "20", "type": "SIGN_IN", "name": "Guest WiFi" }, { "contextId": "31", "type": "SIGN_IN", "name": "Visitors" } ], "nextCursor": null}Errors
Section titled “Errors”| Status | errorCode | When |
|---|---|---|
400 | VALIDATION_FAILED | limit is outside 1 to 100, or cursor is not a cursor of this operation. errors names the parameter. |
404 | RESOURCE_NOT_FOUND | organizationId is not the Organization of the API key. |
Errors common to all operations are in Errors.