From 41512bf86fafd5ac706d0cb0909101920a8093e7 Mon Sep 17 00:00:00 2001 From: Simon Pelletier Date: Wed, 28 Oct 2020 11:52:28 -0400 Subject: [PATCH] Transition to API version 0.0.4-dev (#6944) Initiate development on version 0.0.4-dev of the API and remove support for 0.0.2 Resolves #6941 --- CHANGELOG.md | 3 + modules/api/docs/LorisRESTAPI.md | 506 ++++++++++++++++-- ...I_v0.0.3.md => LorisRESTAPI_v0.0.4-dev.md} | 4 +- .../endpoints/candidate/candidate.class.inc | 2 +- .../candidate/visit/dicom/dicom.class.inc | 5 +- .../candidate/visit/dicoms.class.inc | 5 +- .../electrophysiology/bidsfile.class.inc | 1 + .../bidsfile/archive.class.inc | 1 + .../bidsfile/channels.class.inc | 1 + .../bidsfile/electrodes.class.inc | 1 + .../bidsfile/events.class.inc | 1 + .../electrophysiology/channels.class.inc | 1 + .../electrophysiology/electrodes.class.inc | 1 + .../visit/electrophysiology/events.class.inc | 1 + .../electrophysiology/metadata.class.inc | 1 + .../electrophysiology/recording.class.inc | 1 + .../candidate/visit/image/format.class.inc | 2 +- .../visit/image/format/brainbrowser.class.inc | 2 +- .../visit/image/format/raw.class.inc | 2 +- .../visit/image/format/thumbnail.class.inc | 2 +- .../candidate/visit/image/headers.class.inc | 2 +- .../candidate/visit/image/image.class.inc | 2 +- .../candidate/visit/image/qc.class.inc | 2 +- .../candidate/visit/images.class.inc | 2 +- .../visit/instrument/flags.class.inc | 2 +- .../visit/instrument/instrument.class.inc | 2 +- .../candidate/visit/instruments.class.inc | 2 +- .../endpoints/candidate/visit/qc.class.inc | 2 +- .../candidate/visit/recordings.class.inc | 1 + .../endpoints/candidate/visit/visit.class.inc | 6 +- .../api/php/endpoints/candidates.class.inc | 2 +- modules/api/php/endpoints/login.class.inc | 2 +- .../endpoints/project/candidates.class.inc | 2 +- .../php/endpoints/project/images.class.inc | 5 +- .../project/instrument/instrument.class.inc | 2 +- .../endpoints/project/instruments.class.inc | 2 +- .../php/endpoints/project/project.class.inc | 2 +- .../endpoints/project/recordings.class.inc | 5 +- .../php/endpoints/project/visits.class.inc | 2 +- modules/api/php/endpoints/projects.class.inc | 2 +- .../test/api/LorisApiAuthenticatedTest.php | 6 +- 41 files changed, 514 insertions(+), 84 deletions(-) rename modules/api/docs/{LorisRESTAPI_v0.0.3.md => LorisRESTAPI_v0.0.4-dev.md} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a80f9d3bbc9..056305fd856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ requesting a new account and will be displayed in the User Accounts module (PR # - Cleaned up the deprecated column `Parent Topic` (PR #7025) #### Issue Tracker - Readability of comments and history was improved. (PR #6138) +#### API +- Creation of a new version of the API under development (v0.0.4-dev) (PR #6944) +- Deletion of support for the oldest version of the API (v0.0.2) (PR #6844) #### Candidate Parameters - Consents may now be grouped in UI of consent tab (PR #6042, PR #6044) ### Clean Up diff --git a/modules/api/docs/LorisRESTAPI.md b/modules/api/docs/LorisRESTAPI.md index c5e0bad07c5..f290e3987be 100644 --- a/modules/api/docs/LorisRESTAPI.md +++ b/modules/api/docs/LorisRESTAPI.md @@ -1,5 +1,4 @@ -# Loris API - v0.0.2 - +# LORIS API - v0.0.3 ## 1.0 Overview This document specifies the Loris REST API. @@ -9,7 +8,7 @@ or no data. The Loris API uses standard HTTP error codes and the body of any res either be empty or contain only a JSON object for any request. For brevity, the `$LorisRoot/api/$APIVERSION` is omitted from the definitions in this -document. This document specifies $APIVERSION v0.0.2 and it +document. This document specifies $APIVERSION v0.0.3 and it MUST be included before the request in all requests. HTTP GET requests NEVER modify data. PUT, POST or PATCH requests MUST be used to modify @@ -30,16 +29,16 @@ do not require ETags. DELETE is not supported on any resource defined in this API. -# 1.1 Authentication +### 1.1 Authentication If a user is logged in to Loris and can be authenticated using the standard session mechanism, -no further authentication is required. Requests will be evaluated as requests from that user -so that standard Loris modules are able to use the API. +no further authentication is required. Requests will be evaluated as requests from that user, +so that standard Loris modules can simply use the API. If a user is not logged in to Loris (for instance, in a third party app or a CORS application), they can be authenticated using [JSON Web Tokens](https://jwt.io). -The client should POST a request to /login with a payload of the form +The client should POST a request to /login with a payload of the form: ```js { @@ -49,7 +48,7 @@ The client should POST a request to /login with a payload of the form ``` If the username and password are valid, the API will respond with a 200 OK and payload -of the form +of the form: ```js { @@ -62,7 +61,7 @@ Otherwise, it will return a 401 Unauthorized response. If the token is returned, it should be included in an "Authorization: Bearer token" header for any future requests to authenciate the request. -# 2.0 Project API +## 2.0 Project API The Project API lives under the /projects portion of the API URL hierarchy. It is used to get project specific settings or data. PUT and PATCH are not currently supported for the part of @@ -119,6 +118,8 @@ by the 3 letter site alias before attempting to pass this regex to a regular exp or it will result in false negatives. +### 2.1 Single project + ``` GET /projects/$ProjectName ``` @@ -139,11 +140,44 @@ The body of the request to /projects/$ProjectName will be an entity of the form: } ``` +#### 2.1.1 Single project images +``` +GET /projects/$ProjectName/images/ +``` + +Will return a JSON object of the form: + +```js +{ + "Images" : [ + { + "Candidate": "123456", + "PSCID": "MTL001", + "Visit": "V1", + "Visit_date": "2016-08-09", /* The date of the session. This will be null for phantoms and session that are not yet started */ + "Site": "Montreal Neurological Institute", + "ScanType": "t2", /* Acquisition protocol */ + "QC_status": "Pass|Fail|null", + "Selected": "true|false|null", + "Link": "\/candidates\/300022\/V1\/images\/loris-MRI_123456_V1_t2_001.mnc", /* URL relative to this API */ + "InsertTime": "2016-08-09T14:15:30-05:00" /* The inserted date ISO 8601 */ + }, + ... + ] +} +``` +It is possible to provide a GET parameter named `since` where the value need to be a date or datetime. +``` +ex: 2016-08-09 or 2016-08-09 10:00:00 or 2016-08-09T10:00:00-05:00 +``` +We recommend using a format that includes timezone. + +#### 2.1.2 Single project instruments ``` GET /projects/$ProjectName/instruments/ ``` -Will return a JSON object of the form +Will return a JSON object of the form: ```js { @@ -168,11 +202,12 @@ Will return a JSON object of the form Where the InstrumentNames are the "Short Name" of all the instruments used/installed in this project. +#### 2.1.3 Single project visits ``` GET /projects/$ProjectName/visits/ ``` -Will return a JSON object of the form +Will return a JSON object of the form: ```js { @@ -185,11 +220,12 @@ Will return a JSON object of the form Where V1, V2, ... are the visits that may exist for this project +#### 2.1.4 Single project candidates ``` GET /projects/$ProjectName/candidates/ ``` -will return a JSON object of the form +will return a JSON object of the form: ```js { @@ -202,7 +238,32 @@ will return a JSON object of the form where 123456, 342332, etc are the candidates that exist for this project. -## 2.2 Instrument Forms +#### 2.1.5 Single project electrophysiology recordings +``` +GET /projects/$ProjectName/recordings +``` + +will return a JSON object of the form: +```js +{ + "Recordings": [ + { + "Candidate":"300167", + "PSCID":"OTT167", + "Visit":"V1", + "Visit_date":"2016-08-15", + "Site":"Ottawa", + "File":"bids_imports/Face13_BIDSVersion_1.1.0/sub-OTT167/ses-V1/eeg/sub-OTT167_ses-V1_task-faceO_eeg.edf", + "Modality":"eeg", + "InsertTime":"1970-01-01T00:33:39+00:00", + "Link":"/candidates/300167/V1/electrophysiology/sub-OTT167_ses-V1_task-faceO_eeg.edf" + }, + ... + ] +} +``` + +### 2.2 Instrument Forms ``` GET /projects/$ProjectName/instruments/$InstrumentName @@ -220,11 +281,11 @@ PUT and PATCH are not supported for instrument forms. Methods for getting/putting data into specific candidates are specified in section 3. -# 3.0 Candidate API +## 3.0 Candidate API The /candidate portion of the API is used for retrieving and modifying candidate data and data attached to a specific candidate or visit such as visits or instrument data. Portions -of this reference a CandidateObject. A CandidateObject is a JSON object of the form +of this reference a CandidateObject. A CandidateObject is a JSON object of the form: ```js { @@ -234,7 +295,7 @@ of this reference a CandidateObject. A CandidateObject is a JSON object of the f "Site" : Site, "EDC" : "YYYY-MM-DD", "DoB" : "YYYY-MM-DD", - "Gender" : "Male|Female|Other" + "Sex" : "Male|Female" } ``` @@ -244,7 +305,7 @@ representing a candidate in Loris. GET /candidates/ ``` -will return a JSON object of the form +will return a JSON object of the form: ```js { @@ -265,7 +326,8 @@ The body of the POST request should be a candidate key with a JSON object of the "PSCID" : PSCID, "EDC" : "YYYY-MM-DD", "DoB" : "YYYY-MM-DD", - "Gender" : "Male|Female|Other" + "Sex" : "Male|Female", + "Site" : SiteName, } } ``` @@ -276,25 +338,18 @@ project settings. PSCID is only required if the generation type in the Loris config is set to "prompt". -The candidate will be created at the site of the user using the API's site. A response code of 201 Created will be returned on success, 409 Conflict if -the PSCID already exists, and a 400 Bad Request if any data provided is invalid -(PSCID format, date format, gender something other than Male|Female|Other, invalid project -name, etc). A successful POST request will return the CandID for the newly -created candidate in a JSON object of the form: - -```js -{ - "Meta":{ - "CandID":123456 - } -} -``` +the PSCID already exists, 403 Forbidden when the user is creating a candidate at +a site other than the list of sitenames the user is affiliated with, and a 400 +Bad Request if any data provided is invalid (PSCID format, date format, sex +something other than Male|Female, invalid project name, invalid sitename, etc). +A successful POST request will return a CandidateObject for the newly created +candidate. PUT / PATCH methods are not supported on /candidate in this version of the Loris API. -# 3.1 Specific Candidate +### 3.1 Specific Candidate If a GET request for a candidate is issued such as @@ -304,7 +359,7 @@ GET /candidates/$CandID A JSON object representing that candidate will be returned. -The JSON object is of the form +The JSON object is of the form: ```js { @@ -325,7 +380,7 @@ true of all of the API hierarchy under /candidates/$CandID. ### 3.2 Getting Candidate visit data -A GET request of the form +A GET request of the form: ``` GET /candidates/$CandID/$VisitLabel @@ -340,7 +395,9 @@ The JSON object is of the form: "Meta" : { "CandID" : CandID, "Visit" : VisitLabel, - "Battery" : "NameOfSubproject" + "Site" : SiteName, + "Battery": "NameOfSubproject", + "Project" : ProjectName }, "Stages" : { "Screening" : { @@ -376,7 +433,7 @@ Loris, or Approval has not occurred) GET /candidates/$CandID/$VisitLabel/instruments ``` -Will return a JSON object of the form. +Will return a JSON object of the form: ```js { @@ -394,7 +451,7 @@ SHOULD all be retrievable through the `project` portion of the API. PUT / PATCH / POST are not currently supported for candidate instruments. -### 3.3 The Candidate Instrument Data +#### 3.3.1 The Candidate Instrument Data ``` GET /candidates/$CandID/$VisitLabel/instruments/$InstrumentName[/dde] @@ -439,7 +496,7 @@ of PATCH requests SHOULD be used rather than a single PUT request for a client w A 200 OK will be returned on success, and a 404 Not Found if $InstrumentName is not a valid instrument installed in this Loris instance. -### 3.3.1 Instrument flags +#### 3.3.2 Instrument Flags ``` GET /candidates/$CandID/$VisitLabel/instruments/$InstrumentName[/dde]/flags PUT /candidates/$CandID/$VisitLabel/instruments/$InstrumentName[/dde]/flags @@ -472,12 +529,12 @@ The format of the JSON object for these URLS is: } ``` -# 4.0 Imaging Data +## 4.0 Imaging Data The imaging data mostly lives in the `/candidates/$CandID/$Visit` portion of the REST API namespace, but is defined in a separate section of this document for clarity purposes. -## 4.1 Candidate Images +### 4.1 Candidate Images ``` GET /candidates/$CandID/$Visit/images ``` @@ -500,7 +557,7 @@ the form: } ``` -## 4.2 Session Imaging QC +### 4.2 Session Imaging QC ``` GET /candidates/$CandID/$Visit/qc/imaging PUT /candidates/$CandID/$Visit/qc/imaging @@ -508,7 +565,7 @@ PUT /candidates/$CandID/$Visit/qc/imaging To retrieve the session level imaging QC data for a visit, a request can be made `/candidates/$CandID/$Visit/qc/imaging`. It will return a JSON object -of the form +of the form: ```js { @@ -523,7 +580,7 @@ of the form A PUT to the same location will update the QC information. -## 4.3 Image Level Data +### 4.3 Image Level Data ``` GET /candidates/$CandID/$VisitLabel/images/$Filename ``` @@ -534,13 +591,13 @@ Returns raw file with the appropriate MimeType headers for each Filename retriev Only `GET` is currently supported, but future versions of this API may include `PUT` support to insert new (or processed) data into LORIS. -## 4.3.1 Image Level QC Data +#### 4.3.1 Image Level QC Data ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/qc PUT /candidates/$CandID/$VisitLabel/images/$Filename/qc ``` -Returns file level QC information. It will return a JSON object of the form +Returns file level QC information. It will return a JSON object of the form: ```js { @@ -550,13 +607,29 @@ Returns file level QC information. It will return a JSON object of the form "File" : $Filename }, "QC" : "Pass|Fail", - "Selected" : boolean + "Selected" : boolean, + "Caveats" : [ + { + "Severity" : $severity, + "Header" : $header, + "Value" : $headerValue, + "ValidRange" : $headerValidRange, + "ValidRegex" : $headerValidRegex + }, + { + "Severity" : $severity, + "Header" : $header, + "Value" : $headerValue, + "ValidRange" : $headerValidRange, + "ValidRegex" : $headerValidRegex + } + ] } ``` `PUT` requests to the same URL will update the QC information. -## 4.4 Alternate formats +### 4.4 Alternate formats There are occasions where you may want to retrieve a file in a different format than it is stored in LORIS. This can be achieved by adding `/format/$FormatType` @@ -566,14 +639,14 @@ may be added in a future version of this API. An attempt to convert an image to an unsupported format may result in a `415 Unsupported Media Type` HTTP error. -### 4.4.1 Raw Format +#### 4.4.1 Raw Format ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/format/raw ``` This will return the data in raw format (ie. the output of mnc2raw) -### 4.4.2 BrainBrowser Format +#### 4.4.2 BrainBrowser Format ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/format/brainbrowser ``` @@ -601,7 +674,7 @@ format that BrainBrowser can load. It will return a JSON object of the format } ``` -### 4.4.3 Thumbnail Format +#### 4.4.3 Thumbnail Format ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/format/thumbnail ``` @@ -613,7 +686,7 @@ imaging acquisition statically (such as in the LORIS imaging browser.) The LORIS API allows you to extract headers from the images in a RESTful manner. The following methods are defined: -### 4.5.1 Header Summary +#### 4.5.1 Header Summary ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/headers ``` @@ -637,7 +710,7 @@ will return a JSON object of the form: "Description" : { "SeriesName" : "", "SeriesDescription" : "" - } + }, "Dimensions" : { "XSpace" : { "Length" : "", @@ -655,6 +728,13 @@ will return a JSON object of the form: "Length" : "", "StepSize" : "" } + }, + "ScannerInfo" : { + "Manufacturer" : $scannerManufacturer, + "Model" : $scannerModel, + "SoftwareVersion" : $scannerSoftwareVersion, + "SerialNumber" : $scannerSerialNumber, + "FieldStrength" : $scannerFieldStrength } } ``` @@ -662,7 +742,7 @@ will return a JSON object of the form: All of the dimensions are optional and may not exist for any given file (for instance, a 3D image will not have a time dimension.) -### 4.5.2 Complete Headers +#### 4.5.2 Complete Headers ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/headers/full ``` @@ -685,7 +765,7 @@ The JSON will be of the form: } ``` -### 4.5.3 Specific Header +#### 4.5.3 Specific Header ``` GET /candidates/$CandID/$VisitLabel/images/$Filename/headers/$HeaderName ``` @@ -704,3 +784,321 @@ The JSON object is of the form: "Value" : string } ``` + +## 5.0 DICOM Data + +Like the imaging data, the DICOM data mostly lives in the `/candidates/$CandID/$Visit` +portion of the REST API namespace, but is defined in a separate section of this +document for clarity purposes. + +### 5.1 Candidate DICOMs +``` +GET /candidates/$CandID/$Visit/dicoms +``` + +A GET request to `/candidates/$CandID/$Visit/dicoms` will return a JSON object of +all the raw DICOM data which have been acquired for that visit. It will return an +object of the form: + +```js +{ + "Meta" : { + "CandID" : $CandID, + "Visit" : $VisitLabel, + }, + "DicomTars" : + [ + { + "Tarname" : "DCM_yyyy-mm-dd_ImagingUpload-hh-mm-abc123.tar", + "SeriesInfo" : + [{ + "SeriesDescription" : "MPRAGE_ipat2", + "SeriesNumber" : "2", + "EchoTime" : "2.98", + "RepetitionTime" : "2300", + "InversionTime" : "900", + "SliceThickness" : "1", + "Modality" : "MR", + "SeriesUID" : "1.2.3.4.1107", + }, + { + "SeriesDescription" : "BOLD Resting State", + "SeriesNumber" : "5", + "EchoTime" : "30", + "RepetitionTime" : "2100", + "InversionTime" : NULL, + "SliceThickness" : "3.5", + "Modality" : "MR", + "SeriesUID" : "3.4.5.6.1507", + }] + }, + { + "Tarname" : "DCM_yyyy-mm-dd_ImagingUpload-hh-mm-def456.tar", + "SeriesInfo" : + [{ + "SeriesDescription" : "MPRAGE_ipat2", + "SeriesNumber" : "2", + "EchoTime" : "2.98", + "RepetitionTime" : "2300", + "InversionTime" : "900", + "SliceThickness" : "1", + "Modality" : "MR", + "SeriesUID" : "1.7.8.9.1296", + }] + } + ] +} +``` + +The `Modality` header in the SeriesInfo is either `MR` or `PT` for MRI or PET +scans, respectively. + +### 5.2 Tar Level Data +``` +GET /candidates/$CandID/$VisitLabel/dicoms/$Tarname +``` + +Returns/Downloads a `tar` file which contains a `.meta` and a `.log` text +files, and a `.tar.gz` of the raw DICOM data as acquired during the candidate +scanning session, and as retrieved from `/candidates/$CandID/$Visit/dicoms`. + +Only `GET` is currently supported. + +## 6.0 Electrophysiology Recording Data + +The imaging data mostly lives in the `/candidates/$CandID/$Visit` portion of the +REST API namespace, but is defined in a separate section of this document for +clarity purposes. + +### 6.1 Candidate Electrophysiology Recordings + +``` +GET /candidates/$CandID/$Visit/recordings +``` + +A GET request to a `/candidates/$CandID/$Visit/recordings` will return a JSON object +of all the recordings which have been acquired for that visit. It will return an +object of the form: + +```js +{ + "Meta": { + "CandID": $CandID, + "Visit": $VisitLabel + }, + "Files": [{ + "OutputType": "raw", + "Filename": $Filename, + "AcquisitionModality": "eeg/meg/etc" + }, /* More files */] +} +``` + +### 6.2 Electrophysiology Level Data + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename +``` + +Returns raw file with the appropriate MimeType headers for each Filename retrieved +from `/candidates/$CandID/$Visit/recordings`. + +Only `GET` is currently supported, but future versions of this API may include `PUT` +support to insert raw (or derivatives) data into LORIS. + +### 6.3 Electrophysiology Recording Metadata + +#### 6.3.1 Complete Metadata +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/metadata +``` + +This will return a JSON object with all metadata associated with the recording. It +will return an object of the form: + +```js +{ + "Meta": { + "CandID": $CandID, + "Visit": $VisitLabel, + "File": $Filename + }, + "Data": { + "EEGReference": "CMS", + "SamplingFrequency": "256", + "ECGChannelCount": "0", + "HardwareFilters": "n/a", + /* more metadata ... */ + } +} +``` + +#### 6.3.2 Specific Metadata + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/metadata/$HeaderName +``` + +This will return a JSON object that extracts one specific metadata from $Filename. + +The JSON object is of the form: +```js +{ + "Meta": { + "CandID": $CandID, + "Visit": $VisitLabel, + "File": $Filename, + "Header": $HeaderName + }, + "Value": string +} +``` + +### 6.4 Electrophysiology Recording Channels Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/channels +``` + +This will return a JSON object with information about the channels used to produce +the recording. It will return an object of the form: + +```js +{ + "Meta":{ + "CandID":$CandID, + "Visit": $VisitLabel, + "File": $Filename + }, + "Channels":[ + { + "ChannelName":"A3", + "ChannelDescription":"free form text description of the channel", + "ChannelType":"EEG", + "ChannelTypeDescription":"ElectoEncephaloGram: EEG sensors", + "ChannelStatus":"bad", + "StatusDescription":"artifact description as a free form text", + "SamplingFrequency":2400, + "LowCutoff":"n/a", + "HighCutoff":"n/a", + "ManualFlag":"n/a", + "Notch":"n/a", + "Reference":"A1", + "Unit":"microV", + "ChannelFilePath":"sub-OTT167_ses-V1_task-faceO_channels.tsv" + }, + ... + ] +} +``` + +### 6.5 Electrophysiology Recording Electrodes Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/electrodes +``` + +This will return a JSON object with information about the electrodes used to produce +the recording. It will return an object of the form: + +```js +{ + "Meta":{ + "CandID":$CandID, + "Visit": $VisitLabel, + "File": $Filename + }, + "Electrodes":[ + { + "ElectrodeName":"A1", + "ElectrodeType":"active/cap", + "ElectrodeMaterial":"Ag/AgCl", + "X":"-0.005000", + "Y":"0.001000", + "Z":"0.120000", + "Impedance":"n/a", + "ElectrodeFilePath":"sub-OTT167_ses-V1_task-faceO_electrodes.tsv" + }, + ... + ] +} + +``` + +### 6.6 Electrophysiology Recording Events Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/events +``` + +This will return a JSON object with information about the task events used when +recording. It will return an object of the form: + +```js +{ + "Meta":{ + "CandID":$CandID, + "Visit": $VisitLabel, + "File": $Filename + }, + "TaskEvents":[ + { + "Onset":"11.734000", + "Duration":"0.000000", + "EventCode":"1", + "EventSample":"1", + "EventType":"face", + "TrialType":"checker-right", + "ResponseTime":"2000", + "EventFilePath":"sub-OTT167_ses-V1_task-faceO_events.tsv" + }, + ... + ] +} +``` + +### 6.7 Download BIDS Files Associated To The Recording + +#### 6.7.1 Download The BIDS File With Channels Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/bidsfiles/channels +``` + +Returns raw file with the appropriate MimeType headers for the channels file +retrieved from `/candidates/$CandID/$Visit/recordings/$Filename`. + +Only `GET` is currently supported. + +#### 6.7.2 Download The BIDS File With Electrodes Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/bidsfiles/electrodes +``` + +Returns raw file with the appropriate MimeType headers for the electrodes file +retrieved from `/candidates/$CandID/$Visit/recordings/$Filename`. + +Only `GET` is currently supported. + +#### 6.7.3 Download The BIDS File With Task Events Information + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/bidsfiles/events +``` + +Returns raw file with the appropriate MimeType headers for the task events file +retrieved from `/candidates/$CandID/$Visit/recordings/$Filename`. + +Only `GET` is currently supported. + +#### 6.7.4 Download An Archive File With All Associated Files For The Recording + +``` +GET /candidates/$CandID/$VisitLabel/recordings/$Filename/bidsfiles/archive +``` + +Returns raw file with the appropriate MimeType headers for the archival file +with all BIDS files retrieved from `/candidates/$CandID/$Visit/recordings/$Filename`. + +Only `GET` is currently supported. diff --git a/modules/api/docs/LorisRESTAPI_v0.0.3.md b/modules/api/docs/LorisRESTAPI_v0.0.4-dev.md similarity index 99% rename from modules/api/docs/LorisRESTAPI_v0.0.3.md rename to modules/api/docs/LorisRESTAPI_v0.0.4-dev.md index f290e3987be..c6064002864 100644 --- a/modules/api/docs/LorisRESTAPI_v0.0.3.md +++ b/modules/api/docs/LorisRESTAPI_v0.0.4-dev.md @@ -1,4 +1,4 @@ -# LORIS API - v0.0.3 +# LORIS API - v0.0.4-dev ## 1.0 Overview This document specifies the Loris REST API. @@ -8,7 +8,7 @@ or no data. The Loris API uses standard HTTP error codes and the body of any res either be empty or contain only a JSON object for any request. For brevity, the `$LorisRoot/api/$APIVERSION` is omitted from the definitions in this -document. This document specifies $APIVERSION v0.0.3 and it +document. This document specifies $APIVERSION v0.0.4-dev and it MUST be included before the request in all requests. HTTP GET requests NEVER modify data. PUT, POST or PATCH requests MUST be used to modify diff --git a/modules/api/php/endpoints/candidate/candidate.class.inc b/modules/api/php/endpoints/candidate/candidate.class.inc index 6bdcf01ec0e..30ec0c7e1e9 100644 --- a/modules/api/php/endpoints/candidate/candidate.class.inc +++ b/modules/api/php/endpoints/candidate/candidate.class.inc @@ -63,8 +63,8 @@ class Candidate extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/dicom/dicom.class.inc b/modules/api/php/endpoints/candidate/visit/dicom/dicom.class.inc index f6ba40277ee..e6810f1d116 100644 --- a/modules/api/php/endpoints/candidate/visit/dicom/dicom.class.inc +++ b/modules/api/php/endpoints/candidate/visit/dicom/dicom.class.inc @@ -79,7 +79,10 @@ class Dicom extends Endpoint implements \LORIS\Middleware\ETagCalculator */ protected function supportedVersions() : array { - return ['v0.0.3']; + return [ + 'v0.0.3', + 'v0.0.4-dev', + ]; } /** diff --git a/modules/api/php/endpoints/candidate/visit/dicoms.class.inc b/modules/api/php/endpoints/candidate/visit/dicoms.class.inc index e1310b8c0d5..31b623a0da6 100644 --- a/modules/api/php/endpoints/candidate/visit/dicoms.class.inc +++ b/modules/api/php/endpoints/candidate/visit/dicoms.class.inc @@ -68,7 +68,10 @@ class Dicoms extends Endpoint implements \LORIS\Middleware\ETagCalculator */ protected function supportedVersions() : array { - return ['v0.0.3']; + return [ + 'v0.0.3', + 'v0.0.4-dev', + ]; } /** diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile.class.inc index ad784f8a320..6989c502aca 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile.class.inc @@ -59,6 +59,7 @@ class BidsFile extends Endpoint { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/archive.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/archive.class.inc index 96ff668f516..57567b8e817 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/archive.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/archive.class.inc @@ -66,6 +66,7 @@ class Archive extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/channels.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/channels.class.inc index b568c4a98d7..def17c6b00d 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/channels.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/channels.class.inc @@ -66,6 +66,7 @@ class Channels extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/electrodes.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/electrodes.class.inc index b2155619100..af71c905eea 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/electrodes.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/electrodes.class.inc @@ -66,6 +66,7 @@ class Electrodes extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/events.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/events.class.inc index 8af631aa384..bc7172fb97d 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/events.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/bidsfile/events.class.inc @@ -66,6 +66,7 @@ class Events extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/channels.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/channels.class.inc index d855edf508e..a5cb0c1b662 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/channels.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/channels.class.inc @@ -75,6 +75,7 @@ class Channels extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/electrodes.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/electrodes.class.inc index ab45c69545b..0a109029f69 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/electrodes.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/electrodes.class.inc @@ -75,6 +75,7 @@ class Electrodes extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/events.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/events.class.inc index 2deb8efee9d..f4c16e46e81 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/events.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/events.class.inc @@ -75,6 +75,7 @@ class Events extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/metadata.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/metadata.class.inc index e1a0ee42336..e5ed4781146 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/metadata.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/metadata.class.inc @@ -76,6 +76,7 @@ class Metadata extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/electrophysiology/recording.class.inc b/modules/api/php/endpoints/candidate/visit/electrophysiology/recording.class.inc index 0d18afa3d31..9019931a810 100644 --- a/modules/api/php/endpoints/candidate/visit/electrophysiology/recording.class.inc +++ b/modules/api/php/endpoints/candidate/visit/electrophysiology/recording.class.inc @@ -70,6 +70,7 @@ class Recording extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/format.class.inc b/modules/api/php/endpoints/candidate/visit/image/format.class.inc index 21aace1514f..d211146fb25 100644 --- a/modules/api/php/endpoints/candidate/visit/image/format.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/format.class.inc @@ -61,8 +61,8 @@ class Format extends Endpoint protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/format/brainbrowser.class.inc b/modules/api/php/endpoints/candidate/visit/image/format/brainbrowser.class.inc index 34187774496..b1a6f5764d7 100644 --- a/modules/api/php/endpoints/candidate/visit/image/format/brainbrowser.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/format/brainbrowser.class.inc @@ -67,8 +67,8 @@ class Brainbrowser extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/format/raw.class.inc b/modules/api/php/endpoints/candidate/visit/image/format/raw.class.inc index 4a586403dae..f215e56694e 100644 --- a/modules/api/php/endpoints/candidate/visit/image/format/raw.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/format/raw.class.inc @@ -62,8 +62,8 @@ class Raw extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/format/thumbnail.class.inc b/modules/api/php/endpoints/candidate/visit/image/format/thumbnail.class.inc index b9e904f79d4..dd3095880d7 100644 --- a/modules/api/php/endpoints/candidate/visit/image/format/thumbnail.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/format/thumbnail.class.inc @@ -62,8 +62,8 @@ class Thumbnail extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/headers.class.inc b/modules/api/php/endpoints/candidate/visit/image/headers.class.inc index ce02498386c..35349674569 100644 --- a/modules/api/php/endpoints/candidate/visit/image/headers.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/headers.class.inc @@ -76,8 +76,8 @@ class Headers extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/image.class.inc b/modules/api/php/endpoints/candidate/visit/image/image.class.inc index 8b6f375592c..e025b2914ea 100644 --- a/modules/api/php/endpoints/candidate/visit/image/image.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/image.class.inc @@ -72,8 +72,8 @@ class Image extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/image/qc.class.inc b/modules/api/php/endpoints/candidate/visit/image/qc.class.inc index d4047eed43d..2072779b2b6 100644 --- a/modules/api/php/endpoints/candidate/visit/image/qc.class.inc +++ b/modules/api/php/endpoints/candidate/visit/image/qc.class.inc @@ -79,8 +79,8 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/images.class.inc b/modules/api/php/endpoints/candidate/visit/images.class.inc index 992faeb9ff3..01668291f8e 100644 --- a/modules/api/php/endpoints/candidate/visit/images.class.inc +++ b/modules/api/php/endpoints/candidate/visit/images.class.inc @@ -69,8 +69,8 @@ class Images extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/instrument/flags.class.inc b/modules/api/php/endpoints/candidate/visit/instrument/flags.class.inc index 59cbdf056d1..54997a4037b 100644 --- a/modules/api/php/endpoints/candidate/visit/instrument/flags.class.inc +++ b/modules/api/php/endpoints/candidate/visit/instrument/flags.class.inc @@ -76,8 +76,8 @@ class Flags extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/instrument/instrument.class.inc b/modules/api/php/endpoints/candidate/visit/instrument/instrument.class.inc index faab97f90ec..3705f47dcb7 100644 --- a/modules/api/php/endpoints/candidate/visit/instrument/instrument.class.inc +++ b/modules/api/php/endpoints/candidate/visit/instrument/instrument.class.inc @@ -76,8 +76,8 @@ class Instrument extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/instruments.class.inc b/modules/api/php/endpoints/candidate/visit/instruments.class.inc index 44711fce2b4..8a61391b6e9 100644 --- a/modules/api/php/endpoints/candidate/visit/instruments.class.inc +++ b/modules/api/php/endpoints/candidate/visit/instruments.class.inc @@ -69,8 +69,8 @@ class Instruments extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/qc.class.inc b/modules/api/php/endpoints/candidate/visit/qc.class.inc index 814d9f40348..ea1e2376875 100644 --- a/modules/api/php/endpoints/candidate/visit/qc.class.inc +++ b/modules/api/php/endpoints/candidate/visit/qc.class.inc @@ -73,8 +73,8 @@ class Qc extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/recordings.class.inc b/modules/api/php/endpoints/candidate/visit/recordings.class.inc index af899b3756e..75b7acad5b9 100644 --- a/modules/api/php/endpoints/candidate/visit/recordings.class.inc +++ b/modules/api/php/endpoints/candidate/visit/recordings.class.inc @@ -67,6 +67,7 @@ class Recordings extends Endpoint implements \LORIS\Middleware\ETagCalculator { return [ 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/candidate/visit/visit.class.inc b/modules/api/php/endpoints/candidate/visit/visit.class.inc index c63f25bbebd..c1f6b10566f 100644 --- a/modules/api/php/endpoints/candidate/visit/visit.class.inc +++ b/modules/api/php/endpoints/candidate/visit/visit.class.inc @@ -75,8 +75,10 @@ class Visit extends Endpoint implements \LORIS\Middleware\ETagCalculator */ protected function supportedVersions() : array { - // Removed 0.0.2 since session requires a project. - return ['v0.0.3']; + return [ + 'v0.0.3', + 'v0.0.4-dev', + ]; } /** diff --git a/modules/api/php/endpoints/candidates.class.inc b/modules/api/php/endpoints/candidates.class.inc index c79ceb9d5fe..7149213d560 100644 --- a/modules/api/php/endpoints/candidates.class.inc +++ b/modules/api/php/endpoints/candidates.class.inc @@ -73,8 +73,8 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - "v0.0.2", "v0.0.3", + "v0.0.4-dev", ]; } diff --git a/modules/api/php/endpoints/login.class.inc b/modules/api/php/endpoints/login.class.inc index 3ed239febb4..3aa17c04a41 100644 --- a/modules/api/php/endpoints/login.class.inc +++ b/modules/api/php/endpoints/login.class.inc @@ -80,8 +80,8 @@ class Login extends Endpoint protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/project/candidates.class.inc b/modules/api/php/endpoints/project/candidates.class.inc index f7f791e30ae..52aa2240f2c 100644 --- a/modules/api/php/endpoints/project/candidates.class.inc +++ b/modules/api/php/endpoints/project/candidates.class.inc @@ -67,8 +67,8 @@ class Candidates extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/project/images.class.inc b/modules/api/php/endpoints/project/images.class.inc index ae7da6a4bdf..b89cafa86b9 100644 --- a/modules/api/php/endpoints/project/images.class.inc +++ b/modules/api/php/endpoints/project/images.class.inc @@ -66,7 +66,10 @@ class Images extends Endpoint implements \LORIS\Middleware\ETagCalculator */ protected function supportedVersions() : array { - return ["v0.0.3"]; + return [ + "v0.0.3", + "v0.0.4-dev", + ]; } /** diff --git a/modules/api/php/endpoints/project/instrument/instrument.class.inc b/modules/api/php/endpoints/project/instrument/instrument.class.inc index fd2d8dcdbb5..885e4c38cdb 100644 --- a/modules/api/php/endpoints/project/instrument/instrument.class.inc +++ b/modules/api/php/endpoints/project/instrument/instrument.class.inc @@ -68,8 +68,8 @@ class Instrument extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/project/instruments.class.inc b/modules/api/php/endpoints/project/instruments.class.inc index 7e46026d202..3ce6fed23db 100644 --- a/modules/api/php/endpoints/project/instruments.class.inc +++ b/modules/api/php/endpoints/project/instruments.class.inc @@ -67,8 +67,8 @@ class Instruments extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/project/project.class.inc b/modules/api/php/endpoints/project/project.class.inc index 3a0826b7fb6..c732da3cc51 100644 --- a/modules/api/php/endpoints/project/project.class.inc +++ b/modules/api/php/endpoints/project/project.class.inc @@ -67,8 +67,8 @@ class Project extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/project/recordings.class.inc b/modules/api/php/endpoints/project/recordings.class.inc index 694ce8f37df..5d45a89e4ba 100644 --- a/modules/api/php/endpoints/project/recordings.class.inc +++ b/modules/api/php/endpoints/project/recordings.class.inc @@ -84,7 +84,10 @@ class Recordings extends Endpoint implements \LORIS\Middleware\ETagCalculator */ protected function supportedVersions() : array { - return ["v0.0.3"]; + return [ + "v0.0.3", + "v0.0.4-dev" + ]; } /** diff --git a/modules/api/php/endpoints/project/visits.class.inc b/modules/api/php/endpoints/project/visits.class.inc index d066db59b31..4186ce8adf7 100644 --- a/modules/api/php/endpoints/project/visits.class.inc +++ b/modules/api/php/endpoints/project/visits.class.inc @@ -67,8 +67,8 @@ class Visits extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/modules/api/php/endpoints/projects.class.inc b/modules/api/php/endpoints/projects.class.inc index fb4b50ee122..584cc7ab432 100644 --- a/modules/api/php/endpoints/projects.class.inc +++ b/modules/api/php/endpoints/projects.class.inc @@ -63,8 +63,8 @@ class Projects extends Endpoint implements \LORIS\Middleware\ETagCalculator protected function supportedVersions() : array { return [ - 'v0.0.2', 'v0.0.3', + 'v0.0.4-dev', ]; } diff --git a/raisinbread/test/api/LorisApiAuthenticatedTest.php b/raisinbread/test/api/LorisApiAuthenticatedTest.php index 3a5f7283ee1..783bb750e3c 100644 --- a/raisinbread/test/api/LorisApiAuthenticatedTest.php +++ b/raisinbread/test/api/LorisApiAuthenticatedTest.php @@ -22,6 +22,7 @@ class LorisApiAuthenticatedTest extends LorisIntegrationTest { protected $client; + protected $version; protected $headers; protected $base_uri; protected $originalJwtKey; @@ -36,6 +37,9 @@ class LorisApiAuthenticatedTest extends LorisIntegrationTest public function setUp() { parent::setUp(); + + $this->_version = 'v0.0.4-dev'; + // store the original JWT key for restoring it later $jwtConfig = $this->DB->pselect( ' @@ -83,7 +87,7 @@ public function setUp() */ public function apiLogin($username, $password) { - $this->base_uri = "$this->url/api/v0.0.3/"; + $this->base_uri = "$this->url/api/$this->_version/"; $this->client = new Client(['base_uri' => $this->base_uri]); $response = $this->client->request( 'POST',