Documentation

Api Calls for dedicated server users

Clients who use "dedicated server" plans have two additional api calls at their disposal.

  1. create_new_client
  2. get_client_script

The purpose of these functions is to create new client and download its script via API. They can be used in IoT devices, for instance after the first boot in the factory the device can call the create_new_client and create its client and then download the script and install it on the device. This way the sshreach.me client will be automatically installed and ready and the device can be accessed if necessary.

You can get the api calls templates and the api key on your key management page

create_new_client

parameters:

  • api_key - your api key
  • region - region where you want your client to connect to. You can find your regions in your forwarding servers page
  • type - [serial|random] - (default: serial) serial creates a 6-digit numbered client name starting from 000001 with prefix if submitted, random creates a 20-character random string client name
  • prefix - (default: none) prefix for serial type of client names. With this parameter you can have multiple classes of serial numbers and you can distinguish your IoT devices
  • name - in case you have a predefined names for your clients you can send the name of the client
  • fwport - (default: 22) - port to forward

On success create_new_client returns the following json

{"message": "OK", "error_code": 0, "success": true, "client_name":"cli000123", client_id: "dfb39cdd-9140-4d74-9e26-a2f00bc3bad2"}

You can then use the client_id to get the client script for the newly created client

error codes

    00 - ok
    21 - invalid API call
    23 - Client blocked
    24 - Client inactive
    31 - Wrong data
    32 - Invalid API key or API key missing
    40 - Can not access forwarding server
    41 - Invalid region key
    45 - Internal error

get_client_script

This function returns the client script for the client whose ID is sent in the client_id parameter.

parameters:

  • api_key - your api key
  • client_id - client_id of the client whose script we want to download