Journal API endpoint
The shared list of journals publications appear in.
Table of contents
Endpoints
- Private portal:
https://www.brainstem.org/api/private/dissemination/journal/(needs a token; one record: append<id>/) - Public portal:
https://www.brainstem.org/api/public/dissemination/journal/(read-only, public projects, no token) - Response keys:
journal(detail, create, update),journals(list) - Permissions: see the permissions page
- Uniqueness:
nameunique across BrainSTEM - Deleting: refused (400) while
publication,publicationapprovalrecords point to it
Fields
[required] fields must be sent on create; [read-only] fields are returned but cannot be set. A nestable relation can be traversed in filters (filter{field.other}) and sideloaded with include[]=field.*; other relations can only be compared with ids (filter{field}=<id>). See the query syntax.
| Field | Description |
|---|---|
id | UUID string [read-only] |
name | string [required]; max 500 characters |
description | string; max 2000 characters; nullable |
website | string; max 200 characters; nullable |
comments | string |
List
- Allowed portals: private, public
- Request method: GET
- URL:
https://www.brainstem.org/api/private/dissemination/journal/ - Responses:
200OK;401Not authenticated;403Not allowed
Use example (Python API tool)
resp = client.load('journal', load_all=True)
records = resp['journals']
Use example (MATLAB API tool)
resp = client.load('journal', 'load_all', true);
records = resp.journals;
Response example
{
"journals": [
{
"id": "<id>",
"name": "Journal 1",
"description": "",
"website": "",
"comments": ""
}
],
"meta": {
"page": 1,
"per_page": 100,
"total_results": 1,
"total_pages": 1
}
}
Add
- Allowed portals: private
- Request method: POST
- URL:
https://www.brainstem.org/api/private/dissemination/journal/ - Data: JSON object with at least the required fields
- Responses:
201Created;400Bad request (validation errors per field);403Not allowed
Use example (Python API tool)
resp = client.save('journal', data={"name": "Journal 1"})
record = resp.json()['journal']
Use example (MATLAB API tool)
created = client.save(struct('name', 'Journal 1'), 'journal');
record = created.journal;
Detail
- Allowed portals: private, public
- Request method: GET
- URL:
https://www.brainstem.org/api/private/dissemination/journal/<id>/ - Responses:
200OK;403Not allowed;404Not found
Use example (Python API tool)
resp = client.load('journal', id='<id>')
record = resp.json()['journal']
Use example (MATLAB API tool)
out = client.load('journal', 'id', '<id>');
record = out.journal;
Response example
{
"journal": {
"id": "<id>",
"name": "Journal 1",
"description": "",
"website": "",
"comments": ""
}
}
Change
- Allowed portals: private
- Request method: PATCH
- URL:
https://www.brainstem.org/api/private/dissemination/journal/<id>/ - Data: JSON object with the fields to change. Lists (
projects,tags, …) and JSON payloads (details, coordinates) are replaced as a whole: read the record first and send the full list or object. - Responses:
200OK;400Bad request;403Not allowed;404Not found
Use example (Python API tool)
resp = client.save('journal', id='<id>', data={"name": "Journal 1 (renamed)"})
Use example (MATLAB API tool)
client.save(struct('id', '<id>', 'name', 'Journal 1 (renamed)'), 'journal', 'method', 'patch');
Delete
- Allowed portals: private
- Request method: DELETE
- URL:
https://www.brainstem.org/api/private/dissemination/journal/<id>/ - Responses:
204Deleted;400Still referenced by other records;403Not allowed;404Not found
Use example (Python API tool)
resp = client.delete('journal', id='<id>')
Use example (MATLAB API tool)
client.delete('<id>', 'journal');
Data model
The fields are described for the web forms on the Journal data model page.