Hardware Device API endpoint
Table of contents
Fields
| Field | Description | 
|---|---|
| id | UUID identificator formatted as a string | 
| name | string [required] [max length: 100; must be unique] | 
| description | string [max length: 500] | 
| supplier | related supplier ID formatted as a string [required] | 
| rrid | Research Resource Identifier (RRID) | 
| rrid_url | URL to RRID lookup page [read-only] | 
| external_identifiers | JSON object containing external identifier information | 
List view
- Allowed portals: public, private
- Request method: GET
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.load_model('hardwaredevice')
Response example
{'hardwaredevices': [
    {
        'id': 'a14cc671-6d21-4688-9772-1d2bf765b793',
        'name': 'RZ5D Processor',
        'description': '',
        'supplier': '56c6f4c3-cf31-48ac-bd16-410123776324'
    },
    {
        'id': '33c67482-af52-44f4-a3ef-6d692512a6ca',
        'name': 'Scout (128ch)',
        'description': '',
        'supplier': 'f309ec90-914b-4382-955e-017bf5d1def1'
    },
    {
        'id': '4d33e7ad-c141-4e9d-bc9c-034c51dcfc5a',
        'name': 'SmartBox (256ch)',
        'description': '',
        'supplier': 'fba48e24-eebf-4b11-a8b9-ac660854d779'
    },
    {
        'id': '3ca40603-b7f0-4d58-8579-d48b3d6e7ad6',
        'name': 'SpikeGLX',
        'description': 'SpikeGLX is a recording system for extracellular neural probes',
        'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08'
    }
]}
Add
- Allowed portals: private
- Request method: POST
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice
- Data: JSON dictionary containing at least the required fields.
- Responses: 201OK;400Bad request;403Not allowed;404Not found
Note: hardwaredevices submissions go through an approval process.
Use example (using Python API)
resp = client.save_model("hardwaredevice",  data={
    'name': 'MyNewHardwareDevice',
    'description': '',
    'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08'}
)
Response example
{'hardwaredevice_approval': {
    'id': '23105f29-f31d-47c8-9cc5-0198222ee7dd',
    'name': 'MyNewHardwareDevice',
    'description': '',
    'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08'}
}
Detail
- Allowed portals: public, private
- Request method: GET
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice/<id>/
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.load_model('hardwaredevice', id='0e6c723c-e5f8-4979-b7f9-e77a3ae4e817')
Response example
{'hardwaredevice': {
    'id': '0e6c723c-e5f8-4979-b7f9-e77a3ae4e817',
    'name': 'MyNewHardwareDevice',
    'description': '',
    'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08'}
}
Change
- Allowed portals: private
- Request method: PATCH
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice/<id>/
- Data: dictionary containing the fields to be updated
- Responses: 200OK;400Bad request;403Not allowed;404Not found
Note: hardwaredevices changes go through an approval process.
Use example (using Python API)
resp = client.save_model("hardwaredevice", id="0e6c723c-e5f8-4979-b7f9-e77a3ae4e817", data={"description": "new text"})
Response example
{'hardwaredevice_approval': {
    'id': 'd10aaf4c-be23-45b2-9f81-ef1d65ca6c32',
    'name': 'MyNewHardwareDevice',
    'description': 'new text',
    'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08'}
}
Delete
- Allowed portals: private
- Request method: DELETE
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice/<id>/
- Data: None
- Responses: 204OK;403Not allowed;404Not found
Note: only administrators can delete Hardware Devices.
Use example (using Python API)
resp = client.delete_model("hardwaredevice", id="0e6c723c-e5f8-4979-b7f9-e77a3ae4e817")
List approvals
- Allowed portals: private
- Request method: GET
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice_approvals
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.load_model('hardwaredeviceapproval')
Response example
{'hardwaredevice_approvals': [
    {
        'id': '23105f29-f31d-47c8-9cc5-0198222ee7dd',
        'name': 'MyNewHardwareDevice',
        'description': '',
        'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08',
        'instance_id': None,
        'action': 'Add',
        'reviewer': None,
        'status': 'Pending'
    },
    {
        'id': 'accd5fe5-6739-4e44-ba24-3910eff01fef',
        'name': '16-Ch Extracellular Differential AC Amplifier Model 3500',
        'description': '123',
        'supplier': '866fda99-0ae7-4aeb-a163-5c2e8a3ed4af',
        'instance_id': '56854ab5-708b-48b2-92a8-3bd84439c1e0',
        'action': 'Change',
        'reviewer': 15,
        'status': 'Accepted'
    }
]}
Detail approval
- Allowed portals: private
- Request method: GET
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice_approvals/<id>/
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.load_model('hardwaredeviceapproval', id='23105f29-f31d-47c8-9cc5-0198222ee7dd')
Response example
{'hardwaredevice_approval': {
    'id': '23105f29-f31d-47c8-9cc5-0198222ee7dd',
    'name': 'MyNewHardwareDevice',
    'description': '',
    'supplier': 'b8146db2-f50e-40c0-9558-1df3586a3b08',
    'instance_id': None,
    'action': 'Add',
    'reviewer': None,
    'status': 'Pending'}
}
Accept approval
- Allowed portals: private
- Request method: PATCH
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice_approvals/<id>/
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.save_model("hardwaredeviceapproval", id="23105f29-f31d-47c8-9cc5-0198222ee7dd", options="accept")
Reject approval
- Allowed portals: private
- Request method: PATCH
- URL: https://www.brainstem.org/api/private/resources/hardwaredevice_approvals/<id>/
- Data: None
- Responses: 200OK;403Not allowed;404Not found
Use example (using Python API)
resp = client.save_model("hardwaredeviceapproval", id="fd7f6132-0527-4310-a9da-9241728a9163", options="reject")