No internet connection
  1. Home
  2. Technical Support

How to send a keystroke from the community api

By Samuel Burns @delaer426
    2022-07-07 16:39:51.424Z

    Hello,

    Has anyone successfully sent a keystroke using the community api?

    I want to write an ansible playbook on a cron job to call the api and send a keystroke to keep the end device from locking

    Currently I downloaded Burp and am seeing the http history under the proxy tab, I am not able how to make a post call to the api from postman

    Example:

    https://myipaddress/socket.io/keystroke

    Body
    {
    "code": "Enter"
    }

    "The client is using an unsupported version of the Socket.IO or Engine.IO protocols"

    • 1 replies
    1. TinyPilot sends the keystrokes to the backend over websockets. It looks like you might be trying to just sent a standard REST request, so the backend can't understand it because it's expecting a websockets connection rather than an HTTP POST.

      I haven't used Postman, but it looks like they support websockets:

      https://learning.postman.com/docs/sending-requests/supported-api-frameworks/websocket/