Web Services
This command is for advanced users wanting to directly access to the REST API of Opal server.
opal rest <PATH> <CREDENTIALS> [OPTIONS] [EXTRAS]
Arguments
Argument |
Description |
---|---|
|
Web service path, for instance: /project/xxx |
Options
Option |
Description |
---|---|
|
HTTP method: GET (default), POST, PUT, DELETE, OPTIONS. |
|
Accept header (default is application/json). |
|
Content-Type header (default is application/json). |
|
Custom headers in the form of: { “Key1”: “Value1”, “Key2”: “Value2” } |
Credentials
Authentication can be done by username/password credentials OR by personal access token OR by certificate/private key pair (two-way SSL authentication).
Option |
Description |
---|---|
|
Opal server base url |
|
Credentials auth: user name (requires a password) |
|
Credentials auth: user password (requires a user name) |
|
Token auth: user’s personal access token |
|
Two-way SSL auth: certificate/public key file (requires a private key) |
|
Two-way SSL auth: private key file (requires a certificate) |
Extras
Option |
Description |
---|---|
|
Show the command help’s message. |
|
Verbose output. |
|
Output pretty-print JSON |
Example
Get the list of all datasources:
opal rest /datasources --opal https://opal-demo.obiba.org --user administrator --password password --json
Get the list of all tables of datasource ‘medications’:
opal rest /datasource/medications/tables --opal https://opal-demo.obiba.org --user administrator --password password --json
Get the list of tables with entity id ‘6397957’ of type ‘Participant’:
opal rest /entity/6397957/type/Participant/tables --opal https://opal-demo.obiba.org --user administrator --password password --json