Konsole: folders
Als Markdown kopierenDiese Routen liegen auf der Konsole, Port 3375. Sie nehmen ein API-Token als Authorization: Bearer ndt_...; siehe API-Tokens. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.
Folders that sort devices.
Put one device into a folder, or take it out.
Needs device.edit. neodesk folders move-device calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The device ID (see devices list) |
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
folderId |
integer or string or null | The folder ID; null or left out takes the device out of its folder; at least 0, at most 2147483647 |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |
List folders with how many devices each holds.
Needs device.view. neodesk folders list calls it.
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
data.folders |
array of DeviceFolder | yes |
data.total |
integer | yes |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Create a folder.
Setting the access lists needs the right to change a group's access.
Needs device.edit. neodesk folders create calls it.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
name |
string | yes | Trimmed; at most 50 characters |
color |
string | default "#6366f1" |
|
icon |
string | default "folder" |
|
allowed_users |
array of string | Usernames that may see the folder's devices; at most 100 items | |
allowed_groups |
array of string | GUIDs of the user groups whose members may see the folder's devices; at most 100 items |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | yes |
data.id |
integer | |
data.name |
string | |
data.color |
string | |
data.icon |
string | |
data.allowed_users |
array of string | |
data.allowed_groups |
array of string |
| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Rename a folder, change its color or icon, or who may see its devices.
Give only what changes. Changing the access lists needs the right to change the folder's access.
Needs device.edit. neodesk folders update calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The folder ID |
Request body, application/json:
| Field | Type | What it is |
|---|---|---|
name |
string | Trimmed; at most 50 characters |
color |
string | |
icon |
string | |
allowed_users |
array of string | Usernames that may see the folder's devices; at most 100 items |
allowed_groups |
array of string | GUIDs of the user groups whose members may see the folder's devices; at most 100 items |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |
Delete a folder; its devices stay, without a folder.
Needs device.edit. neodesk folders delete calls it. It cannot be undone.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The folder ID |
200: Done (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |
Put devices into a folder (folder 0 takes them out of theirs).
Every device must exist and be one the account may see, or none is moved.
Needs device.edit. neodesk folders add-devices calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The folder ID, or 0 to take the devices out of their folders |
Request body, application/json:
| Field | Type | Required |
|---|---|---|
deviceIds |
array of string | yes |
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | yes | |
data.count |
integer | How many devices moved |
| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | The folder does not exist, or a device of the list does not; the answer then names it in id |