Esper Commands API

APIs to run device commands. `This version of commands is being deprecated and documentation will be archived soon. Please use Commands V2.`

OpenAPI Specification

esper-commands-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: "# Introduction\nEsper APIs are a set of REST-based APIs that help you programmatically control and monitor Android-based Dedicated Devices running the Esper agent using Esper Manage. With these APIs, you can orchestrate and manage devices that have been provisioned against your Esper Manage environment. Furthermore, these APIs allows you to manage the Android applications installed on your Dedicated Device fleet. To read more about the various capabilities of Esper APIs and Esper managed devices, please visit [esper.io](https://esper.io). This guide describes all the available APIs in detail, along with code samples for you to quickly ramp up to using them.\\\nTo use these APIs you will need to create a developer account with Esper and get access to the Esper Dev Console and the Esper ManageDashboard. You can find out more about Esper and sign up for free at [esper.io/signup](https://esper.io/signup)\\\nWe've done our best to keep this document up to date, but if you find any issues, please reach out to us at developer@esper.io.\n\n# SDK\n\n  You are welcome to use your favorite HTTP/REST library for your programming language in order to call these APIs, or you can use our SDK (currently supporting [python](https://github.com/esper-io/esper-client-py)) to do so.\n\n\n# Authentication\nThe client needs to send authentication details to access the Esper APIs by generating and applying an API key. Be sure to sign up for your free trial account with Esper Dev to generate your key:\n\n# Errors\nThe APIs use standard HTTP status codes to indicate success or failure. All error responses will have a JSON body in the following format:\n\n```\n{\n  \"errors\": [],\n  \"message\": \"error message\",\n  \"status\": 400\n}\n```\n* `errors` -  List of error details\n* `message` - Error description\n* `status` - HTTP status code\n"
  version: 1.0.0
  title: ESPER API REFERENCE Application Commands API
  termsOfService: https://esper.io/terms-of-service
  contact:
    email: developer@esper.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
host: foo-api.esper.cloud
basePath: /api
schemes:
- https
tags:
- name: Commands
  description: 'APIs to run device commands.

    `This version of commands is being deprecated and documentation will be archived soon. Please use Commands V2.`

    '
  externalDocs:
    description: Find out more about device commands
    url: https://docs.esper.io/home/console/device-management/-/#device-actions
paths:
  /enterprise/{enterprise_id}/device/{device_id}/command/:
    post:
      summary: Run commands on device
      description: Fire commands on device like reboot, ping etc. Deprecated in favour of commands V2.
      operationId: runCommand
      deprecated: true
      produces:
      - application/json
      parameters:
      - name: enterprise_id
        in: path
        description: ID of the enterprise
        required: true
        type: string
        format: uuid
      - name: device_id
        in: path
        description: ID of the device
        required: true
        type: string
        format: uuid
      - name: command
        in: body
        description: Command request body
        required: true
        schema:
          $ref: '#/definitions/CommandRequest'
      responses:
        200:
          description: successful operation
          schema:
            $ref: '#/definitions/DeviceCommand'
      security:
      - apiKey: []
      tags:
      - Commands
  /enterprise/{enterprise_id}/device/{device_id}/command/{command_id}/:
    parameters:
    - name: command_id
      in: path
      description: A UUID string identifying this device command.
      required: true
      type: string
      format: uuid
    - name: device_id
      in: path
      description: A UUID string identifying this device.
      required: true
      type: string
      format: uuid
    - name: enterprise_id
      description: A UUID string identifying enterprise.
      in: path
      required: true
      type: string
      format: uuid
    get:
      operationId: getCommand
      summary: Get command status
      description: Return DeviceCommand instance. Deprecated in favour of commands V2.
      deprecated: true
      produces:
      - application/json
      parameters: []
      responses:
        '200':
          description: successful operation
          schema:
            $ref: '#/definitions/DeviceCommand'
      security:
      - apiKey: []
      tags:
      - Commands
