Experimental 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] |
description | string [max length: 500] |
environment_type | related environment type ID formatted as a string [required] |
physical_dimensions_json | JSON dictionary |
is_public | boolean |
List view
- Allowed portals: public, private, super
- Request method: GET
- URL: https://www.brainstem.org/api/private/personal_attributes/experimentalsetup
- Data: None
- Responses:
200
OK; 403
Not allowed; 404
Not found
Use example (using Python API)
resp = client.load_model('experimentalsetup')
Response example
{'experimentalsetups': [
{
'id': '58e0003d-16c2-4264-913d-288463c0356d',
'name': 'Head-fixed wheel',
'description': '',
'environment_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
'physical_dimensions_json': [
{'name': 'Radius', 'value': 12, 'description': 'cm'}
],
'is_public': False
},
{
'id': '3e9ec0e0-d685-42ec-8386-0fa24602a73e',
'name': "Mino's Maze",
'description': '',
'environment_type': 'e1f14b91-e507-48c1-bfec-c68d7db9c166',
'physical_dimensions_json': [],
'is_public': True
}
]}
Add
- Allowed portals: private, super
- Request method: POST
- URL: https://www.brainstem.org/api/private/personal_attributes/experimentalsetup
- Data: JSON dictionary containing at least the required fields.
- Responses:
201
OK; 400
Bad request; 403
Not allowed; 404
Not found
Use example (using Python API)
resp = client.save_model("experimentalsetup", data=
{
'name': 'MyNewEnv',
'description': '',
'environment_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
'physical_dimensions_json': [
{'name': 'Length', 'value': 100, 'description': 'yards'}
],
'is_public': False
}
)
Response example
{'experimentalsetup': {
'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
'name': 'MyNewEnv',
'description': '',
'environment_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
'physical_dimensions_json': [
{'name': 'Length', 'value': 100, 'description': 'yards'}
],
'is_public': False}
}
Detail
- Allowed portals: public, private, super
- Request method: GET
- URL: https://www.brainstem.org/api/private/personal_attributes/experimentalsetup/<id>/
- Data: None
- Responses:
200
OK; 403
Not allowed; 404
Not found
Use example (using Python API)
resp = client.load_model('experimentalsetup', id='d0ada97d-8607-48da-817b-bdd54bc9077b')
Response example
{'experimentalsetup': {
'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
'name': 'MyNewEnv',
'description': '',
'environment_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
'physical_dimensions_json': [
{'name': 'Length', 'value': 100, 'description': 'yards'}
],
'is_public': False}
}
Change
- Allowed portals: private, super
- Request method: PATCH
- URL: https://www.brainstem.org/api/private/personal_attributes/experimentalsetup/<id>/
- Data: dictionary containing the fields to be updated
- Responses:
200
OK; 400
Bad request; 403
Not allowed; 404
Not found
Use example (using Python API)
resp = client.save_model("experimentalsetup", id="d0ada97d-8607-48da-817b-bdd54bc9077b", data={"description": "new text"})
Response example
{'experimentalsetup': {
'id': 'd0ada97d-8607-48da-817b-bdd54bc9077b',
'name': 'MyNewEnv',
'description': 'new text',
'environment_type': '78dc6c02-dcb0-4a31-a035-a358c7ee9e79',
'physical_dimensions_json': [
{'name': 'Length', 'value': 100, 'description': 'yards'}
],
'is_public': False}
}
Delete
- Allowed portals: private, super
- Request method: DELETE
- URL: https://www.brainstem.org/api/private/personal_attributes/experimentalsetup/<id>/
- Data: None
- Responses:
204
OK; 403
Not allowed; 404
Not found
Use example (using Python API)
resp = client.delete_model("experimentalsetup", id="d0ada97d-8607-48da-817b-bdd54bc9077b")