Configure the REST API#
Colectica Repository exposes its functionality by providing a REST-style API. To enable and use the API, follow these steps:
In
appsettings.json, setAPI:EnableRESTv1totrue. See appsettings.json.Configure how API clients authenticate. Requests to the API must carry a bearer token in the
Authorizationheader, unless Windows authentication is used.Configure OAuth2 OpenID Connect (OIDC) authentication. See Configure OAuth2 OpenID Connect (OIDC) and Configure Azure Active Directory.
Alternatively, configure the local JWT token provider, which issues tokens to the portal’s own user accounts. See Configure Local JWT Token Provider (Optional).
When
UseWindowsAuthenticationis enabled, API clients authenticate with Windows credentials instead.
Assign roles to the users or applications that will call the API. See Roles.
Note
Visit the Colectica REST API v1 documentation page for details of every request and response.
For interactive documentation for all API methods, visit your Portal’s
site: https://example.org/swagger.
The Swagger page can be disabled with the RepositorySettings:Portal:DisableSwaggerUI setting.
Colectica Designer, Colectica Questionnaires, the Repository CLI, and the Colectica SDK all use this API to communicate with the repository.