Client API

The Minddistrict API to access and modify client data is accessible under the sub-URL /c of the API.

Client JSON object

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

Name Value Explanation Value type Notes
first_name First name - String Required
infix Infix - String  
last_name Last name - String Required
active Active Uncheck to deactivate the user acount. The user can not log in to the platform as long as the account is inactive. Boolean Required
external_source External source of information Name of the external information source or API user identifier. Can be empty. Should not be set by users nor API interaction. Based on this value and the corresponding configuration setting manual updates can be disallowed. String Read-only
email Email address The email address is used as login name for the platform. It should be unique in the platform. It may not contain uppercase characters. String Required
picture Profile picture You can upload a profile picture. File Setting-dependent
labels Labels Clients don’t see which labels are assigned to them. List of labels Setting-dependent
age Age - Integer Required, Read-only
gender Gender - Choice: m, f, other or unknown Required
date_of_birth Date of birth - Date Required, Setting-dependent
phone_number Telephone number - String Setting-dependent
id Client ID ID of the client, should be unique in the platform. String Setting-dependent
bsn BSN BSN of the client, should be unique in the platform. String Setting-dependent
name Name - String Required, Read-only

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

Listing clients

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

GET /api/2/c/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la

The response will be a list of client objects:

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

{
    "@items": [
        {
            "@changes": {
                "creation_time": "2020-08-06T12:31:26",
                "modification_time": "2020-08-07T00:00:00"
            },
            "@type": "http://ns.minddistrict.com/client",
            "@url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd",
            "active": true,
            "age": 50,
            "date_of_birth": "1970-01-01",
            "email": "wendy@example.com",
            "external_source": null,
            "first_name": "Wendy",
            "gender": "f",
            "infix": "",
            "labels": [
                "be6e40f0-a3b4-486b-a1c7-f9b97b483b00"
            ],
            "last_name": "Darling",
            "name": "Wendy Darling",
            "picture": {
                "@type": "link",
                "content_type": "image/jpeg",
                "filename": "../../fixtures/profile.jpg",
                "size": 4488,
                "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/preferences/picture/picture/5c97e29fd34445ac9364052666656f63"
            }
        },
        {
            "@changes": {
                "creation_time": "2020-08-06T12:31:26",
                "modification_time": "2020-08-06T12:31:26"
            },
            "@type": "http://ns.minddistrict.com/client",
            "@url": "https://customer.minddistrict.com/api/2/c/ca7778da31274fcf95cb260a347ec604",
            "active": true,
            "age": 50,
            "date_of_birth": "1970-01-01",
            "email": "michael@example.com",
            "external_source": null,
            "first_name": "Micha\u00ebl",
            "gender": "m",
            "infix": "",
            "labels": null,
            "last_name": "Darling",
            "name": "Micha\u00ebl Darling",
            "picture": null
        },
        {
            "@changes": {
                "creation_time": "2020-08-06T12:31:26",
                "modification_time": "2020-08-06T12:31:27"
            },
            "@type": "http://ns.minddistrict.com/client",
            "@url": "https://customer.minddistrict.com/api/2/c/8e885770beef44f4a3aee8d99043f7f4",
            "active": true,
            "age": 50,
            "date_of_birth": "1970-01-01",
            "email": "gwendoline@example.com",
            "external_source": null,
            "first_name": "Gwendoline",
            "gender": "f",
            "infix": "",
            "labels": null,
            "last_name": "Darling",
            "name": "Gwendoline Darling",
            "picture": null
        }
    ],
    "@links": [],
    "@paging": {
        "found": 3,
        "limit": null,
        "start": null,
        "total": null
    }
}

Clients search API

A simple search API is available on the client items endpoint. To search send a POST request to the API base URL with c/items appended. Put the JSON encoded search query parameters in the body of the request:

POST /api/2/c/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 41
Content-Type: application/json

{
    "email": "gwendoline@example.com"
}

The response will be a list of client objects:

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

{
    "@items": [
        {
            "@changes": {
                "creation_time": "2020-08-06T12:31:26",
                "modification_time": "2020-08-06T12:31:27"
            },
            "@type": "http://ns.minddistrict.com/client",
            "@url": "https://customer.minddistrict.com/api/2/c/8e885770beef44f4a3aee8d99043f7f4",
            "active": true,
            "age": 50,
            "date_of_birth": "1970-01-01",
            "email": "gwendoline@example.com",
            "external_source": null,
            "first_name": "Gwendoline",
            "gender": "f",
            "infix": "",
            "labels": null,
            "last_name": "Darling",
            "name": "Gwendoline Darling",
            "picture": null
        }
    ],
    "@links": [],
    "@paging": {
        "found": 1,
        "limit": null,
        "start": null,
        "total": null
    }
}

The allowed parameters are listed below. All parameters are optional.

Name Value Value type Notes
start   Integer  
limit   Integer  
active active Boolean  
bsn bsn String  
email email String  
id client id String  

Multiple parameters will be “AND”ed together. Currently you cannot search for items that have no value set for given parameter. This might change in at a later stage.

Adding a new client

To add a client send a POST request to the API base URL with /c appended. Put the JSON encoded data for the new client in the body of the request:

POST /api/2/c HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 164
Content-Type: application/json

{
    "active": false,
    "date_of_birth": "1961-02-18",
    "email": "john@example.com",
    "first_name": "John",
    "gender": "m",
    "last_name": "Darling"
}

The response will return the newly created client object:

HTTP/1.0 201 Created
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 588
Content-Type: application/json;charset=UTF-8
Location: https://customer.minddistrict.com/api/2/c/9d6394b767f0499bae9e6949fe913048

{
    "@changes": {
        "creation_time": "2020-08-06T12:31:29",
        "modification_time": "2020-08-06T12:31:29"
    },
    "@type": "http://ns.minddistrict.com/client",
    "@url": "https://customer.minddistrict.com/api/2/c/9d6394b767f0499bae9e6949fe913048",
    "active": false,
    "age": 59,
    "date_of_birth": "1961-02-18",
    "email": "john@example.com",
    "external_source": "a320f45c8a984fb4bd1ccc5cbce52c60",
    "first_name": "John",
    "gender": "m",
    "infix": "",
    "labels": null,
    "last_name": "Darling",
    "name": "John Darling",
    "picture": null
}

If the active flag was set to true, a welcome email will be sent to the client. If the flag was false, no email will be sent and the client will not be able to access the Minddistrict platform.

View a client

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

GET /api/2/c/93cf33d293b9448aa666d984d5a937fd HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la

The response will be the corresponding client object:

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

{
    "@changes": {
        "creation_time": "2020-08-06T12:31:26",
        "modification_time": "2020-08-07T00:00:00"
    },
    "@links": [
        {
            "name": "activation",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/activation"
        },
        {
            "name": "application",
            "url": "https://customer.minddistrict.com/api/2"
        },
        {
            "name": "catalogue.selfhelp.items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/catalogue/items"
        },
        {
            "name": "diary",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/diary"
        },
        {
            "name": "diary.configuration",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/diary/configuration"
        },
        {
            "name": "diary.entries",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/diary/entries"
        },
        {
            "name": "diary.entries.items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/diary/entries/items"
        },
        {
            "name": "diary.entries.schemas",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/diary/entries/schemas"
        },
        {
            "name": "planning",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/planning"
        },
        {
            "name": "planning.ics",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/planning/ics"
        },
        {
            "name": "planning.items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/planning/items"
        },
        {
            "name": "relations",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations"
        },
        {
            "name": "relations.items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/items"
        },
        {
            "name": "tasks",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/tasks"
        },
        {
            "name": "tasks.items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/tasks/items"
        }
    ],
    "@type": "http://ns.minddistrict.com/client",
    "@url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd",
    "active": true,
    "age": 50,
    "date_of_birth": "1970-01-01",
    "email": "wendy@example.com",
    "external_source": null,
    "first_name": "Wendy",
    "gender": "f",
    "infix": "",
    "labels": [
        "be6e40f0-a3b4-486b-a1c7-f9b97b483b00"
    ],
    "last_name": "Darling",
    "name": "Wendy Darling",
    "picture": {
        "@type": "link",
        "content_type": "image/jpeg",
        "filename": "../../fixtures/profile.jpg",
        "size": 4488,
        "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/preferences/picture/picture/5c97e29fd34445ac9364052666656f63"
    }
}

