/1/clients - POST
Overview
The /1/clients endpoint provides for creation of new clients. Â For each separate client that creates a VB-Mapp a new client must be created.
Reqiured Headers
- Authorization: Token token="<your session token here>"
- User-Agent: dmtd-rest-api
- Content-Type: application/json
Fields
Field | Type | Optional | Description |
---|---|---|---|
id | 32-bit Integer | N/A | Unique client identifier |
code | String | Optional | A unique code that correlates the student to an external database and/or obfuscates the student's name |
date_of_birth | Date | Required | date of birth of the client |
diagnosis | String | Optional | |
first_name | String | Optional | |
last_name | String | Optional | |
gender | 32-bit Integer | Required | 1 = male, 2 = female |
organization_id | 32-bit Integer | Required | An id the identifies the organization that the client is created for. |
settings | String | Optional | Any information associated with the client |
Example
curl -X POST \
-H 'Authorization: Token token="9319224d0002e7a32b26c0686c42a0bf"' \
-H "Accept: application/json" \
-H "User-Agent: dmtd-rest-api" \
-H "Content-Type: application/json" \
-d '{ "object" : { "code" : "unique code 3", "date_of_birth" : "2014-01-01", "gender" : 1, "organization_id" : 1, "settings" : "anything you want here" } }' \
https://api-sandbox.datamtd.com/1/clients
Response
{ "response": { "id": 439, "organization_id": 1, "code": "unique code 3", "date_of_birth": "2014-01-01", "diagnosis": null, "first_name": null, "gender": 1, "last_name": null, "created_at": "2015-05-06T14:56:53.729Z", "updated_at": "2015-05-06T14:56:53.729Z", "settings": "anything you want here", "color": null } }