Skip to content

Get Case Address Book

This API endpoint enables you to fetch case address book. Currently it featch all the related entities of the case.

Input


Endpoint

Get /cases/{caseId}/address-book


HTTP request headers

Content-Type  string

Setting to application/json is required.

Authorization  string

This is the token you fetched e.g. Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS…


Path parameters

caseID  string - Required

The unique case ID you wish to retrieve.

Output


Http status codes
Status CodeDescription
200OK
400Bad Request
404Resource not found
500Internal Server Error

Request example

bash
curl  -X GET \
  'https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...'
php
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book');
$request->setRequestMethod('GET');
$request->setHeaders([
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

json
[
  {
    "id": "01907dee-5862-4afc-a2ba-629dd6e26649",
    "data": {
      "title": "Mrs",
      "gender": "female",
      "last_name": "Doe",
      "first_names": "Jenny",
      "marital_status": "married"
    },
    "entity_id": "person"
  },
  {
    "id": "0462d359-9c5d-4074-9961-267441ddc90d",
    "data": {
      "postcode": "LE11 5FD",
      "address_1": "3 Barbor Road",
      "address_2": "Loughborough",
      "address_3": "Leicestershire"
    },
    "entity_id": "address"
  }
]
json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": { "type": "string" },
      "data": {
        "type": "object",
        "properties": {
          "type": "object"
        }
      },
      "entity_id": { "type": "string" }
    },
    "required": ["id", "data", "entity_id"]
  }
}

Create Case Address Book Entry

This API endpoint enables you to create new address book entry for a case.

Input


Endpoint

Post /cases/{caseId}/address_book/entry


HTTP request headers

Content-Type  string

Setting to application/json is required.

Authorization  string

This is the token you fetched e.g. Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS…


Path parameters

caseID  string - Required

The unique case ID for which you intend to generate a new appointment.


Body parameters

entity_id  string - Required

Must be a set to value person

title  string - Required

first_names  string - Required

middle_names  string

last_name  string - Required

known_as  string

tel_1  string

tel_2  string

email  string

gender  string

dob  string

Accepted format DD/MM/YYYY - e.g. 20/07/1990

relationship  object

Details

Example of relationship


Note: the key is the customerID of case editing.

json
{
  "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
}

occupation  string

preferred_name  string

alias  string

address  object

Details

Properties of address


address_1  string

address_2  string

address_3  string

postcode  string


Example of customers

json
[
  {
    "address_1": "40 Friar Lane",
    "address_2": "Nottingham",
    "postcode": "NG1 6DQ"
  }
]

tags  array

You can assign one or multiple tags to the address book entry, these should be the default tags predefined in the system.

Details

Note: tags should be all lower case and dash "-" should replace any spaces. E.g. If tag is Substitute Executor enter substitute-executor


Example of tags

['substitute-executor', 'executor']

custom_tags  array

You can assign one or multiple custom_tags to the address book entry, these can be created in the company settings page.

Details

Note: tags should be all lower case and dash "-" should replace any spaces. E.g. If tag is High Profile enter high-profile


Example of custom_tags

['high-profile']

Output


Http status codes
Status CodeDescription
200OK
400Bad Request
404Resource not found
500Internal Server Error

Request example

bash
curl  -X POST \
  'https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book/entry' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...' \
  --data-raw '{
    "title": "Mr",
    "entity_id": "person",
    "first_names": "John",
    "last_name": "Doe",
    "relationship": {
      "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
    },
    "them_pronoun": null,
    "they_pronoun": null,
    "their_pronoun": null,
    "address": {
      "address_1": "33A The Square",
      "address_2": "Beeston",
      "address_3": "Nottingham",
      "postcode": "NG9 2JJ"
    },
    "tags": ["substitute-executor"],
    "custom_tags": ["high-profile"]
  }'
php
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
  "title": "Mr",
  "entity_id": "person",
  "first_names": "John",
  "last_name": "Doe",
  "relationship": {
    "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
  },
  "them_pronoun": null,
  "they_pronoun": null,
  "their_pronoun": null,
  "address": {
    "address_1": "33A The Square",
    "address_2": "Beeston",
    "address_3": "Nottingham",
    "postcode": "NG9 2JJ"
  },
  "tags": ["substitute-executor"],
  "custom_tags": ["high-profile"]
}');


$request->setRequestUrl('https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book/entry');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

json
{
  "entity_id": "person",
  "data": {
    "title": "Mr",
    "last_name": "Doe",
    "first_names": "John",
    "relationship": {
      "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
    },
    "their_pronoun": null,
    "them_pronoun": null,
    "they_pronoun": null,
    "address": "a0e31ab1-4b28-4fe1-bea1-a09f7c5f51e2"
  },
  "customer_case_id": "d57bc3b7-4f44-4846-9741-985db9af9b61",
  "id": "9978d793-1cbc-4dfe-b6a8-88ab1333ee51",
  "updated_at": "2024-01-15T08:54:26.000000Z",
  "created_at": "2024-01-15T08:54:26.000000Z"
}
json
{
  "type": "object",
  "properties": {
    "entity_id": {
      "type": "string",
      "enum": ["person"]
    },
    "data": {
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "last_name": { "type": "string" },
        "first_names": { "type": "string" },
        "relationship": {
          "type": "object",
          "additionalProperties": { "type": "string" }
        },
        "their_pronoun": { "type": ["string", "null"] },
        "them_pronoun": { "type": ["string", "null"] },
        "they_pronoun": { "type": ["string", "null"] },
        "address": { "type": "string" }
      },
      "required": ["title", "last_name", "first_names", "relationship", "address"]
    },
    "customer_case_id": { "type": "string" },
    "id": { "type": "string" },
    "updated_at": { "type": "string", "format": "date-time" },
    "created_at": { "type": "string", "format": "date-time" }
  },
  "required": ["entity_id", "data", "customer_case_id", "id", "updated_at", "created_at"]
}

Update Case Address Book Entry

This API endpoint enables you to update existing address book entry for a case.

Input


Endpoint

Patch /cases/{caseId}/address_book/entry/{entryID}


HTTP request headers

Content-Type  string

Setting to application/json is required.

Authorization  string

This is the token you fetched e.g. Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS…


Path parameters

caseID  string - Required

The unique case ID for which you intend to generate a new appointment.

entryID  string - Required

The unique entry ID for which you intend update.


Body parameters

entity_id  string - Required

Must be a set to value person

title  string - Required

first_names  string - Required

middle_names  string

last_name  string - Required

known_as  string

tel_1  string

tel_2  string

email  string

gender  string

dob  string

Accepted format DD/MM/YYYY - e.g. 20/07/1990

relationship  object

Details

Example of relationship


Note: the key is the customerID of case editing.

json
{
  "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
}

occupation  string

preferred_name  string

alias  string

address  object

Details

Properties of address


address_1  string

address_2  string

address_3  string

postcode  string


Example of customers

json
[
  {
    "address_1": "40 Friar Lane",
    "address_2": "Nottingham",
    "postcode": "NG1 6DQ"
  }
]

tags  array

You can assign one or multiple tags to the address book entry, these should be the default tags predefined in the system.

Details

Note: tags should be all lower case and dash "-" should replace any spaces. E.g. If tag is Substitute Executor enter substitute-executor

Pitfall: this will only add new tags (if tag already exists it will ignore it), however it will not remove any tags already assigned.


Example of tags

['substitute-executor', 'executor']

custom_tags  array

You can assign one or multiple custom_tags to the address book entry, these can be created in the company settings page.

Details

Note: tags should be all lower case and dash "-" should replace any spaces. E.g. If tag is High Profile enter high-profile

Pitfall: this will only add new tags (if tag already exists it will ignore it), however it will not remove any tags already assigned.


Example of custom_tags

['high-profile']

Output


Http status codes
Status CodeDescription
200OK
400Bad Request
404Resource not found
500Internal Server Error

Request example

bash
curl  -X PATCH \
  'https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book/entry/7bb1f69f-5bc9-4fda-9eab-55bf813806dd' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...' \
  --data-raw '{
    "title": "Mr",
    "known_as": "Sammy",
    "last_name": "Sam",
    "first_names": "Smith",
    "relationship":{
      "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
    },
    "entity_id": "person",
    "tags": ["substitute-executor"],
    "custom_tags": ["high-profile"]
  }'
php
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{

  "title": "Mr",
  "known_as": "Sammy",
  "last_name": "Sam",
  "first_names": "Smith",
  "relationship":{
    "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
  },
  "entity_id": "person",
  "tags": ["substitute-executor"],
  "custom_tags": ["high-profile"]
}');


$request->setRequestUrl('https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/address-book/entry/7bb1f69f-5bc9-4fda-9eab-55bf813806dd');
$request->setRequestMethod('PATCH');
$request->setBody($body);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

json
{
  "id": "7bb1f69f-5bc9-4fda-9eab-55bf813806dd",
  "customer_case_id": "d57bc3b7-4f44-4846-9741-985db9af9b61",
  "entity_id": "person",
  "data": {
    "title": "Mr",
    "known_as": "Sammy",
    "last_name": "Sam",
    "first_names": "Smith",
    "relationship": {
      "012ad872-39d1-4414-8c32-afd4c20bd091": "son"
    }
  },
  "created_at": "2024-01-09T11:19:00.000000Z",
  "updated_at": "2024-01-15T09:02:32.000000Z",
  "customer_person_id": null,
  "is_company_global": null,
  "user_id": null,
  "company_id": null,
  "deleted_at": null,
  "notes": null,
  "copied_from_id": null,
  "transferred_from_user_id": null,
  "transferred_at": null,
  "is_user_global": null,
  "leap_record_id": null,
  "leap_card_id": null,
  "leap_person_id": null
}
json
{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "customer_case_id": { "type": "string" },
    "entity_id": { "type": "string", "enum": ["person"] },
    "data": {
      "type": "object",
      "properties": {
        "title": { "type": "string" },
        "known_as": { "type": ["string", "null"] },
        "last_name": { "type": "string" },
        "first_names": { "type": "string" },
        "relationship": {
          "type": "object",
          "additionalProperties": { "type": "string" }
        }
      },
      "required": ["title", "last_name", "first_names", "relationship"]
    },
    "created_at": { "type": "string", "format": "date-time" },
    "updated_at": { "type": "string", "format": "date-time" },
    "customer_person_id": { "type": ["string", "null"] },
    "is_company_global": { "type": ["boolean", "null"] },
    "user_id": { "type": ["string", "null"] },
    "company_id": { "type": ["string", "null"] },
    "deleted_at": { "type": ["string", "null"], "format": "date-time" },
    "notes": { "type": ["string", "null"] },
    "copied_from_id": { "type": ["string", "null"] },
    "transferred_from_user_id": { "type": ["string", "null"] },
    "transferred_at": { "type": ["string", "null"], "format": "date-time" },
    "is_user_global": { "type": ["boolean", "null"] },
    "leap_record_id": { "type": ["string", "null"] },
    "leap_card_id": { "type": ["string", "null"] },
    "leap_person_id": { "type": ["string", "null"] }
  },
  "required": ["id", "customer_case_id", "entity_id", "data", "created_at", "updated_at"]
}