GET /service/api/console/gsm/{gsmKey}/sites/{siteId}/endpoints/{endpointId}/commands
 ?command={command}
 &commandState={commandState}
 &startDate={startDate}
 &endDate={endDate}
 &order={order}
 &orderDirection={orderDirection}
 &pageSize={pageSize}
 &pageNr={pageNr}

Gets a list of executed commands on a given endpoint.

Only returns the executed commands from the past 6 months.

Request Information

URI Parameters

NameDescriptionTypeAdditional Information
gsmKey

The GSM console keycode.

string

Required

siteId

The site identifier.

string

Required

endpointId

The endpoint identifier to get the executed commands for.

string

Required

command

Used to filter by command type. Valid values are "scan", "cleanup", "uninstall", "changekeycode", "restart".

string

None.

commandState

Used to filter by the state. Valid values are:

  • 1 for "elapsed": The command elapsed as the endpoint did not report in within a valid time window.
  • 2 for "not yet received": The endpoint has not yet reported to pick up the command, but is still in a valid time window.
  • 3 for "executed": The endpoint reported in and the command has been sent.
  • 4 for "scheduled": The command has not been sent yet.

string

None.

startDate

If specified, returns all issued commands after (or at) the given date.

date

None.

endDate

If specified, returns all issued commands before (or at) the given date.

date

None.

order

Used to determine the order field. Valid values are "daterequested", "hostname", "commandstate", "command". Default value is "daterequested".

string

None.

orderDirection

Used to sort the data. "A" for ascending. "D" for descending. Default value is "D".

string

None.

pageSize

Specifies the number of records being returned.

integer

Default value is 50

pageNr

Specifies the page number. Can be used to retrieve the next batch of records. Default value is 1.

integer

Default value is 1

Body Parameters

None.

Response Information

Resource Description

Information about the executed commands.

GetCommandsResponseModel
NameDescriptionTypeAdditional Information
TotalAvailable

The total number of commands in the past 6 months. Use this value to determine if you need to retrieve additional pages of data.

integer

None.

PageNr

The number of the page that was requested.

integer

None.

PageSize

The size of the page that was requested.

integer

None.

Commands

List of command records.

Collection of GetCommandsResponseModel_Command

None.

Sample Response

{
  "TotalAvailable": 2,
  "PageNr": 1,
  "PageSize": 50,
  "Commands": [
    {
      "DateRequested": "2019-05-22T15:11:21.0852867Z",
      "EndpointId": "d857f16a-1d62-4140-8918-988114cde062",
      "HostName": "MyComputer1",
      "StartDate": "2019-05-22T18:11:21.0852867Z",
      "EndDate": "2019-05-23T04:11:21.0852867Z",
      "Command": "scan",
      "Parameters": null,
      "CommandState": 3
    },
    {
      "DateRequested": "2019-05-22T14:11:21.0852867Z",
      "EndpointId": "f588dae5-94e5-499c-b944-04d7211b6206",
      "HostName": "MyComputer2",
      "StartDate": "2019-05-22T19:11:21.0852867Z",
      "EndDate": "2019-05-23T05:11:21.0852867Z",
      "Command": "scan",
      "Parameters": null,
      "CommandState": 1
    }
  ]
}                    
<GetCommandsResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Webroot.UnityAPI.ServiceExtension.Console.Models">
  <Commands>
    <GetCommandsResponseModel_Command>
      <Command>scan</Command>
      <CommandState>3</CommandState>
      <DateRequested>2019-05-22T15:11:21.0852867Z</DateRequested>
      <EndDate>2019-05-23T04:11:21.0852867Z</EndDate>
      <EndpointId>d857f16a-1d62-4140-8918-988114cde062</EndpointId>
      <HostName>MyComputer1</HostName>
      <Parameters i:nil="true" />
      <StartDate>2019-05-22T18:11:21.0852867Z</StartDate>
    </GetCommandsResponseModel_Command>
    <GetCommandsResponseModel_Command>
      <Command>scan</Command>
      <CommandState>1</CommandState>
      <DateRequested>2019-05-22T14:11:21.0852867Z</DateRequested>
      <EndDate>2019-05-23T05:11:21.0852867Z</EndDate>
      <EndpointId>f588dae5-94e5-499c-b944-04d7211b6206</EndpointId>
      <HostName>MyComputer2</HostName>
      <Parameters i:nil="true" />
      <StartDate>2019-05-22T19:11:21.0852867Z</StartDate>
    </GetCommandsResponseModel_Command>
  </Commands>
  <PageNr>1</PageNr>
  <PageSize>50</PageSize>
  <TotalAvailable>2</TotalAvailable>
</GetCommandsResponseModel>