Caplin Director v2 RESTful API
User methods
The following methods are available for managing users.
Create a user
POST /user
URL |
/user |
Method |
POST |
Success code |
201 Created |
Failure code |
500 Server error 400 Bad request |
Request body |
User object |
Response body |
|
Request headers |
|
Response headers |
URL of user returned in the HTTP |
Back to Contents
Get user
GET /user/<userKey>
URL |
/user/<userKey> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Get all users for a client
GET /users?clientKey=<clientKey>
URL |
/users?clientKey=<clientKey> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error 400 Bad request |
Request body |
|
Response Body |
|
Request headers |
|
Response headers |
Back to Contents
Update a user
PUT /user
URL |
/user |
Method |
PUT |
Success code |
200 OK |
Failure code |
500 Server error 400 Bad request |
Request body |
User object |
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Client methods
The following methods are available for managing clients.
Create a client
POST /client
URL |
/client |
Method |
POST |
Success code |
201 Created |
Failure code |
500 Server error 400 Bad request |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
URL of client returned in the HTTP |
Back to Contents
Get a client
GET /client/<clientKey>
URL |
/client/<clientKey> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Get all clients
This Director v1 method has been replaced by Get a client’s child clients and users.
Back to Contents
Get a client’s directory of clients and users
GET /client/<clientKey>/directory
This method replaces the Director v1 GET /clients
method.
URL |
/client/<clientKey>/directory |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error 400 Bad request (if <clientKey> is null) |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Search for clients
GET /search/<requestId>/<searchTerm>
URL |
/search/<requestId>/<searchTerm> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Update a client
PUT /client
URL |
/client |
Method |
PUT |
Success code |
200 OK |
Failure code |
500 Server error 400 Bad request |
Request body |
Client object |
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Move a client
GET /client/<clientKey>/move/<parentClientKey>
URL |
/client/<clientKey>/move/<parentClientKey> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
Error object on failure |
Request headers |
|
Response headers |
Back to Contents
Validate a client
POST /validate/client
URL |
/validate/client |
Method |
POST |
Success code |
200 OK |
Failure code |
500 Server error 400 Bad request |
Request body |
Client object |
Response body |
Error object (on failure) |
Request headers |
|
Response headers |
Back to Contents
Validate a client move
GET /validate/client/<clientKey>/move/<parentClientKey>
URL |
/validate/client/<clientKey>/move/<parentClientKey> |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Delete a client
DELETE /client/<clientKey>
URL |
/client/<clientKey> |
Method |
DELETE |
Success code |
204 No Content |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Permissioning messages
The following methods are available for managing permissions.
Get all enabled client-permissions
GET /client/<clientKey>/enabled
URL |
/client/<clientKey>/enabled |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
Array of permission keys or Error object |
Request headers |
|
Response headers |
Back to Contents
Add an enabled client-permission
POST /client/<clientKey>/enabled/<permissionKey>
URL |
/client/<clientKey>/enabled/<permissionKey> |
Method |
POST |
Success code |
201 Created |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Empty URL |
Back to Contents
Remove an enabled client-permission
DELETE /client/<clientKey>/enabled/<permissionKey>
URL |
/client/<clientKey>/enabled/<permissionKey> |
Method |
DELETE |
Success code |
204 No content |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Get all disabled user-permissions
GET /user/<userKey>/disabled
URL |
/user/<userKey>/disabled |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
Array of permission keys or Error object |
Request headers |
|
Response headers |
Back to Contents
Add a disabled user-permission
POST /user/<userKey>/disabled/<permissionKey>
URL |
/user/<userKey>/disabled/<permissionKey> |
Method |
POST |
Success code |
201 Created |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Empty URL |
Back to Contents
Remove a disabled user-permission
DELETE /user/<userKey>/disabled/<permissionKey>
URL |
/user/<userKey>/disabled/<permissionKey> |
Method |
DELETE |
Success code |
204 No content |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Create an account
POST /account
URL |
/account |
Method |
POST |
Success code |
201 Created |
Failure code |
500 Server error |
Request body |
Permission object |
Response body |
Permission object or Error object |
Request headers |
|
Response headers |
Empty URL |
Back to Contents
Update an account
PUT /account
URL |
/account |
Method |
PUT |
Success code |
201 Created |
Failure code |
500 Server error |
Request body |
Permission object |
Response body |
Permission object or Error object |
Request headers |
|
Response headers |
Empty URL |
Back to Contents
Delete an account
DELETE /client/<clientKey>/account/<permissionKey>
URL |
/client/<clientKey>/account/<permissionKey> |
Method |
DELETE |
Success code |
204 No content |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Get all accounts for client
GET /client/<clientKey>/accounts
URL |
/client/<clientKey>/accounts |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
Array of Permission objects or Error object |
Request headers |
|
Response headers |
Back to Contents
Other methods
The following miscellaneous methods are also available.
Client and user field meta-data and permissions
GET /configuration
URL |
/configuration |
Method |
GET |
Success code |
200 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
Configuration object |
Request headers |
|
Response headers |
Back to Contents
Ping (noop)
POST /system/ping
URL |
/system/ping |
Method |
POST |
Success code |
200 OK |
Failure code |
|
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Back to Contents
Logout
GET /logout
URL |
/logout |
Method |
GET |
Success code |
302 OK |
Failure code |
500 Server error |
Request body |
|
Response body |
|
Request headers |
|
Response headers |
Redirection ( |
Back to Contents
Objects in the request and response body
All objects in the request and response body are JSON encoded.
Error object
A JSON encoded object describing an error.
Attribute | Description |
---|---|
|
Error status. Possible values:
|
|
[optional] Error text |
|
[optional] Validation errors in the form |
Configuration object
A JSON encoded object that contains data needed to use the rest API with the other JSON objects.
Attribute | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
An array of field specification objects |
||||||||||||||
|
An array of field specification objects |
||||||||||||||
|
An array of field specification objects |
||||||||||||||
|
Array of permission objects |
||||||||||||||
|
Array of group objects |
||||||||||||||
|
The user name of the administrator logged into Director |
||||||||||||||
|
For use by Director’s GUI. An object with the following attributes:
|
Field specification object
A JSON encoded object describing a field.
Attribute | Description | Possible Values |
---|---|---|
|
The name of the attribute the spec is for |
- |
|
A user readable name |
- |
|
How to display the attribute |
For account fields, the only valid value is: For client and user fields, the value can be one of: |
|
The attributes data type |
One of |
|
|
|
|
How the client can modify the attribute |
One of |
|
Array of validations |
Validations have attributes
|
|
Array of options |
Only has options if |
|
The default value for the attribute |
|
Client-move validation result
A JSON encoded object describing the validation result.
Attribute | Description | Possible Values |
---|---|---|
|
The verification result |
One of three values:
|
|
Detailed description of validation failure |
One of six values:
|
|
Permissions that will be revoked as a result of the move. |
A map, keyed by client, of arrays of Permission objects. The map’s keys are client objects serialised to strings. Example map: "permissionsToBecomeDenied": { "ClientEntity{clientKey=1001, …}": [ { "permissionKey":23, "description":"Benchmark", "action":"BENCHMARK", "tags":{}, "customFields":{}, "groupKey":3, "permissionOrder":14, "type":"boolean" }, â‹® ], â‹® } |
|
The client to be moved. |
Client object. |
Permission object
A JSON encoded object describing a permission.
Attribute | Description |
---|---|
|
Used to identify this permission in other rest requests. |
|
A user readable name. |
|
How the permission is to be displayed |
|
The permissions action, as used by the permissioning API. |
|
JSON object of custom attributes / values as configured in Director’s database. |
|
ID of the group this permission belongs to. |
|
Integer. Used when ordering a list of permissions in the Director GUI. Permissions with a lower |
Group object
A JSON encoded object describing a group.
Attribute | Description |
---|---|
|
The group’s ID. |
|
Displayed title of the group. |
|
Used to order the display of the group. |
|
How the group is to be displayed. |
User object
A JSON encoded object describing a user.
Attribute | Description | ||
---|---|---|---|
|
The user’s id. |
||
|
The id of the client the user belongs to. |
||
|
The user’s Liberator login name. |
||
|
The user’s first name. |
||
|
The user’s last name. |
||
|
|
||
|
|
||
|
The version of this user’s data. When client receives a version of |
Custom user fields defined in the Director database appear as extra attributes on the User object. If a custom user 'address' field is defined in the database, for example, it would be be included as an 'address' attribute of the User object. For information on how to create custom fields, see Defining custom fields.
Client object
A JSON encoded object describing a client.
Attribute | Description |
---|---|
|
The client’s id |
|
The key of the client’s parent, or 0 if the client is a root-level client. |
|
True if the client is disabled. The client and all its users will not be sent to the Liberator. |
|
True if an ancestor of the client is disabled. |
|
The version of this user’s data. When client receives a version of 1 it must send a version of 1 on updates. If the current version does not match the update will fail. |
|
Client short name |
|
Client display name |
|
Map of custom field names and values. Example: |
|
The ID of a pricing tier |
|
[Optional] The ID of a pricing tier |
Custom client fields defined in the Director database appear as extra attributes on the Client object. If a custom client 'address' field is defined in the database, for example, it would be be included as an 'address' attribute of the User object. For information on how to create custom fields, see Defining custom fields.