Method: enterprises.devices.executeCommand
Stay organized with collections
Save and categorize content based on your preferences.
Executes a command to device managed by the enterprise.
HTTP request
POST https://smartdevicemanagement.googleapis.com/v1/{name=enterprises/*/devices/*}:executeCommand
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
name |
string
The name of the device requested. For example: "enterprises/XYZ/devices/123"
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"command": string,
"params": {
object
}
} |
Fields |
command |
string
The command name to execute, represented by the fully qualified protobuf message name.
|
params |
object (Struct format)
The command message to execute, represented as a Struct.
|
Response body
Response message for SmartDeviceManagementService.ExecuteDeviceCommand
If successful, the response body contains data with the following structure:
JSON representation |
{
"results": {
object
}
} |
Fields |
results |
object (Struct format)
The results of executing the command.
|
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/sdm.service
For more information, see the OAuth 2.0 Overview.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-07 UTC."],[[["\u003cp\u003eExecutes a specified command on a device managed by the enterprise using an HTTP POST request.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires the command name and parameters, formatted as a JSON object.\u003c/p\u003e\n"],["\u003cp\u003eThe response body provides the command execution results, also formatted as a JSON object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/sdm.service\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ExecuteDeviceCommandResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Examples](#examples)\n\nExecutes a command to device managed by the enterprise.\n\nHTTP request\n\n`POST https://smartdevicemanagement.googleapis.com/v1/{name=enterprises/*/devices/*}:executeCommand`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------|\n| `name` | `string` The name of the device requested. For example: \"enterprises/XYZ/devices/123\" |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------|\n| ``` { \"command\": string, \"params\": { object } } ``` |\n\n| Fields ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `command` | `string` The command name to execute, represented by the fully qualified protobuf message name. |\n| `params` | `object (`[Struct](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Struct)` format)` The command message to execute, represented as a Struct. |\n\nResponse body Response message for SmartDeviceManagementService.ExecuteDeviceCommand\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------|\n| ``` { \"results\": { object } } ``` |\n\n| Fields ||\n|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `results` | `object (`[Struct](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Struct)` format)` The results of executing the command. |\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/sdm.service`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]