5
API Remote
Lukas Metzger edited this page 2018-04-29 15:46:57 +02:00
Remote
Get client ip
GET /remote/ip
This call returns the ip of the client. This can e.g. be used for dynamic DNS Clients.
Response
code | result |
---|---|
200 | Everything okay |
{
"ip": "1.2.3.4"
}
Update record with password
GET /remote/updatepw?record=10&content=foo-bar-baz&password=supersecret
parameter | explanation |
---|---|
record | The id of the record to update |
content | The new content |
password | The password used for authentication |
Response
code | result |
---|---|
204 | Everything okay, therefore content is empty |
403 | No permission for the given record |
404 | Record does not exist |
422 | One of the required arguments is missing |
Get server time
GET /remote/servertime
This call returns the time of the server. This can be used to obtain a timestamp for the signature api.
Response
code | result |
---|---|
200 | Everything okay |
{
"time": 1525006738
}
Update with key
POST /remote/updatekey
This API does the authentication via an RSA signature. To obtain the signature you must have a Unix-Timestamp with sufficient precision. You can obtain it from the server with the GET /remote/servertime
API. Concatenate the record id (as string), the content and the timestamp (also as string). Sign this data with SHA512 using your private key and base64 encode the signature.
Request
{
"record": 5,
"content": "1.2.3.4",
"time": 1525009108,
"signature": "YIRJppYL55dOuC[...]u0sXYgClo="
}
parameter | explanation |
---|---|
record | The id of the record to update |
content | The new content |
time | The unix timestamp used in the signature |
signature | The signature |
Response
code | result |
---|---|
204 | Everything okay, therefore content is empty |
403 | No permission for the given record |
404 | Record does not exist |
422 | One of the required arguments is missing |