Tanker HTTP Server
HTTP server to interact with Tanker Server as a microservice.
Cli API
tanker-server-httpd [options]
All the options can override the one from the config file.
General options:
- -c,--config=configFile path to a configuration file
- --version the version of the server
- -h,--help usage
Options related to Tanker
- --server-id The Tanker server identifier
- --server-token The Tanker serverToken for that user
- --trustchain-id The Tanker trustchain id
Options related to HTTP
- --bearer-token=bearerToken The HTTP Bearer token to protect access to the HTTP endpoints
HTTP API specification
Type | Route | Description |
---|---|---|
POST | /v1/encrypt | Take data and return it encrypted |
POST | /v1/decrypt | Take encrypted data and return clear data |
POST | /v1/share | Share resources to new users and groups |
GET | /healthz | Ping |
Errors
If an error occurred, the response will contain:
-
An appropriate 4xx, or 5xx HTTP status code,
-
A
Content-Type: application/json
header, -
A JSON body in the following format:
{ code: str, message: str }
-
Error codes are described below:
Code HTTP Status Code Message invalid_auth_token 401 Unauthorized You did not provide the correct token in the Authorization HTTP header invalid_content_type 400 Bad Request You did not provide the Content-Type Content-Type
HTTP headerinvalid_body 400 Bad Request You did not provide the number of bytes specified by the Content-Length HTTP header missing_recipients 400 Bad Request You did not provide the shareWith
field in the HTTP bodymissing_resources 400 Bad Request You did not provide the resourcesIds
field in the HTTP bodyinvalid_encrypted_data 400 Bad Request The provided encrypted data is invalid internal_server_error 500 Internal Server Error We encountered an internal error. Please try again. resource_key_not_found 404 Not Found The ressource key to decrypt the body is not available recipient_not_found 404 Not Found One of the recipients you tried to share with does not exist resource_not_found 404 Not Found One of the resources you tried to share does not exist
Further Documentation
More detailed documentation about the HTTP API is available at https://tanker.io/docs/latest/.