Setup API endpoint
  Table of contents
- Fields
- List view
- Add
- Detail
- Change
- Delete
  Fields
| Field | Description | 
|---|
| id | UUID identificator formatted as a string | 
| name | string [required] [max length: 50] | 
| location | string describing the location of the setup | 
| description | string [max length: 500] | 
| setup_type | related environment type ID formatted as a string [required] | 
| specifications | JSON array describing setup specifications | 
| is_public | boolean | 
  List view
- Allowed portals: public, private
- Request method: GET
- URL: https://www.brainstem.org/api/private/personal_attributes/setup
- Data: None
- Responses: 200OK;403Not allowed;404Not found
  Use example (using Python API)
resp = client.load_model('setup')
  Response example
{'setups': [
    {
        'id': '58e0003d-16c2-4264-913d-288463c0356d',
        'name': 'Head-fixed wheel',
        'location': 'Lab Room 101',
        'description': '',
        'setup_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
        'specifications': [
            {'name': 'Radius', 'value': 12, 'description': 'cm'}
        ],
        'is_public': False
    },
    {
        'id': '3e9ec0e0-d685-42ec-8386-0fa24602a73e',
        'name': 'Maze setup',
        'location': 'Lab Room 102',
        'description': '',
        'setup_type': 'e1f14b91-e507-48c1-bfec-c68d7db9c166',
        'specifications': {},
        'is_public': True
    }
]}
  Add
- Allowed portals: private
- Request method: POST
- URL: https://www.brainstem.org/api/private/personal_attributes/setup
- Data: JSON dictionary containing at least the required fields.
- Responses: 201OK;400Bad request;403Not allowed;404Not found
  Use example (using Python API)
resp = client.save_model("setup",  data=
    {
        'name': 'MyNewEnv',
        'location': 'Lab Room 103',
        'description': '',
        'setup_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
        'specifications': {
            'Length': 100,
            'Width': '30 cm'
        },
        'is_public': False
    }
)
  Response example
{'setup': {
    'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
    'name': 'MyNewEnv',
    'location': 'Lab Room 103',
    'description': '',
    'setup_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
    'specifications': {
        'Length': 100,
        'Width': '30 cm'
    },
    'is_public': False}
}
  Detail
- Allowed portals: public, private
- Request method: GET
- URL: https://www.brainstem.org/api/private/personal_attributes/setup/<id>/
- Data: None
- Responses: 200OK;403Not allowed;404Not found
  Use example (using Python API)
resp = client.load_model('setup', id='d0ada97d-8607-48da-817b-bdd54bc9077b')
  Response example
{'setup': {
    'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
    'name': 'MyNewEnv',
    'location': 'Lab Room 103',
    'description': '',
    'setup_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
    'specifications': {
        'Length': 100,
        'Width': '30 cm'
    },
    'is_public': False}
}
  Change
- Allowed portals: private
- Request method: PATCH
- URL: https://www.brainstem.org/api/private/personal_attributes/setup/<id>/
- Data: dictionary containing the fields to be updated
- Responses: 200OK;400Bad request;403Not allowed;404Not found
  Use example (using Python API)
resp = client.save_model("setup", id="d0ada97d-8607-48da-817b-bdd54bc9077b", data={"description": "new text"})
  Response example
{'setup': {
    'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
    'name': 'MyNewEnv',
    'description': 'new text',
    'setup_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
    'specifications': {
        'Length': 100,
        'Width': '30 cm'
    },
    'is_public': False}
}
  Delete
- Allowed portals: private
- Request method: DELETE
- URL: https://www.brainstem.org/api/private/personal_attributes/setup/<id>/
- Data: None
- Responses: 204OK;403Not allowed;404Not found
  Use example (using Python API)
resp = client.delete_model("setup", id="d0ada97d-8607-48da-817b-bdd54bc9077b")