Skip to content

API

Save data

Headers

Data sent in request can be stored as bytes, JSON or string (UTF-8 encoding).
Respective values for Content-Type header should be:

  • application/octet-stream for bytes
  • application/json for JSON
  • text/html; charset=utf-8 for UTF-8 string

In addition, APIfew-PublicKey header should also be provided with a value.

Endpoint

POST https://api.byte-nest.com/key/<CONTEXT>/<KEY> is the unique endpoint to save (and update) values.
should have same value as domain name in case of web-application, otherwise it can be any string.

Exemple

Send data as bytes
let req = axios({
    url: 'https://api.byte-nest.com/key/test.io/ABC',
    method: 'post',
    data: new Uint8Array([177, 55]),
    headers: {
        'APIfew-PublicKey': 'abcde1234567890',
        'Content-Type': 'application/octet-stream'
    }
})

Read data

Full record

GET https://api.byte-nest.com/key/<CONTEXT>/<KEY> returns a JSON response with a Result object.
Full record (ts_created, ts_updated, key, data) is available in Result.data

Value only

GET https://api.byte-nest.com/key/<CONTEXT>/<KEY>/value returns value only.

Exemple

$ curl https://api.byte-nest.com/key/test.io/ABC
$ curl https://api.byte-nest.com/key/test.io/ABC/value