LORIS REST API and Module endpoints.
| Type | Configuration | Endpoints |
|---|---|---|
| REST API | setHost(\"{$baseUrl}/api/{$version}\") |
/login, /candidates, /projects, /sites |
| Module | setHost($baseUrl) |
/instrument_manager/_* |
For more information, please visit https://github.com/aces/Loris.
PHP 8.1 and later.
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/aces/loris-php-api-client.git"
}
],
"require": {
"aces/loris-php-api-client": "*@dev"
}
}Then run composer install
Download the files and include autoload.php:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new LORISClient\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$login_request = new \LORISClient\LORISClient\Model\LoginRequest(); // \LORISClient\LORISClient\Model\LoginRequest
try {
$result = $apiInstance->login($login_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->login: ', $e->getMessage(), PHP_EOL;
}| Class | Method | HTTP request | Description |
|---|---|---|---|
| AuthenticationApi | login | POST /login | Authenticate and obtain JWT token |
| CandidatesApi | createCandidate | POST /candidates | Create a new candidate |
| CandidatesApi | getCandidate | GET /candidates/{candid} | Get candidate details |
| CandidatesApi | getCandidates | GET /candidates | List all candidates |
| InstrumentManagerApi | getInstrumentDataHeaders | GET /instrument_manager/instrument_data | Get expected CSV headers for instrument data upload |
| InstrumentManagerApi | installInstrument | POST /instrument_manager | Install instrument from LINST file or REDCap data dictionary |
| InstrumentManagerApi | uploadInstrumentData | POST /instrument_manager/instrument_data | Bulk upload instrument data from CSV |
| InstrumentsApi | getInstrumentData | GET /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data |
| InstrumentsApi | getVisitInstruments | GET /candidates/{candid}/{visit}/instruments | List instruments for a visit |
| InstrumentsApi | patchInstrumentData | PATCH /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data |
| InstrumentsApi | putInstrumentData | PUT /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data |
| ProjectsApi | getProject | GET /projects/{project} | Get project details |
| ProjectsApi | getProjectInstruments | GET /projects/{project}/instruments | List project instruments |
| ProjectsApi | getProjects | GET /projects | List projects |
| SitesApi | getSites | GET /sites | List sites |
| VisitsApi | createVisit | PUT /candidates/{candid}/{visit} | Create a new visit |
| VisitsApi | getVisit | GET /candidates/{candid}/{visit} | Get visit details |
- CandidateCreateRequest
- CandidateCreateRequestCandidate
- CandidateObject
- CandidatesResponse
- ErrorResponse
- IdMapping
- InstrumentData
- InstrumentDataMeta
- InstrumentDataRequest
- InstrumentDataRequestMeta
- InstrumentDataResponse
- InstrumentDataResponseMessage
- InstrumentMeta
- InstrumentsResponse
- LoginRequest
- LoginResponse
- ProjectResponse
- ProjectsResponse
- Site
- SitesResponse
- SuccessResponse
- VisitCreateRequest
- VisitInstrumentsResponse
- VisitObject
- VisitObjectMeta
Authentication schemes defined for the API:
- Type: Bearer authentication (JWT)
To run the tests, use:
composer install
vendor/bin/phpunitThis PHP package is automatically generated by the OpenAPI Generator project: