- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- Command
- CommandType
- CommandErrorCode
- ResetPasswordFlag
- Try it!
Issues a command to a device. The Operation
resource returned contains a Command
in its metadata
field. Use the get operation method to get the status of the command.
HTTP request
POST https://androidmanagement.googleapis.com/v1/{name=enterprises/*/devices/*}:issueCommand
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
The name of the device in the form |
Request body
The request body contains an instance of Command
.
Response body
If successful, the response body contains an instance of Operation
.
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/androidmanagement
For more information, see the OAuth 2.0 Overview.
Command
A command.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
The type of the command. |
createTime |
The timestamp at which the command was created. The timestamp is automatically generated by the server. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
duration |
The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if unspecified is ten minutes. There is no maximum duration. A duration in seconds with up to nine fractional digits, terminated by ' |
userName |
The resource name of the user that owns the device in the form |
errorCode |
If the command failed, an error code explaining the failure. This is not set when the command is cancelled by the caller. |
newPassword |
For commands of type |
resetPasswordFlags[] |
For commands of type |
CommandType
Types of commands.
Enums | |
---|---|
COMMAND_TYPE_UNSPECIFIED |
This value is disallowed. |
LOCK |
Lock the device, as if the lock screen timeout had expired. |
RESET_PASSWORD |
Reset the user's password. |
REBOOT |
Reboot the device. Only supported on fully managed devices running Android 7.0 (API level 24) or higher. |
RELINQUISH_OWNERSHIP |
Removes the work profile and all policies from a company-owned Android 8.0+ device, relinquishing the device for personal use. Apps and data associated with the personal profile(s) are preserved. The device will be deleted from the server after it acknowledges the command. |
CommandErrorCode
A command error code.
Enums | |
---|---|
COMMAND_ERROR_CODE_UNSPECIFIED |
There was no error. |
UNKNOWN |
An unknown error occurred. |
API_LEVEL |
The API level of the device does not support this command. |
MANAGEMENT_MODE |
The management mode (profile owner, device owner, etc.) does not support the command. |
INVALID_VALUE |
The command has an invalid parameter value. |
UNSUPPORTED |
The device doesn't support the command. Updating Android Device Policy to the latest version may resolve the issue. |
ResetPasswordFlag
Flags that can be used for the RESET_PASSWORD
command type.
Enums | |
---|---|
RESET_PASSWORD_FLAG_UNSPECIFIED |
This value is ignored. |
REQUIRE_ENTRY |
Don't allow other admins to change the password again until the user has entered it. |
DO_NOT_ASK_CREDENTIALS_ON_BOOT |
Don't ask for user credentials on device boot. |
LOCK_NOW |
Lock the device after password reset. |