/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

FieldTypeOptionalDescription
id32-bit IntegerN/AUnique client identifier
codeStringOptionalA unique code that correlates the student to an external database and/or obfuscates the student's name
date_of_birthDateRequireddate of birth of the client
diagnosisStringOptional
first_nameStringOptional
last_nameStringOptional
gender32-bit IntegerRequired1 = male, 2 = female
organization_id32-bit IntegerRequiredAn id the identifies the organization that the client is created for.
settingsStringOptionalAny 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
  }
}