Basics
This section shows some examples how to use the API programmatically.
The examples are written in Python or they are written as shell snippets using curl.
Authentication
The RPCs can be divided into two groups based on their authentication requirements:
public
and private
.
Public RPCs
Some RPCs do not require authentication and anyone can call them:
curl \
--output - \
--request POST \
--header "content-type: application/json" \
--data '{ "method":"device_info_get_public" }' \
https://ripex2a.racom.eu/cgi-bin/rpc.cgi
Private RPCs
Most RPCs require authentication. For those that do a custom HTTP header
apikey
must be set to the value of the token
attribute in the login.cgi
response. See the Login section for more details.
Once we have the apikey
we use it in the apikey
HTTP header:
curl \
--output - \
--request POST \
--header "content-type: application/json" \
--header "apikey: <auth_token_string>" \
--data '{"method":"time_set","params":{"tstamp":1617692029}}' \
https://ripex2a.racom.eu/cgi-bin/rpc.cgi
Advanced Usage
Some advanced use cases include: