Skip to content

This repository contains the LORIS PHP API client, a PHP client to interact with the LORIS public HTTP API.

Notifications You must be signed in to change notification settings

aces/loris-php-api-client

Repository files navigation

OpenAPIClient-php

LORIS REST API and Module endpoints.

Server Configuration

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.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

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

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

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;
}

API Endpoints

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

Models

Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: Bearer authentication (JWT)

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

About

This repository contains the LORIS PHP API client, a PHP client to interact with the LORIS public HTTP API.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published