Import clients to Lawpractica

The Lawpractica Client Import API allows for the seamless importation of existing client data into Lawpractica. This functionality is designed specifically for developers looking to integrate or migrate client information into Lawpractica efficiently.
Authentication Method
The API uses a Bearer token (API Key) for authentication.
Obtaining Credentials
Credentials can be obtained from the Lawpractica application under the Integration tab in the Manage Settings form. Look for the Security Key value provided in the data exchange section.
Client Import Endpoint
  • URL:
  • Method: POST
  • Description: Imports client data into Lawpractica.
  • Request Headers:
    • Authorization: Bearer token (API key)
    • sd: Name of the user's subdomain (instance of the user application)
Request Body
Request body contains the requestor's information and an array of clients to be imported.

Request body schema (JSON Schema)
{
    "UserPrefix": "string",
    "UserFullName": "string",
    "UserEmail": "string",
    "ProfileCode": "string",
    "IsSendNotification": "integer",
    "NotificationEmail": "string",
    "NotificationCustomMessage": "string",
    "Clients": [
    {       
        "FileNumber": "string",
        "FileType": "string",
        "FileDescription": "string",
        "ClientType": "string",
        "ClientFirstName": "string",
        "ClientLastName": "string",
        "ClientCorporation": "string",
        "ClientTypeOfLaw": "string",
        "ClientRespLawyer": "string",
        "ClientAddress1": "string",
        "ClientAddress2": "string",
        "ClientCity": "string",
        "ClientProvinceCode": "string",
        "ClientPostalCode": "string",
        "ClientCountryCode": "string",
        "ClientHomePhone": "string",
        "ClientWorkPhone": "string",
        "ClientCell": "string",
        "ClientFax": "string",
        "ClientEmail": "string",
        "ClientUI": "string",
        "ClientUpdDate": "string (ISO 8601 format)",
        "IsPrimaryToContact": "boolean"
    }
  ]
}
    
Response Body
Response body contains a summary of the import operation and details of each client processed.
  • Description:   A summary of the import operation, including the Import Request ID and the number of clients successfully imported.
    TotalRecords: Total number of client records processed.
    TotalInserted: Number of new client records inserted during the import.
    TotalUpdated: Number of client records updated during the import.
    TotalErrors:    Number of errors encountered during the import process.
    Clients:         An array containing details of each client processed.
    • id: Unique identifier of the client record.
      >Other client attributes.

      >importNotes: Descriptions of any errors encountered while importing the client data.
      >importStatus: Indicates the status of the import operation for the client record. It has the format "I-[id]" if the record was inserted, "U-[id]" if it was updated, where "id" is the record ID.


  • Response body schema (JSON Schema)
    {
        "RequestID": "integer",
        "TotalRecords": "integer",
        "TotalUpdated": "integer",
        "TotalInserted": "integer",
        "TotalErrors": "integer",
        "Clients": [
        {
            "ID": "string",
            "FileNumber": "string",
            "FileType": "string",
            "FileDescription": "string",
            "ClientType": "string",
            "ClientFirstName": "string",
            "ClientLastName": "string",
            "ClientCorporation": "string",
            "ClientTypeOfLaw": "string",
            "ClientRespLawyer": "string",
            "ClientAddress1": "string",
            "ClientAddress2": "string",
            "ClientCity": "string",
            "ClientProvinceCode": "string",
            "ClientPostalCode": "string",
            "ClientCountryCode": "string",
            "ClientHomePhone": "string",
            "ClientWorkPhone": "string",
            "ClientCell": "string",
            "ClientFax": "string",
            "ClientEmail": "string",
            "ClientUI": "string",
            "ClientUpdDate": "string", 
            "IsPrimaryToContact": "boolean",
            "ImportNotes": "string",
            "ImportStatus": "string"
        }
      ]
    }
    
    • 400 Invalid JSON Format: The provided JSON information is invalid.
    • 411 User information cannot be empty: User information required for the operation is missing.
    • 411 API Key cannot be empty: API key required for authentication is missing.
    • 411 Subdomain cannot be empty: Subdomain information required for the operation is missing.
    • 411 Notification email cannot be empty (if IsSendNotification = 1): Notification email is required when notification is enabled.
    • 422 Invalid notification email format (if IsSendNotification=1): The format of the notification email is invalid.
    • 422 Invalid token: The provided token is invalid.
    • 500 Exception: An internal server error occurred.

    
    
    
       
        
    

    
    
     
        crossDomain: true,
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        data: JSON.stringify(Clients),
        headers: {
            'Authorization': 'Bearer ' + apiKey,
            'sd:' + subDomain,
            'Content-Type': 'application/json'
        }
    

    
    
    var Clients =
    {
        "UserPrefix": "BS",
        "UserFullName": "Brian Smith",
        "UserEmail": "info@lawpractica.com",
        "ProfileCode": "LP-DE",
        "IsSendNotification": "0",
        "NotificationEmail": "info@lawpractica.com",
        "NotificationCustomMessage": "This is a custom notification message",
        "Clients": [
        {
            "FileNumber": "ABCN",
            "FileType": "P",
            "FileDescription": "Matter description sample",
            "ClientType": "B",
            "ClientFirstName": "Brian",
            "ClientLastName": "Smith",
            "ClientCorporation": "xyz corp",
            "ClientTypeOfLaw": "TLCode",
            "ClientRespLawyer": "RLCode",
            "ClientAddress1": "8192 Sample Street",
            "ClientAddress2": "",
            "ClientCity": "Vancouver",
            "ClientProvinceCode": "BC",
            "ClientPostalCode": "123 XYZ",
            "ClientCountryCode": "CA",
            "ClientHomePhone": "1800Home",
            "ClientWorkPhone": "1800Work",
            "ClientCell": "604Cell",
            "ClientFax": "1718FAX",
            "ClientEmail": "brian.smith@dd.com",
            "ClientUI": "YourAppClientID1",
            "ClientUpdDate": "2024-01-05T12:15:00",
            "IsPrimaryToContact": true
        },
        {
            "FileNumber": "12345",
            "FileType": "P",
            "FileDescription": "",
            "ClientType": "S",
            "ClientFirstName": "Sara",
            "ClientLastName": "Brown",
            "ClientCorporation": "",
            "ClientTypeOfLaw": "TLCode",
            "ClientRespLawyer": "RLCode",
            "ClientAddress1": "92 Sample Street",
            "ClientAddress2": "",
            "ClientCity": "Vancouver",
            "ClientProvinceCode": "BC",
            "ClientPostalCode": "123 XYZ",
            "ClientCountryCode": "CA",
            "ClientHomePhone": "1800Home",
            "ClientWorkPhone": "1800Work",
            "ClientCell": "604Cell",
            "ClientFax": "1718FAX",
            "ClientEmail": "brian.smith@dd.com",
            "ClientUI": "YourAppClientID2",
            "ClientUpdDate": "2024-01-05T12:15:00",
            "IsPrimaryToContact": false
        }
      ]
    }
    
    

    
    
    
    200: function  () {
        console.log("200 - Success");
        },
    
    //when any of info not supplied (without json object(ajax) either in URL parameters)
    400: function (request, status, error) { alert(error); },
    //when any of supplied info is empty
    411: function (request, status, error) { alert(error); },
    //when the provided info is not invalid
    422: function (request, status, error) { alert(error); }, 500: function (request, status, error) { alert(error); }

    https://
    lawpractica.com