5.14.1 api dir template
The /api/dir/template function retrieves the template of an entry in the directory.
Methods
GET
POST
Request
Key Name | Mandatory | Expected Values | Default Value | Description |
---|---|---|---|---|
N/A | - | - | - | - |
Example of a Request
https://192.168.1.1/api/dir/template
Response
The response is in the application/json format. The result object contains the keys series and users.
Go to the topic api/dir/query to get more information on the use of the key series.
The key users contains an array with one object (entry template) that contains all available keys of an entry in the directory with their default values for a particular device.
Tip
- You can get better acquainted with the structure of the JSON response in the example at the end of this topic.
Note
- Available keys depend on the model, type and hardware configuration of a device (e.g. key photo is only applicable for devices that have a display and store images in their directories).
Key | Typical Returned Values | Description |
---|---|---|
uuid | Empty | Unique User Identifier. When a new entry in the directory is created by api/dir/create, uuid can be either provided as a parameter of the request or automatically generated by the device. The format of uuid is "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", where X can be any hexadecimal digit. All zeroes are reserved for an empty uuid. |
deleted |
| Indication of whether an entry in the directory has been deleted or not. Deleted entries remain in the directory until the maximum number of entries is reached. Stored deleted entries preserve uuid only for logging reasons. Two valid values: |
owner | Empty | Indication of whether an entry in the directory is remotely managed by 2N® My2N, 2N® Access Commander or another remote management system. This value is intended for internal 2N® TELEKOMUNIKACE a.s. usage, alternatively it can be used for deleting a group of users (see api/dir/delete). |
name | Empty | Name of an entry in the directory (a user or device name). A string of up to 63 characters is expected. The name can be left empty (the entry is in such a case identified by its uuid in logs, emails, etc.). |
photo | Empty | Image of an entry in the directory (e.g. user’s photo, company logo). Saved as base64 encoded jpeg with the following syntax: |
Empty | Email address of an entry in the directory. The expected format is namestructure@domainhierarchy.top. It is possible to enter multiple addresses separated with commas (saved as one string). | |
treepath | / | Definition of positions of an entry in the directory on the display.
|
virtNumber | Empty | Virtual number of an entry in the directory. Virtual numbers may be dialed using a dialpad (if configured). The maximum length is 7 characters. The first and the last character may be chosen from the range of A to Z or 0 to 9. The rest of the characters may be between 0 to 9. |
deputy | Empty | Uuid of a deputy entry that is called when the original callee is unavailable or not answering. When the deputy is not set the deputy uuid, it remains empty. |
buttons | Empty | Buttons assigned to this entry in the directory. An array of integers (assigned according to the button position starting from 1) separated by a comma. |
callPos | Array | Calling information of an entry. Entered as an array of up to three objects, i.e. up to three sets of calling information can be entered. Each of these three objects can contain the following keys:
|
access | JSON Object | Access Control information of an entry in the directory. Contains the following keys:
|
timestamp | 0 | A timestamp of performed changes in the directory. Timestamps are automatically generated by the directory in an ascending order. Go to the topic api/dir/query to get more information on the use of the timestamp. |
Example of a Response
{ "success": true, "result": { "series": "5247939846841727056", "users": [ { "uuid": "", "deleted": false, "owner": "", "name": "", "photo": "", "email": "", "treepath": "\/", "virtNumber": "", "deputy": "", "buttons": "", "callPos": [ { "peer": "", "profiles": "", "grouped": false, "ipEye": "" }, { "peer": "", "profiles": "", "grouped": false, "ipEye": "" }, { "peer": "", "profiles": "", "grouped": false, "ipEye": "" } ], "access": { "validFrom": "0", "validTo": "0", "accessPoints": [ { "enabled": true, "profiles": "" }, { "enabled": true, "profiles": "" } ], "pairingExpired": false, "virtCard": "", "card": [ "", "" ], "mobkey": "", "fpt": "", "pin": "", "apbException": false, "code": [ "", "", "", "" ], "licensePlates": "", "liftFloors": "" }, "timestamp": 0 } ] } }