This endpoint is also reachable via auxiliary URLs.

Editing a client

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

PATCH /api/2/c/93cf33d293b9448aa666d984d5a937fd HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 29
Content-Type: application/json

{
    "first_name": "James"
}

Please refer to Activating a client to change the active flag of a client.

This endpoint is also reachable via auxiliary URLs.

Activating a client

To activate or deactivate a client send a POST request to the URL of the client with /activation appended. Insert a JSON object in the body of the request with the relevant attributes:

POST /api/2/c/93cf33d293b9448aa666d984d5a937fd/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 23
Content-Type: application/json

{
    "active": false
}

When activating a client the parameter send_email controls whether and what kind of email will be sent. For a value of no no email is sent. For a value of welcome a welcome email is sent: this is the same email a client gets when they are added to the platform for the first time. For a value of activation an email will be sent that simply tells the client that their account has been activated.:

POST /api/2/c/93cf33d293b9448aa666d984d5a937fd/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 51
Content-Type: application/json

{
    "active": true,
    "send_email": "welcome"
}

The activation endpoint accepts the following parameters in the body of its request:

Name Value Value type Notes
active active Boolean Required
send_email Type of (de)activation message. Choice: activation, welcome or no  

When deactivating a client by default an email is sent to the client informing them of the deactivation. When the send_email parameter is passed with a value of no such an email is not sent.:

POST /api/2/c/93cf33d293b9448aa666d984d5a937fd/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 47
Content-Type: application/json

{
    "active": false,
    "send_email": "no"
}

When a request is sent to activate a client who is already active, nothing happens, and the response has a 400 (error) status code. An email is also not sent.

When a request is sent to deactivate a client who is already inactive, nothing happens, and the response has a 400 (error) status code. An email is also not sent.

Merging clients

To merge one client into another send a POST request to the URL of the client you want to keep with /merge appended. The body of the request should be a client reference (given by either the id or canonical URL) to the client you want to have merged into the first client:

POST /api/2/c/93cf33d293b9448aa666d984d5a937fd/merge HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_ghFrm0RR0ctVzjBhNUKtxXxnZDywf6tmCznLCn2htwu-sZClRh85ORADky-jQtJOio-VpuY-onudQfxVUNmOK6yWlbIJobOHAhZJlrtNhMGI8_1XEDWwxKjUz4-j7i3EL2YC62HRyHtrkp9F0CPnSxsnmHLfTiJoboukcMNkhpPu1SOICd0CKldhF5IzBXwKD_
Content-Length: 22
Content-Type: application/json

{
    "id": "123abc"
}

The client whose id or url is passed in will be completely merged into the client whose URL the request is sent to. All the tools will be transferred to the latter and that client will be the only one remaining.

Client/professional relations

The Client Relations API allows you to manage the relations a client has with various professionals. This has multiple effects within the Minddistrict platform; in particular privacy-sensitive information about a client is generally only visible to related professionals, and related professionals may get assigned tasks specific to that client.

A professional can have two types of relations with a client: attends and supervises. When a professional is a therapist treating the client an attends relation should be used. When a professional does not treat the client themself but needs to supervise the treatment a supervises relation should be used. Some organisations may have no use for the supervises relation.

A relation is a JSON object with the following keys:

Name Value Value type
professional Related professional JSON object
client Related client JSON object
predicate The type of relation Choice: attends or supervises

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

The json object professional contains:

Name Value Value type
id ID String
url Canonical URL of the user String

The json object client contains:

Name Value Value type
id ID String
url Canonical URL of the user String

Listing client/professional relations

To view the relations a client has with professionals, send a GET request to the relations.items URL. This URL is discoverable in the @links metadata of

Example request:

GET /api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_geVOSzmMlLOlTh9zB1rq1ODnHli5-YaNE8LyFNaEBJtDrX1OL9JD45cNV_ntFR2F52FliGGId1ncsNjTTJZA9Wa9SNGcPwqCwKMdjgZiXCzQpfdN5Vn1sdLSEl4ZI_zV-6Bic-al8S-tm8ghCPC79wTj_0RPl_zO_GzJLPw7cKyHGpuDf9BRFyzZLMjupxhBiE

The response will be the list of relations the client has with professionals:

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

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/relation",
            "@url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/6aab7e89683c4c84ac6f8eca4971c30e",
            "client": {
                "@type": "http://ns.minddistrict.com/user-reference/client",
                "id": null,
                "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd"
            },
            "predicate": "attends",
            "professional": {
                "@type": "http://ns.minddistrict.com/user-reference/professional",
                "id": null,
                "url": "https://customer.minddistrict.com/api/2/p/a320f45c8a984fb4bd1ccc5cbce52c60"
            }
        }
    ],
    "@links": []
}

Relating a client to a professional

To relate a client to a particular professional, send a POST request to the client’s relations URL. This URL is discoverable in the @links metadata of a client under the name relations.

Specify the relation type ("attends" or "supervises") and the professional to be related (with a professional reference) in the body of the request.

Warning

It is not possible to create multiple relations for the same combination of client, professional and predicate.

The following query:

POST /api/2/c/93cf33d293b9448aa666d984d5a937fd/relations HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la
Content-Length: 133
Content-Type: application/json

{
    "@type": "http://ns.minddistrict.com/relation",
    "predicate": "attends",
    "professional": {
        "id": "p1234"
    }
}

The response will be the relation that was created:

HTTP/1.0 201 Created
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 638
Content-Type: application/json;charset=UTF-8
Location: https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/97636f00c74b4b81afb0c6d9d351dcdb

{
    "@type": "http://ns.minddistrict.com/relation",
    "@url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/97636f00c74b4b81afb0c6d9d351dcdb",
    "client": {
        "@type": "http://ns.minddistrict.com/user-reference/client",
        "id": null,
        "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd"
    },
    "predicate": "attends",
    "professional": {
        "@type": "http://ns.minddistrict.com/user-reference/professional",
        "id": "p1234",
        "url": "https://customer.minddistrict.com/api/2/p/966c738bd1ca4cc98ed542c49b85d73a"
    }
}

When the relation can not be created, an error message is returned:

HTTP/1.0 400 Bad Request
Content-Length: 59
Content-Type: application/json;charset=UTF-8

{
    "code": 400,
    "message": "Invalid new relation."
}

Removing a client/professional relation

To remove the relation between a client and a professional, send a DELETE request to the relation’s URL. You can find the relation in the client’s relations list.

Example request:

DELETE /api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/6aab7e89683c4c84ac6f8eca4971c30e HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_gfNOKERNV-96Q2j0g9CMlKEivHs1NI7bs0KeA8FtTKOrPbRTRXBe2he2dNoR4i1X2Kv2kAuypRJM2YgohYL4H4crbsBPm2YCbMuJFHPs8nauHqwHy5Xg0a37PLfy0cUtiOPt7JZn-aTUCarpgMFwndSihEb2kg-1DqPKOabGKYseeWU_aLV32Z4l4OUxHR00la

The response will be an HTTP 204 No Content:

HTTP/1.0 204 No Content
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Content-Length: 0
Content-Type: text/plain;charset=UTF-8

Relations metadata

To view metadata about the client’s relations container, send a GET request to the relations URL. This URL is discoverable in the @links metadata of

  • a client under the name relations.

Example request:

GET /api/2/c/93cf33d293b9448aa666d984d5a937fd/relations HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_geVOSzmMlLOlTh9zB1rq1ODnHli5-YaNE8LyFNaEBJtDrX1OL9JD45cNV_ntFR2F52FliGGId1ncsNjTTJZA9Wa9SNGcPwqCwKMdjgZiXCzQpfdN5Vn1sdLSEl4ZI_zV-6Bic-al8S-tm8ghCPC79wTj_0RPl_zO_GzJLPw7cKyHGpuDf9BRFyzZLMjupxhBiE

Will trigger this result:

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

{
    "@links": [
        {
            "name": "items",
            "url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations/items"
        }
    ],
    "@type": "http://ns.minddistrict.com/relations/client",
    "@url": "https://customer.minddistrict.com/api/2/c/93cf33d293b9448aa666d984d5a937fd/relations"
}

Client access log

Information about access to dossiers of clients not in the caseload of the professional is recorded in the “client access log”. This includes searches outside of the professional’s caseload and temporary access requests. The information for the client access log is transferred as json objects containing the following information:

Example request:

GET /api/2/configuration/clientaccess/accesslog/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfK_ghl7LTmc5VHRKFD0t7XYrmYKuN0Jkc3SXeyUQYyjAcW7xYDn2f6RM6QQJQBw0ZCZ8-NTd3PvfNPFhwEj62CqwS1v_mxUwN_BxYaQ5al7rL2PkxEKRNUY7Lmv-IhENgOUFK7D5KD7znP6GcS11rJjkK2daSQDmIsUVJKLnj3_pdIZcksO5RM5GW8V3gBBKjfu3m

The response will be a list of log record objects:

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

{
    "@items": [
        {
            "@type": "http://ns.minddistrict.com/error/record",
            "@url": "https://customer.minddistrict.com/api/2/configuration/clientaccess/accesslog/1596717089075824",
            "datetime": "2020-08-06T12:31:29",
            "extra": [
                {
                    "message": "69a7ff0a90d94091b455fb48c0651aec",
                    "name": "client-id"
                },
                {
                    "message": "directly related",
                    "name": "type"
                },
                {
                    "message": "My colleague cannot handle this patient, I will take over",
                    "name": "intention"
                }
            ],
            "message": "Therapist related themself, or requested a relation",
            "user_id": "f0fd18db5361463780df20586ad9414a"
        },
        {
            "@type": "http://ns.minddistrict.com/error/record",
            "@url": "https://customer.minddistrict.com/api/2/configuration/clientaccess/accesslog/1596717089075812",
            "datetime": "2020-08-06T12:31:29",
            "extra": [
                {
                    "message": "69a7ff0a90d94091b455fb48c0651aec",
                    "name": "client-id"
                },
                {
                    "message": "I needed emergency access to the client dossier",
                    "name": "motivation"
                }
            ],
            "message": "Temporary access obtained",
            "user_id": "f0fd18db5361463780df20586ad9414a"
        },
        {
            "@type": "http://ns.minddistrict.com/error/record",
            "@url": "https://customer.minddistrict.com/api/2/configuration/clientaccess/accesslog/1596717089075767",
            "datetime": "2020-08-06T12:31:29",
            "extra": [
                {
                    "message": "Emergency situation, I need to find the patient",
                    "name": "motivation"
                },
                {
                    "message": "{\"motivation\": \"Foobar\", \"term1\": \"value1\", \"term2\": 2001, \"term3\": true, \"professional\": \"theo@example.com\"}",
                    "name": "query"
                }
            ],
            "message": "Search outside of caseload",
            "user_id": "f0fd18db5361463780df20586ad9414a"
        }
    ],
    "@links": [],
    "@paging": {
        "found": 3,
        "limit": null,
        "start": null,
        "total": 3
    }
}

Log record JSON object

Name Value Explanation Value type Notes
datetime When this error happened - Date with time Required
user_id Internal user ID who triggered this error - String Required
message Error message - String Required
extra Extra information - List of mapping  

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

Note

Access to the temporary access log API requires the API errors role for the API user.