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. |
Setting-dependent | |
labels |
Labels |
Clients don’t see which labels are assigned to them. |
Setting-dependent | |
age |
Age |
- |
Integer |
Required, Read-only |
gender |
Gender |
- |
Choice: |
Required |
date_of_birth |
Date of birth |
- |
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 gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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: 3225
Content-Type: application/json;charset=UTF-8
{
"@items": [
{
"@changes": {
"creation_time": "2020-12-01T08:13:27",
"modification_time": "2020-12-02T00:00:00"
},
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365",
"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/cb7bae66c0104b15ac661931811fe365/preferences/picture/picture/a9c95588ca8f4ba395e196374d512800"
}
},
{
"@changes": {
"creation_time": "2020-12-01T08:13:27",
"modification_time": "2020-12-01T08:13:27"
},
"@type": "http://ns.minddistrict.com/friend",
"@url": "https://customer.minddistrict.com/api/2/c/169a5b27fb204d15bd9d3fa6387713d7",
"active": true,
"email": "fred@example.com",
"name": "Fred Flintstone",
"picture": null
},
{
"@changes": {
"creation_time": "2020-12-01T08:13:27",
"modification_time": "2020-12-01T08:13:28"
},
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/32f1a2e6ad1540ae813259b79c8713a4",
"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-12-01T08:13:28",
"modification_time": "2020-12-01T08:13:28"
},
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/e28b060c89194486ae06eaabb384652a",
"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": 4,
"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 gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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-12-01T08:13:28",
"modification_time": "2020-12-01T08:13:28"
},
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/e28b060c89194486ae06eaabb384652a",
"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 |
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 gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/73d66fd8619241988bdb858f1c9270b6
{
"@changes": {
"creation_time": "2020-12-01T08:13:30",
"modification_time": "2020-12-01T08:13:30"
},
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/73d66fd8619241988bdb858f1c9270b6",
"active": false,
"age": 59,
"date_of_birth": "1961-02-18",
"email": "john@example.com",
"external_source": "35fb5c76bdf446f79aef960da609a39b",
"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/cb7bae66c0104b15ac661931811fe365 HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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-12-01T08:13:27",
"modification_time": "2020-12-02T00:00:00"
},
"@links": [
{
"name": "activation",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/activation"
},
{
"name": "application",
"url": "https://customer.minddistrict.com/api/2"
},
{
"name": "catalogue.selfhelp.items",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/catalogue/items"
},
{
"name": "diary",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/diary"
},
{
"name": "diary.configuration",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/diary/configuration"
},
{
"name": "diary.entries",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/diary/entries"
},
{
"name": "diary.entries.items",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/diary/entries/items"
},
{
"name": "diary.entries.schemas",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/diary/entries/schemas"
},
{
"name": "planning",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/planning"
},
{
"name": "planning.ics",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/planning/ics"
},
{
"name": "planning.items",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/planning/items"
},
{
"name": "relations",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/relations"
},
{
"name": "relations.items",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/relations/items"
},
{
"name": "tasks",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/tasks"
},
{
"name": "tasks.items",
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/tasks/items"
}
],
"@type": "http://ns.minddistrict.com/client",
"@url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365",
"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/cb7bae66c0104b15ac661931811fe365/preferences/picture/picture/a9c95588ca8f4ba395e196374d512800"
}
}
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/cb7bae66c0104b15ac661931811fe365 HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/cb7bae66c0104b15ac661931811fe365/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/cb7bae66c0104b15ac661931811fe365/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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: |
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/cb7bae66c0104b15ac661931811fe365/activation HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/cb7bae66c0104b15ac661931811fe365/merge HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsqMvSZEjjS_KUVrDT1vFD-8Uer2suLv7WudYevQ4-b4KFk9JlinFKGLmcNkvhjrt_woaLqBbjdiO1Mx5Cn-M96GXMqsafOPNYWNTgy5K2uexHc5DRHNRPntGnDVQNB5B7NzyOTpWY9wJkH6vdBHYqGnx0tQHVQYjODwixfvhuQw3vz0jBbHvR2-TDc5ZqCrasC
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: |
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
a client under the name
relations.items
;the client’s relations container under the name
items
.
Example request:
GET /api/2/c/cb7bae66c0104b15ac661931811fe365/relations/items HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsnijSVf9Tfcer0JhzekIF--SYw4ckwGJXCHGVX6LJAEZkTj6HOs3gGH8OsvcZ4PLSJp-x68spXU3S0xKlEvN5U5ECJx4EdyV7mQUOOhtxfyXfI5wHbL0x3KvizNUMGkFwYgsUvWLMZg7WVvvCuyH_XMlA3LLK4Rvmel0ZRR4CSJ_D1sOCblhrx6Ku3wHmKoeiE
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/cb7bae66c0104b15ac661931811fe365/relations/002f914749344fdd8909aeb124b5514e",
"client": {
"@type": "http://ns.minddistrict.com/user-reference/client",
"id": null,
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365"
},
"predicate": "attends",
"professional": {
"@type": "http://ns.minddistrict.com/user-reference/professional",
"id": null,
"url": "https://customer.minddistrict.com/api/2/p/35fb5c76bdf446f79aef960da609a39b"
}
}
],
"@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/cb7bae66c0104b15ac661931811fe365/relations HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/cb7bae66c0104b15ac661931811fe365/relations/034e8954a5624d778149e13a23bcc1e9
{
"@type": "http://ns.minddistrict.com/relation",
"@url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/relations/034e8954a5624d778149e13a23bcc1e9",
"client": {
"@type": "http://ns.minddistrict.com/user-reference/client",
"id": null,
"url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365"
},
"predicate": "attends",
"professional": {
"@type": "http://ns.minddistrict.com/user-reference/professional",
"id": "p1234",
"url": "https://customer.minddistrict.com/api/2/p/064f0d41ca2548fcb2ecdfebd70d6438"
}
}
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/cb7bae66c0104b15ac661931811fe365/relations/002f914749344fdd8909aeb124b5514e HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsoGR1vEpJy1YxruDLmSE4j8aygZJM2ub-VkHaqu6feWX5kg4xGxpki5IBDsBZ-IZ5yNUp-7h4sJWgkPGB7URUflP5COCD2VKrZhVju7FS6tsfRwQUJ-9U9ITuEZyHxAIA7XMbRLZmPx-EJ8Gtmojya_bzmFwFXbX40YYtQHl4GXTV7lBY1aMwRfDewbzCeEkG8
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/cb7bae66c0104b15ac661931811fe365/relations HTTP/1.1
Host: customer.minddistrict.com
Accept: application/json
Authorization: md-token gAAAAABfxfsnijSVf9Tfcer0JhzekIF--SYw4ckwGJXCHGVX6LJAEZkTj6HOs3gGH8OsvcZ4PLSJp-x68spXU3S0xKlEvN5U5ECJx4EdyV7mQUOOhtxfyXfI5wHbL0x3KvizNUMGkFwYgsUvWLMZg7WVvvCuyH_XMlA3LLK4Rvmel0ZRR4CSJ_D1sOCblhrx6Ku3wHmKoeiE
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/cb7bae66c0104b15ac661931811fe365/relations/items"
}
],
"@type": "http://ns.minddistrict.com/relations/client",
"@url": "https://customer.minddistrict.com/api/2/c/cb7bae66c0104b15ac661931811fe365/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 gAAAAABfxfsqpTEgwXQmWb6a1cMiWY9Hi4w7cDKpmXCjOQruO8yC6jZQLkUxTmvuNYjp88Ue4Zmc8if0E8tRbN-XT1uERctRob-LxzbAM6mARqZmJ8W9MfEkYup8lSgnbxY1PQpykH3mfMW2KBpew8uT_HT1VKdROMtyxcwuokxhqUYeGQ0VymK3sMxUda-lJTaYczH9ECFy
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/1606810410194691",
"datetime": "2020-12-01T08:13:30",
"extra": [
{
"message": "649144a2e9be49a8bdb40a30c361bdfc",
"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": "2754ff361aa74e028b3b069f6854c5ee"
},
{
"@type": "http://ns.minddistrict.com/error/record",
"@url": "https://customer.minddistrict.com/api/2/configuration/clientaccess/accesslog/1606810410194678",
"datetime": "2020-12-01T08:13:30",
"extra": [
{
"message": "649144a2e9be49a8bdb40a30c361bdfc",
"name": "client-id"
},
{
"message": "I needed emergency access to the client dossier",
"name": "motivation"
}
],
"message": "Temporary access obtained",
"user_id": "2754ff361aa74e028b3b069f6854c5ee"
},
{
"@type": "http://ns.minddistrict.com/error/record",
"@url": "https://customer.minddistrict.com/api/2/configuration/clientaccess/accesslog/1606810410194634",
"datetime": "2020-12-01T08:13:30",
"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": "2754ff361aa74e028b3b069f6854c5ee"
}
],
"@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 |
- |
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.