Clients who use dedicated server plans have two additional api calls at their disposal.
The purpose of these functions is to create a new client and to 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 access the api calls templates and the api key on your key management page
create_new_client
api_key
- your api keyregion
- region to which you want your client to connect to. You can find your regions on your forwarding servers pagetype
- [serial
|random
] - (default: serial) serial creates a 6-digit numbered client name starting from 000001 with prefix (if submitted), while random creates a 20-character random string client nameprefix
- (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 devicesname
- in case you have a predefined names for your clients, you can send the name of the clientfwport
- (default: 22) - port to forwardOn 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 - Cannot 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.
api_key
- your api keyclient_id
- client_id of the client whose script we want to download