.. _list_templates: Method: List all Templates -------------------------- Description ~~~~~~~~~~~ Obtain list of all available templates. URL Syntax ~~~~~~~~~~ /api/{version}/template HTTP Method ~~~~~~~~~~~ GET Successful HTTP Response ~~~~~~~~~~~~~~~~~~~~~~~~ 200 Parameters ~~~~~~~~~~ +----------------+------------------+----------------+--------+---------+-----------+------------------+ | Parameter name | Description | Parameter type | Type | Default | Mandatory | Comment | +================+==================+================+========+=========+===========+==================+ | X-Http-Token | StoredSafe token | HTTP Header | String | | :sup:`1)` | Preferred method | +----------------+------------------+----------------+--------+---------+-----------+------------------+ | token | StoredSafe token | JSON-encoded | String | | :sup:`1)` | Legacy method | +----------------+------------------+----------------+--------+---------+-----------+------------------+ .. note:: :sup:`1)` One of the methods is required. Response Attributes ~~~~~~~~~~~~~~~~~~~ +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | Attribute | Description | Type | Comment + | +========================================+===========================================================+=========+========================+ | CALLINFO.errorcodes | Number of errors | Integer | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | CALLINFO.errors | Number of errors | Integer | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | CALLINFO.general | Information | Array | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | CALLINFO.handler | Handler used | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | CALLINFO.status | SUCCESS or FAIL | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | DATA | Supplied data in API-call | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | HEADERS.(headers) | HTTP Headers | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE | TEMPLATE | Array | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO | INFO entry | Object | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.active | Active (True/False) | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.ico | Icon used for template | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.id | Template-ID | Integer | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.name | Name of Template | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.wb | Use workbench for edit? (Use "ed" if False) | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.ed | Edit directly? (no subitems) | Boolean | If wb is False | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.INFO.jp | Jump to parent on save? | Boolean | If wb is False | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE | STRUCTURE entry | Object | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field) | Template information | Object | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).alarm | Should alarm sound if object is decrypted? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).cc | Needs to be changed to be considered unseen? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).encrypted | Is field encrypted? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).nc | Encrypted fields needs to be clicked to be revealed? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).opt | Is this an optional field or is it required to be filled? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).policy | Should field honor Vaults password policy? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).show | Show field normally or only in workbench? | Boolean | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).translation | Descriptive text (english) | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | TEMPLATE.STRUCTURE.(field).type | Type of element (text, textarea, text-passwdgen, file) | String | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | PARAMS | Route parameters (empty) | Array | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | ERRORCODES | Error code and text (Only present if errors) | Object | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ | ERRORS | Error code and text (Only present if errors) | Array | | +----------------------------------------+-----------------------------------------------------------+---------+------------------------+ Examples ~~~~~~~~ Obtain list of all available templates. **Request** :: GET /api/1.0/template x-http-token: your_storedsafe_token **Response** :: HTTP/2 200 Content-type: application/json; charset=UTF-8 { "CALLINFO": { "errorcodes": 0, "errors": 0, "general": [], "handler": "TemplateHandler", "status": "SUCCESS", "token": "rotated_storedsafe_token" }, "DATA": { "token": "your_storedsafe_token" }, "HEADERS": { "Accept": "*/*", "Host": "safe.domain.cc", "User-Agent": "curl/7.64.1", "X-Http-Token": "your_storedsafe_token" }, "PARAMS": [], "TEMPLATE": [ { "INFO": { "active": true, "ico": "ico_folder", "id": "2", "name": "Folder", "wb": true }, "STRUCTURE": { "info": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": true, "policy": false, "show": true, "translation": "Description", "type": "textarea" }, "name": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": false, "policy": false, "show": true, "translation": "Folder name", "type": "text" } } }, { "INFO": { "active": true, "ico": "ico_server", "id": "4", "name": "Login", "wb": true }, "STRUCTURE": { "host": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": false, "policy": false, "show": true, "translation": "Host / IP", "type": "text" }, "password": { "alarm": true, "cc": true, "encrypted": true, "nc": true, "opt": false, "policy": true, "show": true, "translation": "Password", "type": "text-passwdgen" }, "username": { "alarm": false, "cc": false, "encrypted": false, "log": true, "nc": false, "opt": false, "policy": false, "show": true, "translation": "Username", "type": "text" } } }, . . { "INFO": { "active": true, "ico": "ico_server", "id": "1001", "name": "Server/IP", "wb": true }, "STRUCTURE": { "cryptedinfo": { "alarm": false, "cc": false, "encrypted": true, "nc": false, "opt": true, "policy": false, "show": false, "translation": "Sensitive info", "type": "textarea" }, "host": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": false, "policy": false, "show": true, "translation": "Host", "type": "text" }, "info": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": true, "policy": false, "show": true, "translation": "Information", "type": "textarea" }, "ip": { "alarm": false, "cc": false, "encrypted": false, "nc": false, "opt": false, "policy": false, "show": true, "translation": "IP", "type": "text" }, "password": { "alarm": true, "cc": true, "encrypted": true, "nc": true, "opt": false, "policy": true, "show": true, "translation": "Password", "type": "text-passwdgen" }, "username": { "alarm": false, "cc": false, "encrypted": false, "log": true, "nc": false, "opt": false, "policy": false, "show": true, "translation": "Username", "type": "text" } } } ] }