The RhoSync REST API allows you to control, monitor, and debug a running RhoSync application using a simple HTTP API:
get_api_token
: Before you can use RhoSync API you should get an API token:require 'rest_client' require 'json' server = "http://localhost:9292" login = "rhoadmin" password = "" res = RestClient.post("#{server}/login", { :login => login, :password => password }.to_json, :content_type => :json) token = RestClient.post("#{server}/api/get_api_token",'',{ :cookies => res.cookies })
get_license_info
:Returns license information of the currently used license:license_info = RestClient.post( "#{server}/api/get_license_info", {:api_token => token}.to_json, :content_type => :json ).body
reset
: Reset the server: flush db and re-bootstrap server:RestClient.post("#{server}/api/reset", { :api_token => token }.to_json, :content_type => :json )
ping
: Sends a PUSH message to all the devices of the specified user:# :message - message which will...