Configuration API

Labels

Labels can be managed through the Minddistrict API. You can list defined labels under the sub-URL /configuration/labels of the API, and apply them after to either clients in the client API or on professionals in the professional API.

Label JSON object

Information about labels in the Minddistrict API is transferred as json objects containing the following information:

Name

Value

Explanation

Value type

Notes

identifier

Unique label identifier

-

String

Required, Read-only
label

Human readable label

-

String

Required

The @type meta information for this object is: http://ns.minddistrict.com/configuration/label.

The identifier is used on a client object or a professional object.

Listing labels

To get a list of all labels objects send a GET request to the API base URL with configuration/labels/items appended:

GET /api/2/configuration/labels/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtPh6WxHk6ZVMRNlpozycJz0NO6OoHPDWTOK5IJPue55hF3EB829TOwvNYKu6sORVhTg1O8C4JRat_r7c_s3b7cXT4ZmuWGHsQ-c9MH-2MSyu1wbBeHDlm03ZahY37mNoLaiJ_mL5p0EjYs2vROcJboy0_KMu944oIf6mLmf-7GCu5tsobjm-qxj9M_dev04440

The response will be a list of label objects:

HTTP/1.0 200 Ok
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 674
Content-Type: application/json;charset=UTF-8

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/configuration/label",
            "@url": "https://customer.minddistrict.com/api/2/configuration/labels/be6e40f0-a3b4-486b-a1c7-f9b97b483b00",
            "identifier": "be6e40f0-a3b4-486b-a1c7-f9b97b483b00",
            "label": "Intensive Care"
        },
        {
            "@type": "http://ns.minddistrict.com/configuration/label",
            "@url": "https://customer.minddistrict.com/api/2/configuration/labels/fd9d7f68-5b11-4de5-bb86-9e6526fe2517",
            "identifier": "fd9d7f68-5b11-4de5-bb86-9e6526fe2517",
            "label": "Regular Care"
        }
    ],
    "@links": []
}

Creating a new label

To create a label send a POST request to the API base URL with configuration/labels appended. Put the JSON encoded data for the new label in the body of the request:

POST /api/2/configuration/labels HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtPh6WxHk6ZVMRNlpozycJz0NO6OoHPDWTOK5IJPue55hF3EB829TOwvNYKu6sORVhTg1O8C4JRat_r7c_s3b7cXT4ZmuWGHsQ-c9MH-2MSyu1wbBeHDlm03ZahY37mNoLaiJ_mL5p0EjYs2vROcJboy0_KMu944oIf6mLmf-7GCu5tsobjm-qxj9M_dev04440
Content-Length: 30
Content-Type: application/json

{
    "label": "Urgent care"
}

The response will return the newly created label object. The label identifier is attributed by the Minddistrict platform and can be found in the response. It can then be applied on either a client or a professional object:

HTTP/1.0 201 Created
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 264
Content-Type: application/json;charset=UTF-8
Location: https://customer.minddistrict.com/api/2/configuration/labels/4c080773-0129-4a16-8282-5f177f992928

{
    "@type": "http://ns.minddistrict.com/configuration/label",
    "@url": "https://customer.minddistrict.com/api/2/configuration/labels/4c080773-0129-4a16-8282-5f177f992928",
    "identifier": "4c080773-0129-4a16-8282-5f177f992928",
    "label": "Urgent care"
}

View a label

To view a label send a GET request to the URL of the label:

GET /api/2/configuration/labels/fd9d7f68-5b11-4de5-bb86-9e6526fe2517 HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtPh6WxHk6ZVMRNlpozycJz0NO6OoHPDWTOK5IJPue55hF3EB829TOwvNYKu6sORVhTg1O8C4JRat_r7c_s3b7cXT4ZmuWGHsQ-c9MH-2MSyu1wbBeHDlm03ZahY37mNoLaiJ_mL5p0EjYs2vROcJboy0_KMu944oIf6mLmf-7GCu5tsobjm-qxj9M_dev04440

The response will be the corresponding label object:

HTTP/1.0 200 Ok
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 283
Content-Type: application/json;charset=UTF-8

{
    "@links": [],
    "@type": "http://ns.minddistrict.com/configuration/label",
    "@url": "https://customer.minddistrict.com/api/2/configuration/labels/fd9d7f68-5b11-4de5-bb86-9e6526fe2517",
    "identifier": "fd9d7f68-5b11-4de5-bb86-9e6526fe2517",
    "label": "Regular Care"
}

Editing a label

To modify label send a PATCH request to the URL of the label with the modification contained in the body:

PATCH /api/2/configuration/labels/fd9d7f68-5b11-4de5-bb86-9e6526fe2517 HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtPh6WxHk6ZVMRNlpozycJz0NO6OoHPDWTOK5IJPue55hF3EB829TOwvNYKu6sORVhTg1O8C4JRat_r7c_s3b7cXT4ZmuWGHsQ-c9MH-2MSyu1wbBeHDlm03ZahY37mNoLaiJ_mL5p0EjYs2vROcJboy0_KMu944oIf6mLmf-7GCu5tsobjm-qxj9M_dev04440
Content-Length: 28
Content-Type: application/json

{
    "label": "Self care"
}

Note

Changing the text of a label will not remove that label from any clients or professionals who have it. The text associated to the label will just be updated.

Note

You cannot change the identifier of a label. It is attributed by the Minddistrict platform and is immutable.

Deleting a label

To delete a label, send a DELETE request to its API url:

DELETE /api/2/configuration/labels/fd9d7f68-5b11-4de5-bb86-9e6526fe2517 HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABgZBtPh6WxHk6ZVMRNlpozycJz0NO6OoHPDWTOK5IJPue55hF3EB829TOwvNYKu6sORVhTg1O8C4JRat_r7c_s3b7cXT4ZmuWGHsQ-c9MH-2MSyu1wbBeHDlm03ZahY37mNoLaiJ_mL5p0EjYs2vROcJboy0_KMu944oIf6mLmf-7GCu5tsobjm-qxj9M_dev04440

Warning

Deleting a label will permanently remove that label from all clients and professionals who have it. Adding a new label with the same text will not restore it back on those users.