Behavioral paradigm API endpoint

Table of contents

  1. Fields
  2. List view
  3. Add
  4. Detail
  5. Change
  6. Delete

Fields

FieldDescription
idUUID identificator formatted as a string
namestring [required] [max length: 50]
descriptionstring [max length: 500]
taskstring [max length: 100]
rewardstring [max length: 100]
sensory_stimulus_typerelated sensory stimulus type ID formatted as a string
setup_typerelated environment type ID formatted as a string [required]
is_publicboolean

List view

  • Allowed portals: public, private, super
  • Request method: GET
  • URL: https://www.brainstem.org/api/private/personal_attributes/behavioralparadigm
  • Data: None
  • Responses: 200 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.load_model('behavioralparadigm')

Response example

{'behavioralparadigms': [
    {
        'id': 'febe36f7-4769-496d-bb91-6a8443214b94',
        'name': 'AlternationRunning',
        'description': '12',
        'task': "run",
        'reward': None,
        'setup_type': '531b2a21-ab1f-4aa8-8eaf-905421168d6b',
        'sensory_stimulus_type': None
    },
    {
        'id': 'f7bc834e-761c-4147-a3d4-da52293a565c',
        'name': 'ContinuousRunning',
        'description': '',
        'task': "run",
        'reward': None,
        'setup_type': '8e9c4d33-f59c-45ca-8e43-f01789f20332',
        'sensory_stimulus_type': 'b1912fcf-14dd-4b3b-b779-2d076df50150'
    }
]}

Add

  • Allowed portals: private, super
  • Request method: POST
  • URL: https://www.brainstem.org/api/private/personal_attributes/behavioralparadigm
  • 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("behavioralparadigm",  data=
    {
        'name': 'PlayMarioKart',
        'task': "Play Mario Kart on GameCube",
        'setup_type': '8e9c4d33-f59c-45ca-8e43-f01789f20332',
    }
)

Response example

{'behavioralparadigm': {
    'id': '22ae80be-e030-4cee-9cd5-b94ac2edc7f8',
    'name': 'PlayMarioKart',
    'description': '',
    'task': 'Play Mario Kart on GameCube',
    'reward': None,
    'setup_type': '8e9c4d33-f59c-45ca-8e43-f01789f20332',
    'sensory_stimulus_type': None}
}

Detail

  • Allowed portals: public, private, super
  • Request method: GET
  • URL: https://www.brainstem.org/api/private/personal_attributes/behavioralparadigm/<id>/
  • Data: None
  • Responses: 200 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.load_model('behavioralparadigm', id='22ae80be-e030-4cee-9cd5-b94ac2edc7f8')

Response example

{'behavioralparadigm': {
    'id': '22ae80be-e030-4cee-9cd5-b94ac2edc7f8',
    'name': 'PlayMarioKart',
    'description': '',
    'task': 'Play Mario Kart on GameCube',
    'reward': None,
    'setup_type': '8e9c4d33-f59c-45ca-8e43-f01789f20332',
    'sensory_stimulus_type': None}
}

Change

  • Allowed portals: private, super
  • Request method: PATCH
  • URL: https://www.brainstem.org/api/private/personal_attributes/behavioralparadigm/<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("behavioralparadigm", id="22ae80be-e030-4cee-9cd5-b94ac2edc7f8", data={"description": "new text"})

Response example

{'behavioralparadigm': {
    'id': '22ae80be-e030-4cee-9cd5-b94ac2edc7f8',
    'name': 'PlayMarioKart',
    'description': 'new text',
    'task': 'Play Mario Kart on GameCube',
    'reward': None,
    'setup_type': '8e9c4d33-f59c-45ca-8e43-f01789f20332',
    'sensory_stimulus_type': None}
}

Delete

  • Allowed portals: private, super
  • Request method: DELETE
  • URL: https://www.brainstem.org/api/private/personal_attributes/behavioralparadigm/<id>/
  • Data: None
  • Responses: 204 OK; 403 Not allowed; 404 Not found

Use example (using Python API)

resp = client.delete_model("behavioralparadigm", id="22ae80be-e030-4cee-9cd5-b94ac2edc7f8")