Please navigate this Documentation using the menu.
Ampbar is a full-service platform with the capabilities to enable total management of the supplier relationship between a Law Firm (Solicitors) and Counsel.
The main purpose of this documentation is to outline the steps needed for a Law Firm to start integrating its systems with the Ampbar platform. Through the Ampbar APIs, a Law Firm has the necessary level of control and access to programmatically connect an external data source (e.g. a case management software) to the Ampbar platform, to directly write and read its data.
The goal is for the Law Firm to be able to onboard Cases in a seamless and frictionless manner i.e. to reduce the administration and rekeying of common cases and documentation information between the two respective systems. After the initial setup (e.g. setting up the associated Law Firm and its Branches, Fee Earner Users and Lay Clients), all cases' details can be input and distributed to Counsel using the APIs.
This documentation assumes that the user who is the designated technical administrator for the Law Firm, has received the pre-requisite credentials associated to their account to peruse and interact with the Swagger API tooling environment. If you require access to an API key, please contact us.
Once you have received your credentials, you can start testing your code using the Sandbox testing environment.
OAuth2 ClientID and Secret are required to programmatically access endpoints. These credentials are available on request. Furthermore, all requests using POST, PATCH, PUT methods require an Anti-Forgery Token to be obtained from a GET /requestverificationtoken endpoint accessible on each API, e.g. https://case-api.ampbar.com/v1/requestverificationtoken
To authorise and send requests to Ampbar, you can follow a standard OAuth2 authorisation and Bearer token journey.
The example below displays one way of authorising and sending your requests using C# programming language. Please contact us if you need assistance specific to your programming environment.
// imports
// using IdentityModel.Client; // see nuget package "IdentityServer4.AccessTokenValid
// using System.Net.Http;
// API scopes - "case" & "user"
string
ampbarCaseEndPoint =
"
https://case-api.ampbar.com
"
;
string
ampbarUserEndPoint =
"
https://user-api.ampbar.com
"
;
string
ClientId =
"clientId"
;
string
ClientSecret =
"clientSecret"
;
var
discoClient =
await
DiscoveryClient
GetAsync(
"
https://identity.ampbar.com
"
);
if
(discoClient.IsError)
throw new
Exception
(discoClient.Error);
// "case" access token
var
caseTokenClient =
new
TokenClient(
discoClient.TokenEndpoint,
ClientId,
ClientSecret);
var
caseTokenResponse =
await
caseTokenClient.RequestClientCredentialsAsync(
"Case"
);
var
caseAccessToken = caseTokenResponse.AccessToken;
// "user" access token
var
userTokenClient =
new
TokenClient(
discoClient.TokenEndpoint,
ClientId,
ClientSecret);
var
userAcessToken =
await
userTokenClient.RequestClientCredentialsAsync(
"User"
);
var
userAccessToken = userTokenResponse.AccessToken;
var
caseHttpClient =
new
HttpClient
{ BaseAddress =
new
Uri
(ampbarCaseEndPoint) };
caseHttpClient.SetBearerToken(caseAccessToken);
// fetch countries
var
caseHttpResponse =
await
caseHttpClient.GetStringAsync(
"v1/shared/countries"
);
var
userHttpClient =
new
HttpClient
{ BaseAddress =
new
Uri
(ampbarUserEndPoint) };
userHttpClient.SetBearerToken(userAccessToken);
// fetch user courtesy titles
var
userHttpResponse =
await
userHttpClient.GetStringAsync(
"v1/shared/courtesytitles"
);
There are 3 main Ampbar APIs. They are each related to Users, Cases and Documents data.
Please access the Swagger tool of each API to get a list of endpoints and methods you can use. Also, please navigate to the Typical Usage section of this Documentation to find out more about the typical usage of Ampbar API endpoints.
Principles of standard RESTful APIs are followed.
Swagger: https://user-api.ampbar.com
User API can be used to read and write the following data and take the following actions:
Swagger: https://case-api.ampbar.com
Case API can be used to read and write the following data and take the following actions:
Draftstatus onto the platform. The Fee Earner User can then login to the Ampbar portal to finalise the submission before it being distributed to Counsel.
Swagger: https://document-api.ampbar.com
Document API can be used to read and write the following data and take the following actions:
The following is a typical sequence of requests to perform the initial setup of the Law Firm, its main Branch and Users, and creating the first Case.
When using POST or PUT requests to send data to Ampbar, a set of fields within the posted JSON object will usually be required. Please refer to Swagger to retrieve the current set of required fields.
An example of this is a POST request to create a Case (or its Draft). There are numerous points of data that need to be provided, and some the required IDs (such as User IDs, but also activity IDs etc.) will need to be discovered through the use of other endpoints first.
Here is an example payload of a POST request to create a Case:
{
"title": "Rebellion vs Empire",
// the title of the case
"solicitorReference": "R-456123789",
// your case reference for search purposes
"layClientReference": "SW-0406",
// your lay client reference for search purposes
"courtClaimNumber": "DV3456",
// your court claim number (optional)
"solicitorLocationCode": "HTH",
// your solicitor location code (optional)
"layClientId": 1,
// Ampbar lay client ID - retrieve using User API - GET /v1/layclients
"lawFirmBranchId": 1,
// Ampbar law firm branch ID - retrieve using User API - GET /v1/lawfirms + GET /v1/lawfirms/{lawFirmId}/branches
"preTrialActivityType": "CustomFixedRate",
// Ampbar fee model type (please use one per opportunity of work) - retrieve using GET /v1/shared/pretrialactivitytypes
"draftings": [
// array of details of draftings
{
"feeMatrixActivityId": 2,
// Ampbar drafting activity ID - retrieve using GET /v1/feematrixactivities
"deadline": "dDeadline1",
// drafting deadline
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 800
// when using any Fixed Rate fee model, the fee in GBP
},
{
"feeMatrixActivityId": 3,
"deadline": "2022-12-19T15:30:00Z",
// all drafting deadline of one Opportunity of Work should currently be the same
"preTrialActivityType": "FeeMatrix",
"lineAmount": 0
// when using any Fee Matrix fee model, the fee is determined by the Fee Matrix and not required here
}
],
"hearingDates": [
// array of details of hearings
{
"hearingTitle": "Trial Start",
// title of the hearing
"hearingDate": "2022-12-20T12:30:00Z",
// date of the hearing
"solicitorReference": "AS123",
// your hearing reference
"hearingTypeId": 1,
// Ampbar hearing type ID - retrieve using GET /v1/shared/hearingtypes
"courtsAndTribunalsId": "8d7f9356-2...82d37",
// Ampbar court ID - retrieve using GET /v1/courtsandtribunals
"hearingVenue": "InPerson",
// Ampbar hearing venue type - retrieve using GET /v1/shared/hearingvenues
"durationDay": 2,
// duration of the hearing
"durationHour": 5,
"durationMinute": 30,
"chambersProfileId": 1,
"phoneNumber": "07357357357",
// phone number related to the hearing
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 2000
},
{
"hearingTitle": "At Court",
"hearingDate": "2022-12-21T15:00:00Z",
"solicitorReference": "OWK123456",
"phoneNumber": "07357357357",
"hearingTypeId": 2,
"courtsAndTribunalsId": "8d7f9356-2b6f-4e26-82d3-263631dbfe87",
"hearingVenue": "Chambers",
"durationDay": 2,
"durationHour": 5,
"durationMinute": 30,
"chambersProfileId": 2,
"preTrialActivityType": "FeeMatrix",
"lineAmount": 0
}
],
"claimTagIds": [
1,
2
],
"trialLengthDay": 10,
"trialLengthHour": 14,
"trialLengthMinute": 25,
"fileHandler": "John Doe",
"summary": "The appellants have brought\r\nthese proceedings to challenge the....",
"claimantValueBandId": 2,
"clientReserve": 150000,
"preferredCounselUserIds": ["8a7f9356-...263631", "baaa556...32321"],
"userId": "80a69bbf-b0f6-4ee4-a45c-77786c2d5070",
"feeEarnerUserId": "80a69bbf-b0f6-4ee4-a45c-77786c2d5070"
}
Upon successful request, you will receive a response confirming the received details, also containing the Case ID to be used in further requests:
{
"id": 1234,
// Ampbar case ID to be used in further requests
"status": "Unallocated",
// current Ampbar status of the case
"offerOfInstructions": [],
// array of Opportunities of Work that are part of the case - first will be created in the next request
"managedByAppClientId": "your_client",
// your client identifier
"createdByUserId": "da53cffa-48f1-4041-aabd-2d100b9d4a42
// ID of the user who created the case
"title": "Rebellion vs Empire",
"solicitorReference": "R-456123789",
"layClientReference": "SW-0406",
"courtClaimNumber": "DV3456",
"solicitorLocationCode": "HTH",
"layClientId": 1,
"lawFirmBranchId": 1,
"preTrialActivityType": "CustomFixedRate",
"draftings": [
{
"id": "9469ddb7-cd8f-421b-b5ae-3eadee0ee3ac",
// ID of the drafting to be used in further requests
"feeMatrixActivityId": 2,
"deadline": "2022-12-19T15:30:00Z",
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 800
}
{
"id": "a8ad6d8d-eff4-4b5d-b39b-ce0064b3522c",
"feeMatrixActivityId": 3,
"deadline": "2022-12-19T15:30:00Z",
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 0
}
],
"hearingDates": [
{
"id": "f4ec8af8-4e0a-4095-b0d5-c572a7afd1de",
// ID of the hearing to be used in further requests
"hearingTitle": "Trial Start",
"hearingDate": "2022-12-20T12:30:00Z",
"solicitorReference": "AS123",
"hearingTypeId": 1,
"courtsAndTribunalsId": "8d7f9356-2...82d37",
"hearingVenue": "InPerson",
"durationDay": 2,
"durationHour": 5,
"durationMinute": 30,
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 2000
},
{
"id": "9d29a402-b413-41b6-8de7-4f2535d17943",
"hearingTitle": "At Court",
"hearingDate": "2022-12-21T15:00:00Z",
"solicitorReference": "OWK123456",
"hearingTypeId": 2,
"courtsAndTribunalsId": "8d7f9356-2b6f-4e26-82d3-263631dbfe87",
"hearingVenue": "Chambers",
"durationDay": 2,
"durationHour": 5,
"durationMinute": 30,
"preTrialActivityType": "FeeMatrix",
"lineAmount": 0
}
],
"claimTagIds": [
1,
2
],
"trialLengthDay": 10,
"trialLengthHour": 14,
"trialLengthMinute": 25,
"fileHandler": "John Doe",
"summary": "The appellants have brought\r\nthese proceedings to challenge the....",
"claimantValueBandId": 2,
"clientReserve": 150000,
"preferredCounselUserIds": ["8a7f9356-...263631", "baaa556...32321"],
"userId": "80a69bbf-b0f6-4ee4-a45c-77786c2d5070",
"feeEarnerUserId": "80a69bbf-b0f6-4ee4-a45c-77786c2d5070"
}
The case that has been created is the base for creating Opportunities of Work (Offers of Instruction). To create one, use the following request to POST /v1/cases/{caseId}/offerofinstructions (where {caseId} is your Ampbar Case ID provided in the previous response).
{
"draftingIds": [
// array of those drafting IDs provided in the previous response that you want to be part of this opportunity of work
"9469ddb7-cd8f-421b-b5ae-3eadee0ee3ac"
],
"hearingIds": [
// array of those hearing IDs provided in the previous response that you want to be part of this opportunity of work
"f4ec8af8-4e0a-4095-b0d5-c572a7afd1de"
],
"preTrialActivityType": "CustomFixedRate",
// please use the same preTrialActivityType as when creating the case
"responseDeadline": "2022-07-01T15:00:00Z",
// reponse deadline - counsel will only be able to respond before this time
}
And you will receive a response like this:
{
"id": 2345,
// Opportunity of Work (Offer of Instruction) ID to be used in further requests
"caseId": 1234,
// Case ID
"status": "Pending",
// current status of the Opportunity of Work
"userOfferOfInstructions": [],
// array of details of counsel the request was sent to - will be populated after the next request
"draftings": [
{
"id": "9469ddb7-cd8f-421b-b5ae-3eadee0ee3ac",
// ID of the drafting assigned to the Opportunity - will be different than in case
"feeMatrixActivityId": 2,
"deadline": "2022-12-19T15:30:00Z",
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 5000
}
"hearings": [
{
"id": "f4ec8af8-4e0a-4095-b0d5-c572a7afd1de",
// ID of the hearing assigned to the Opportunity - will be different than in case
"hearingDate": "2022-12-20T12:30:00Z",
"hearingTitle": "Trial Start",
"solicitorReference": "AS123",
"hearingTypeId": 1,
"courtsAndTribunalsId": "8d7f9356-2b6f-4e26-82d3-263631dbfe87",
"hearingVenue": "InPerson",
"durationDay": 2,
"durationHour": 5,
"durationMinute": 30,
"preTrialActivityType": "CustomFixedRate",
"lineAmount": 2000
}
],
"isExtension": false,
// indicates if this is not the first Opportunity of Work of the case, but an extension
"isConfirmedForCounsel": false,
// indicates if any counsel is allocated to this Opportunity
"timeCreated": "2022-06-28T11:01:06.2281208+01:00",
"timeUpdated": "2022-06-28T11:01:06.2281843+01:00",
"additionalInformation": "string",
"preTrialActivityType": "CustomFixedRate",
"responseDeadline": "2022-07-01T15:00:00Z",
}
The Opportunity of Work is now ready to be distributed to Counsel. Send a request to PUT /v1/cases/{caseId}/offerofinstructions/{id}/distribute, where {caseId} is the ID of your case and {id} is the ID of the Opportunity of Work received from previous responses:
{
"responseDeadline": "2022-07-01T15:00:00Z",
"counselUserIds": ["8a7f9356-...263631", "baaa556...32321"]
// Ampbar user IDs of counsel to distribute the requests to
}
You will receive a simple HTTP 204 response as confirmation of the Opportunity of Work being successfully distributed.
All Ampbar APIs have their sandbox counterparts for testing purposes. These allow Law Firm developers to test the endpoints and their integration without using real data.
User API Sandbox Swagger: https://sandbox-user-api.ampbar.com
Case API Sandbox Swagger: https://sandbox-case-api.ampbar.com
Document API Sandbox Swagger: https://sandbox-document-api.ampbar.com
Dynamis House
8 Sycamore Street
London
EC1Y 0SW
United Kingdom