Restarting Devices with API
What
Use the FileWave API to restart multiple managed Android, Apple, or Windows devices. Each platform uses its own endpoint and request body, so choose the matching example below.
How
The ids values are numeric FileWave Client IDs—not Inventory Client.device_id values. Find Client ID in the Clients view or add it to a FileWave Central Report (formerly Query).
Put one or more Client IDs in the JSON ids array, separated by commas. Confirm the target list before sending a bulk restart because the command can interrupt active users.
The endpoint and JSON structure differ by platform. Confirm the applicable route in the Swagger documentation supplied by the FileWave Server version you are using.
The examples use demo.filewave.ch. Replace it with your FileWave Server FQDN. The screenshot shows where that server address appears in FileWave Central Preferences.
Example Server Name:
Android
Example device:
API URL:
"https://demo.filewave.ch/api/android/restart_devices"
Data Block:
{
"ids": [
54290
]
}
Apple
Example device:
API URL
"https://demo.filewave.ch/api/devices/v1/devices/mdm-command"
Data Block
{
"ids": [
54000
],
"command": "RestartDevice"
}
Windows
Example device:
API URL
"https://demo.filewave.ch/api/devices/v1/devices/windows-restart"
Data Block
[
{
"ids": [
54028
]
}
]
Restart two Apple devices
This example sends RestartDevice to Client IDs 737581 and 562620. Create or copy an application token in FileWave Central:
- Open Assistants > Manage Administrators.
- Select a dedicated API administrator, then open Application Tokens.
Application tokens are unique to an administrator. One administrator can have multiple tokens that can be revoked independently.
Use a dedicated administrator with only the permissions required for the API task. Separate tokens make rotation and revocation less disruptive.
Replace the example server, Client IDs, and authorization placeholder before running a request. Keep production tokens out of saved scripts, command history, and documentation.
macOS/Linux:
mdm_command='{"ids": [737581, 562620],"command": "RestartDevice"}'
curl -H "Authorization: ezlmZjJkMDZhLTg1YWEtNDY5Ny04NDYzLTVjMGU3MjhjODEyN30=" \
-X POST https://demo.filewave.ch/api/devices/v1/devices/mdm-command \
-d "$mdm_command" \
-H "Content-Type: application/json"
Windows:
$mdm_command = '{"ids": [737581, 562620],"command": "RestartDevice"}'
$header = @{Authorization=“ezlmZjJkMDZhLTg1YWEtNDY5Ny04NDYzLTVjMGU3MjhjODEyN30="}
Invoke-RestMethod -Method POST \
-Headers $header \
-ContentType application/json \
-Uri https://demo.filewave.ch/api/devices/v1/devices/mdm-command \
-Body $mdm_command





No comments to display
No comments to display