definitions:
  SettingsGPSStateEnum:
    type: integer
    description: 'Device settings GPS state enum


      ```

      * LOCATION_MODE_HIGH_ACCURACY = 0

      * LOCATION_MODE_SENSORS_ONLY = 1

      * LOCATION_MODE_BATTERY_SAVING = 2

      * LOCATION_MODE_OFF = 3

      ```

      '
    enum:
    - 0
    - 1
    - 2
    - 3
  DeviceCommand:
    required:
    - command
    - enterprise
    - device
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      current_base_uri:
        title: Current base uri
        type: string
        minLength: 1
      command_args:
        $ref: '#/definitions/CommandArgs'
      action:
        title: Action
        type: string
        enum:
        - acknowledge
        - in_progress
        - success
        - failed
      schedule:
        title: Schedule
        type: string
      group_schedule_id:
        title: Group schedule id
        type: string
        format: uuid
      command:
        $ref: '#/definitions/DeviceCommandEnum'
      state:
        title: State
        type: string
        enum:
        - Command Initiated
        - Command Acknowledged
        - Command In Progress
        - Command TimeOut
        - Command Success
        - Command Failure
        - Command Scheduled
      details:
        title: Details
        type: string
        x-nullable: true
      created_on:
        title: Created on
        type: string
        format: date-time
        readOnly: true
      updated_on:
        title: Updated on
        type: string
        format: date-time
        readOnly: true
      enterprise:
        title: Enterprise
        type: string
        format: url
      device:
        title: Device
        type: string
        format: url
      group_command:
        title: Group command
        type: string
        format: url
        x-nullable: true
      issued_by:
        title: Issued by
        type: string
        format: url
        x-nullable: true
  SettingsRotateStateEnum:
    type: integer
    description: 'Device settings rotate state enum


      ```

      * AUTO = 0

      * PORTRAIT_ONLY = 1

      * LANDSCAPE_ONLY = 2

      ```

      '
    enum:
    - 0
    - 1
    - 2
  CommandArgs:
    title: Command args
    type: object
    properties:
      wipe_external_storage:
        type: boolean
        default: false
      wipe_FRP:
        type: boolean
        default: true
      brightness_value:
        type: integer
        minimum: 1
        maximum: 100
      stream:
        $ref: '#/definitions/SettingsVolumeStreamEnum'
      volume_level:
        type: integer
        minimum: 0
        maximum: 100
      wifi_state:
        type: boolean
      bluetooth_state:
        type: boolean
      rotate_state:
        $ref: '#/definitions/SettingsRotateStateEnum'
      gps_state:
        $ref: '#/definitions/SettingsGPSStateEnum'
      screen_off_timeout:
        description: Value in seconds
        type: integer
        minimum: 5000
        maximum: 1800000
      app_version:
        type: string
      package_name:
        type: string
  CommandRequest:
    required:
    - command
    type: object
    properties:
      command_args:
        $ref: '#/definitions/CommandArgs'
      command:
        $ref: '#/definitions/DeviceCommandEnum'
  SettingsVolumeStreamEnum:
    type: integer
    description: 'Device settings volume stream enum


      ```

      * STREAM_RING = 0

      * STREAM_NOTIFICATION = 1

      * STREAM_ALARM = 2

      * STREAM_MUSIC = 3

      ```

      '
    enum:
    - 0
    - 1
    - 2
    - 3
  DeviceCommandEnum:
    type: string
    description: "Command Options\n\n```\n* REBOOT: Reboot device\n* LOCK:  Lock device screen\n* INSTALL:  Install an app on device\n* UNINSTALL: Uninstall an app from device\n* WIPE: Wipe device\n* UPDATE_HEARTBEAT: Ping Device\n* SET_WIFI_STATE: wifi on/off\n* SET_BLUETOOTH_STATE: Bluetooth on/off\n* SET_ROTATION_STATE: Auto rotate setting\n* SET_GPS_STATE: GPS options\n* SET_BRIGHTNESS_SCALE: Brightness control\n* SET_STREAM_VOLUME: Volume control\n* SET_SCREEN_OFF_TIMEOUT: Screen timeout setting\n* ADD_TO_WHITELIST: Whitelist an installed sytem app\n* CLEAR_APP_DATA: Clear app data\n* CAPTURE_SCREENSHOT: Allows you to take a screenshot of the device's current screen. The \"tag\" is an optional param that can be set to corresponding screenshot. \n```\n"
    enum:
    - REBOOT
    - LOCK
    - INSTALL
    - UPDATE_HEARTBEAT
    - WIPE
    - SET_WIFI_STATE
    - SET_BLUETOOTH_STATE
    - SET_ROTATION_STATE
    - SET_GPS_STATE
    - SET_BRIGHTNESS_SCALE
    - SET_STREAM_VOLUME
    - SET_SCREEN_OFF_TIMEOUT
    - UNINSTALL
    - ADD_TO_WHITELIST
    - CLEAR_APP_DATA
    - CAPTURE_SCREENSHOT
securityDefinitions:
  apiKey:
    description: "#### API KEY - Access Token\nAccess token for APIs passed as authorization header in calls. You need to generate this from your Esper Dev Console at `<domain>-api.esper.cloud` where foo is the sub-domain name you gave for your Esper Dev environment when you signed up for your Esper Dev account. Please follow the instructions [here](https://docs.esper.io/home/module/genapikey.html) to generate an access token.\nOnce you have the access token, you need to send an authorization header as below\n\n```bash\n\n    curl -X GET \\\n      https://<domain>-api.esper.cloud/api/enterprise/<enterprise_id>/device/ \\\n      -H 'Authorization: Bearer <ACCESS_TOKEN>' \\\n      -H 'Content-Type: application/json' \\\n```\n\n> Please note the use of keyword **Bearer** before the token value.\n\n\nYou can read more about api key authentication scheme [here](https://console-docs.esper.io/API/generate.html).\n"
    name: Authorization
    type: apiKey
    in: header
x-tagGroups:
- name: API Reference
  tags:
  - Enterprise
  - Application
  - Application V1
  - Device
  - Device Group
  - Commands
  - Group Commands
  - Token
  - Commands V2
  - Enterprise Policy
  - Geofence
  - Reports
  - Subscription
  - Content