Posted on Fri, 15 Jun 2018


Introducing API calls


Automate your tasks with API calls

Good news everyone! As of today sshreach.me supports API calls. You can now open and close tunnels without visiting the website and clicking on/off button but by simply issuing an API call using your any scripting language. For instance, you can open a tunnel using bash script with the command like:

#!/bin/bash
result=$(curl 'https://sshreach.me/init/api/connect?dbid=Bad9alsdS920a11-Aqj2&host_uuid=20sldd20-20sz-aa20-aa02-aa0salskd82a&ports_id=1234&user_id=12345' | jq -r '.success')

or if you prefer python it would look something like:

api_endpoint = 'https://sshreach.me/init/api/{0}?dbid=Bad9alsdS920a11-Aqj2&host_uuid=20sldd20-20sz-aa20-aa02-aa0salskd82a&ports_id=1234&user_id=12345'
# open the tunnel
json_result = json.loads(urllib2.urlopen(api_endpoint.format('connect')).read())

This can help in automating your administrative tasks and in maintaining your servers. For detailed documentation check here.



Leave a Comment:

Your Name:
Comment: