Opkey Device Interaction API

The Device Interaction API from Opkey — 8 operation(s) for device interaction.

OpenAPI Specification

opkey-device-interaction-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: pCloudy Device Cloud Device Interaction API
  version: v2
  summary: Public REST API for the pCloudy real-device cloud, an Opkey product.
  description: 'The pCloudy REST API is the machine-readable surface of the pCloudy real-device testing cloud operated by Opkey (Smart Software Testing Solutions Inc.). It covers authentication, device booking and session lifecycle, app upload/install/control, device interaction, performance capture, session media and logs, network simulation, APK instrumentation, app resigning, App Center integration, and Appium/XCTest automation orchestration. All methods default to POST except authentication, and requests set Content-Type: application/json.


    PROVENANCE: this document was generated by API Evangelist from the operations, parameters and examples published in Opkey''s own public pCloudy API Reference at https://content.pcloudy.com/apidocs/ . Opkey does not publish an OpenAPI document; every path, method, parameter and description here is transcribed from that published reference and nothing has been invented. It is a third-party transcription, not a provider artifact.'
  contact:
    name: Opkey
    url: https://www.opkey.com/
  x-generated-by: API Evangelist enrichment pipeline
  x-source: https://content.pcloudy.com/apidocs/
servers:
- url: https://{cloud}.pcloudy.com
  description: pCloudy cloud instance
  variables:
    cloud:
      default: device
      enum:
      - device
      - demo
      - aus
      description: pCloudy cloud host prefix; the docs refer to this as <Cloud URL>.
security:
- accessToken: []
tags:
- name: Device Interaction
paths:
  /api/v2/send-text:
    post:
      operationId: sendText
      summary: Send Text
      tags:
      - Device Interaction
      description: Types the supplied text into the currently focused input field on the device, simulating keyboard entry. Used to fill forms, search boxes, and login fields during automation without invoking a full Appium driver.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - text
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
                text:
                  type: string
                  description: Text to type on the device.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: rvvl8cZniTjpOZc3PjML
                requestId: 2hdwScztjkJSTbJluNpPx
                statusCode: 200
                status: success
                message: Text sent successfully
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/v2/rotate-device:
    post:
      operationId: rotateDevice
      summary: Rotate Devices
      tags:
      - Device Interaction
      description: Changes the device screen orientation between portrait and landscape. Used to verify responsive layouts, orientation-change handling, and rotation-locked screens during testing.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - rotate
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
                rotate:
                  type: string
                  description: 'Orientation: "L" (landscape) or "P" (portrait).'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: HENicjFnrTPEwgD8oG3P
                requestId: AygidMFjGKRj1CTHnVlG
                statusCode: 200
                status: success
                message: Rotate Successful
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/v2/send-home:
    post:
      operationId: sendHome
      summary: Send Home / Click Home
      tags:
      - Device Interaction
      description: Sends the device to its home screen, equivalent to pressing the hardware/software Home button. Used to background the current app, return to a known state, or test how the app behaves when interrupted.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: BQNca3oxFdvxcfRGaFiO
                requestId: LLUZIiZB2ScmMG1bBVsp
                statusCode: 200
                status: success
                message: Home reached
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/v2/execute-adb:
    post:
      operationId: executeAdb
      summary: Execute ADB - Android
      tags:
      - Device Interaction
      description: Executes a supplied ADB (Android Debug Bridge) shell command on the reserved Android device and returns its output. Used for advanced device control and diagnostics not covered by the dedicated APIs — for example setting system properties, querying device state, or running shell utilities. Android only.
      parameters:
      - name: token
        in: header
        required: true
        description: Authtoken (this will get from authenticate response)
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - adbCommand
              properties:
                rid:
                  type: string
                  description: Reservation id (will get from book device api response)
                adbCommand:
                  type: string
                  description: adb command which you want to execute on device.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: yQaPaWw3ib98z0HSS4Qw
                requestId: o9vEkKH0nbljA3wPNGGo
                statusCode: 200
                status: OK
                data: RZCY1020BRV
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/v2/set-passcode:
    post:
      operationId: setPasscodeIos
      summary: Set Passcode iOS
      tags:
      - Device Interaction
      description: Sets a device passcode/lock on a reserved iOS device. Used to test flows that require a device passcode — for example secure storage, biometric fallbacks, or MDM policies. Pair with the reset call to remove it afterwards. iOS only.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - passcode
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
                passcode:
                  type: string
                  description: '"set" or "reset".'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: A6XIN11vsnZZif53w5Fa
                requestId: fV3Ot1hbNceuWOlwFW9ld
                statusCode: 200
                status: success
                message: success
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/v2/toggle-offline-mode:
    post:
      operationId: toggleOfflineModeEnable
      summary: Toggle Offline Mode Enable iOS
      tags:
      - Device Interaction
      description: Enables offline (airplane) mode on a reserved iOS device, disabling its network radios. Used to test offline behaviour, error states, and reconnection handling; re-enable connectivity with the disable call.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - enable
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
                enable:
                  type: boolean
                  description: true/false toggle.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: lt5OviYpzDkAxSRZXAO
                requestId: zdOW1lwNz2tTc2LcDHfu
                statusCode: 200
                status: success
                message: Offline mode enabled
                data:
                  isOk: true
                  statusCode: 200
                  data:
                    statusCode: 200
                    message: Enable operation for offline mode Successful
                  err: null
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/fingerprint_auth:
    post:
      operationId: biometricAuthentication
      summary: Biometric Authentication
      tags:
      - Device Interaction
      description: Simulates a biometric authentication event (fingerprint / Touch ID / Face ID) on the device, returning success or failure. Used to test biometric-protected flows such as login, secure storage, and payment confirmation without physical interaction.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - auth_state
              properties:
                rid:
                  type: integer
                  description: Device reservation ID (returned when the device is booked).
                auth_state:
                  type: boolean
                  description: Request parameter.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                result:
                  code: 200
                  status: true
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
  /api/imageInject:
    post:
      operationId: injectImage
      summary: Inject Image
      tags:
      - Device Interaction
      description: Injects a supplied image into the device's camera feed or gallery so the app reads it as if captured by the camera. Used to test camera-based flows such as QR/barcode scanning, document capture, and image upload with deterministic inputs.
      parameters:
      - name: token
        in: header
        required: true
        description: API access token (from /api/access).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - rid
              - fileName
              - version
              properties:
                rid:
                  type: string
                  description: Device reservation ID (returned when the device is booked).
                fileName:
                  type: string
                  description: Request parameter.
                version:
                  type: string
                  description: Request parameter.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                traceId: fdjixR4A2GBcgiD25Kuc
                requestId: uA1gWOYKPZ7BqoAaBzx4
                statusCode: 200
                status: success
                message: Successfully Injected
        '401':
          description: Unauthorized - missing or invalid access token
      security:
      - accessToken: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic with your pCloudy email as the username and your API access key as the password. Used only by GET /api/access to mint an access token.
    accessToken:
      type: apiKey
      in: header
      name: token
      description: Access token returned by GET /api/access. Newer /api/v2/* operations send it as a `token` header; several legacy /api/* operations send the same token as a `token` field in the JSON request body.
externalDocs:
  description: pCloudy API Reference
  url: https://content.pcloudy.com/apidocs/