Calling Clio Operate APIs from an external application

Was this article helpful?

 

Clio Operate is constructed on an ‘API first’ basis. What this means in practice is that every piece of functionality that is available in the Clio Operate UX is also available via a REST API. There are currently more than 400 API endpoints available for use that enable every piece of functionality that can be performed through the UI to be also achieved through system-to-system integration.

In addition a subset of these APIs are also made available via a versioned public API; and it is typically these APIs that should be used when building external system integrations.

The /public/ moniker on the APIs indicates this, and provides for clear separation between the 400+ internal APIs and the APIs meant for consumption by integrations. Most public APIs are versioned. A few older endpoints, such as matter ingestion /api/public/matters and user ingestion /api/public/ods/users, are not versioned.

Public API URLs follow this pattern: /api/{version}/public/{resource}/{id}/{subResource}/{id}, for example /api/v1/public/workItem/{id}/comments

RPC-style actions follow /api/{version}/public/{resource}/{id}/{action}

Versioning

Versioning is typically performed at the resource level e.g. people, users, work item. Where an API is not marked as depreciated its continuing backwards compatibility can be relied upon.

GET /api/public/ lists all public modules. 

GET /api/public/{module}/versions lists a module's versions. 

Swagger files and version lists need no token.

Sub Resources

The concept of resource/sub resource is to address into other items within a top level aggregate. For example, a work item instance:

GET /api/v1/public/workItem/{id} returns base data for the id specified. PUT /api/v1/public/workItem/{id} updates it.

GET /api/v3/public/workItem/{id}/participants lists participants on that work item instance.

POST /api/v3/public/workItem/{id}/participants adds participants.

DELETE /api/v3/public/workItem/{id}/participants/{participantId} removes a participant.

GET /api/v1/public/workItem/{id}/comments lists comments on the work item instance. 

So, for addressable resources, HTTP verbs used to effectively do CRUD operations on those resources. The exceptions to this pattern are RPCs - remote procedure calls. These are common groups of logic that don’t fit with a simple GET/PUT/POST/DELETE/PATCH for a resource. For instance, the operation to delegate a task involves creating some new participants and reassigning existing ones. For this type of operation we have RPC calls, which are addressed in a similar way to resources, but only support a PUT, POST or DELETE depending on what they are doing.

POST /api/public/workItems/v1/{id}/{rpc}

e.g.

POST /api/public/workItems/v1/{id}/delegate
{
“role”: “primary-owner”,
“delegation-role”: “delegated-by”,
“to”: “{new owner ods id}”
}

New Public APIs are being continually released with the application to support more advanced integration scenarios. Where no public API exists, use the internal APIs listed in the Developer Help Portal. Internal APIs are not versioned and can change between releases.

 

Set up an OAuth Client

Navigate to Admin > Identity Server. The page displays the OAuth clients for the environment.


To test your authentication flow, you could use an existing client. ee-app is a system client that the Execution Engine depends on. Use it for testing only, and don't change its settings. Create your own client for any integration. Note: there are a few different 'ee-app' clients, use the one circled - it is configured for the Client Credentials flow.

You'll want to create your own client once you have that working though, more on that below.

Select Edit for that client row - the Configure OAuth client blade displays the Access Token URL, Client Id and Client Secret. Select the eye icon to reveal the secret. Client credentials clients have a Create a new access token button on the blade. It's a faster test than Postman.

The button displays only for Client Credentials clients. The file contains the client's ID and secret, so store it securely. This is Postman configured to get a token as the 'ee-app' client above:


That will enable you to call all of the public APIs described in this document. Request a token from the Access Token URL with grant_type=client_credentials and scope=sharedo. Send the Client Id and Client Secret as HTTP Basic authentication. Pass the returned access token as a Bearer token in the Authorization header of each API call.

For some of the endpoints, your OAuth client needs specific permissions. These are mentioned in the on-line documentation for the relevant API. Navigate to Modeller > Public API to browse every public endpoint, its parameters and its required permissions. To manage permissions for your app, you'll want to add your own client instead of using an existing one. Navigate to Admin > Identity Server, select Add App, then select Add client credentials application.

Enter a Client Id. You can't change it after saving. Enter a Client Secret, or select the randomise icon to generate one. 

You can also manage permissions for that client at the bottom of that blade:

API Coverage

The public API is broken down into the following areas:

API AREA DESCRIPTION
People & Organisations Methods related to managing People and Organisations
Users & Teams Methods relating to managing users and their teams
Work Items Describes a set of generic methods that can be used across all work items such as progressing milestones and the like
Modeller Describes a subset of Modeller functionality that can be accessed via the Public API
Finance Methods relating to the management of Goods & Services, Financial Balances, Payments, Invoices, Fee Estimates and Time
Legal Provides a set of Methods relating to the legal plugin such as the onboarding of new Matters in the case that CMI is performed outside of Clio Operate.

 

Was this article helpful?

Related articles

Related articles in the knowledge base