Storiq One API
v1.0
API for Storiq One
|
All objects implement REST Verbs (see the REST API tutorial)
The URL to call is in this form:
https://server/storiqone-backend/api/v1/OBJECT?id=&KEY=VALUE
Parameters are standardized as follows:
Asking for an archive object information from its id will be:
https://server/storiqone-backend/api/v1/archive/?id=124
To search an object by some other property, like its name, is done through the search sub-object. The search sub-object only implements the GET method.
https://server/storiqone-backend/api/v1/archive/search/?name=20131222_MCEI_PARSIFAL_MET https://server/storiqone-backend/api/v1/pool/search/?name=ARCHIVES_DIFFUSION_LOT_2013
To search all objects relative to some other object, for instance all archives belonging to a pool:
https://server/storiqone-backend/api/v1/archive/search/?pool=42
Additional parameters can be used to sort search results and display only a subset: limit, offset, filter, order_by, order_by_asc. For example to list the first 100 archives:
https://server/storiqone-backend/api/v1/archive/&limit=100
Listing the next 100 archives:
https://server/storiqone-backend/api/v1/archive/?offset=100&limit=100
All objects return data the same way. By default data is returned as JSON. Other formats such as XML will become available in next releases.
Objects return standard HTTP codes:
Code | Meaning |
---|---|
200 | Success |
401 | Authentication required |
403 | Access denied |
404 | Object not found |
500 | Internal server error |
503 | Malformed request |
The API allows metadata to be associated with any object, pools, media, users, etc. However the standard Storiq One Web Interface will only display Archive and Files metadata.
The API uses an API Key mechanism. We advise you to create an API key for each application that will use it, so that it's clearly identified in the logs. You can create and list API keys with the storiqonectl command which comes which is part of the storiqone-daemon:
storiqonectl api --create <application name>
The command returns a UUID which is to be used as the API key. To list existing API keys, use the command:
storiqonectl api --list
Here are some examples using the API with the curl command from a standard shell.
Creating a new session (logging in):
curl -v -k -X POST --data '{"login":"admin","password":"<password>","apikey":"<uuid>"'}' \ -H 'content-type: application/json' \ https://server/storiqone-backend/api/v1/auth/
Use the value of PHPSESSIONID as returned in the header data as an authentication token in the next commmands.
List all archives:
curl -v -k -X GET -H 'content-type: application/json' -b 'PHPSESSID=<string>' \ https://server/storiqone-backend/api/v1/archive/
Detailed information about an archive:
curl -v -k -X GET -H 'content-type: application/json' -b 'PHPSESSID=<string>' \ https://server/storiqone-backend/api/v1/archive/?id=2
Update a User:
curl -v -k -X UPDATE -H 'content-type: application/json' -b 'PHPSESSID=<string>' \ --data '{"fullname":"Pierre Dupond"}' \ https://server/storiqone-backend/api/v1/user/?id=2
Create a new archival Job:
curl -v -k -X POST -H 'content-type: application/json' -b 'PHPSESSID=<string>' \ --data '{"pool":3,"name":"API archive","files":[ "/some/path"]}' \ https://server/storiqone-backend/api/v1/archive/