Anthias API v2.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

assets

List assets

Code samples

# You can also use wget
curl -X GET /api/v2/assets \
  -H 'Accept: application/json'

GET /api/v2/assets HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/assets',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/api/v2/assets',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/api/v2/assets', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/v2/assets', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api/v2/assets", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/v2/assets

Example responses

200 Response

[
  {
    "asset_id": "string",
    "name": "string",
    "uri": "string",
    "start_date": "2019-08-24T14:15:22Z",
    "end_date": "2019-08-24T14:15:22Z",
    "duration": 0,
    "mimetype": "string",
    "is_enabled": true,
    "nocache": true,
    "play_order": 0,
    "skip_asset_check": true,
    "is_active": "string",
    "is_processing": true
  }
]

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [AssetSerializerV2] false none none
» asset_id string true read-only none
» name string¦null false none none
» uri string¦null false none none
» start_date string(date-time)¦null false none none
» end_date string(date-time)¦null false none none
» duration integer¦null false none none
» mimetype string¦null false none none
» is_enabled boolean false none none
» nocache boolean false none none
» play_order integer false none none
» skip_asset_check boolean false none none
» is_active string true read-only none
» is_processing boolean false none none

Create asset

Code samples

# You can also use wget
curl -X POST /api/v2/assets \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/v2/assets HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "ext": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/v2/assets',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post '/api/v2/assets',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/api/v2/assets', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/assets', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/assets", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/assets

Body parameter

{
  "ext": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}
ext: string
name: string
uri: string
start_date: 2019-08-24T14:15:22Z
end_date: 2019-08-24T14:15:22Z
duration: 0
mimetype: string
is_enabled: true
is_processing: true
nocache: true
play_order: 0
skip_asset_check: true

Parameters

Name In Type Required Description
body body CreateAssetSerializerV2 true none

Example responses

201 Response

{
  "asset_id": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true,
  "is_active": "string",
  "is_processing": true
}

Responses

Status Meaning Description Schema
201 Created none AssetSerializerV2

Get asset

Code samples

# You can also use wget
curl -X GET /api/v2/assets/{asset_id} \
  -H 'Accept: application/json'

GET /api/v2/assets/{asset_id} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/assets/{asset_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/api/v2/assets/{asset_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/api/v2/assets/{asset_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/v2/assets/{asset_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/{asset_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api/v2/assets/{asset_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/v2/assets/{asset_id}

Parameters

Name In Type Required Description
asset_id path string true none

Example responses

200 Response

{
  "asset_id": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true,
  "is_active": "string",
  "is_processing": true
}

Responses

Status Meaning Description Schema
200 OK none AssetSerializerV2

Update asset

Code samples

# You can also use wget
curl -X PATCH /api/v2/assets/{asset_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PATCH /api/v2/assets/{asset_id} HTTP/1.1

Content-Type: application/json
Accept: application/json

const inputBody = '{
  "name": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/v2/assets/{asset_id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch '/api/v2/assets/{asset_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('/api/v2/assets/{asset_id}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/api/v2/assets/{asset_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/{asset_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/api/v2/assets/{asset_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /api/v2/assets/{asset_id}

Body parameter

{
  "name": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}
name: string
start_date: 2019-08-24T14:15:22Z
end_date: 2019-08-24T14:15:22Z
duration: 0
is_enabled: true
is_processing: true
nocache: true
play_order: 0
skip_asset_check: true

Parameters

Name In Type Required Description
asset_id path string true none
body body PatchedUpdateAssetSerializerV2 false none

Example responses

200 Response

{
  "asset_id": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true,
  "is_active": "string",
  "is_processing": true
}

Responses

Status Meaning Description Schema
200 OK none AssetSerializerV2

Delete asset

Code samples

# You can also use wget
curl -X DELETE /api/v2/assets/{asset_id}

DELETE /api/v2/assets/{asset_id} HTTP/1.1


fetch('/api/v2/assets/{asset_id}',
{
  method: 'DELETE'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

result = RestClient.delete '/api/v2/assets/{asset_id}',
  params: {
  }

p JSON.parse(result)

import requests

r = requests.delete('/api/v2/assets/{asset_id}')

print(r.json())

<?php

require 'vendor/autoload.php';

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/api/v2/assets/{asset_id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/{asset_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/api/v2/assets/{asset_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /api/v2/assets/{asset_id}

Parameters

Name In Type Required Description
asset_id path string true none

Responses

Status Meaning Description Schema
204 No Content No response body None

Get asset content

Code samples

# You can also use wget
curl -X GET /api/v2/assets/{asset_id}/content \
  -H 'Accept: application/json'

GET /api/v2/assets/{asset_id}/content HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/assets/{asset_id}/content',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/api/v2/assets/{asset_id}/content',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/api/v2/assets/{asset_id}/content', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/v2/assets/{asset_id}/content', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/{asset_id}/content");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api/v2/assets/{asset_id}/content", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/v2/assets/{asset_id}/content

The content of the asset. type can either be file or url.

In case of a file, the fields mimetype, filename, and content will be present. In case of a URL, the field url will be present.

Parameters

Name In Type Required Description
asset_id path string true none

Example responses

200 Response

{
  "type": "string",
  "url": "string",
  "filename": "string",
  "mimetype": "string",
  "content": "string"
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» type string false none none
» url string false none none
» filename string false none none
» mimetype string false none none
» content string false none none

Control asset playback

Code samples

# You can also use wget
curl -X GET /api/v2/assets/control/{command} \
  -H 'Accept: application/json'

GET /api/v2/assets/control/{command} HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/assets/control/{command}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/api/v2/assets/control/{command}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/api/v2/assets/control/{command}', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/api/v2/assets/control/{command}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/control/{command}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api/v2/assets/control/{command}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /api/v2/assets/control/{command}

Use any of the following commands to control asset playback: * next - Show the next asset * previous - Show the previous asset * asset&{asset_id} - Show the asset with the specified asset_id

Parameters

Name In Type Required Description
command path string true none

Enumerated Values

Parameter Value
command asset&{asset_id}
command next
command previous

Example responses

200 Response

"Asset switched"

Responses

Status Meaning Description Schema
200 OK none string

Update playlist order

Code samples

# You can also use wget
curl -X POST /api/v2/assets/order \
  -H 'Content-Type: application/x-www-form-urlencoded'

POST /api/v2/assets/order HTTP/1.1

Content-Type: application/x-www-form-urlencoded

const inputBody = '{
  "ids": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded'
};

fetch('/api/v2/assets/order',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/x-www-form-urlencoded'
}

result = RestClient.post '/api/v2/assets/order',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

r = requests.post('/api/v2/assets/order', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/x-www-form-urlencoded',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/assets/order', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/assets/order");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/x-www-form-urlencoded"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/assets/order", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/assets/order

Body parameter

ids: string

Parameters

Name In Type Required Description
body body object false none
» ids body string false Comma-separated list of asset IDs in the order

Detailed descriptions

» ids: Comma-separated list of asset IDs in the order they should be played. For example:

793406aa1fd34b85aa82614004c0e63a,1c5cfa719d1f4a9abae16c983a18903b,9c41068f3b7e452baf4dc3f9b7906595

Responses

Status Meaning Description Schema
200 OK No response body None

backup

Create backup

Code samples

# You can also use wget
curl -X POST /api/v2/backup \
  -H 'Accept: application/json'

POST /api/v2/backup HTTP/1.1

Accept: application/json


const headers = {
  'Accept':'application/json'
};

fetch('/api/v2/backup',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.post '/api/v2/backup',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.post('/api/v2/backup', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/backup', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/backup");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/backup", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/backup

Create a backup of the current Anthias instance, which includes the following: * current settings * image and video assets * asset metadata (e.g. name, duration, play order, status), which is stored in a SQLite database

Example responses

201 Response

"anthias-backup-2021-09-16T15-00-00.tar.gz"

Responses

Status Meaning Description Schema
201 Created none string

file_asset

Upload file asset

Code samples

# You can also use wget
curl -X POST /api/v2/file_asset \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json'

POST /api/v2/file_asset HTTP/1.1

Content-Type: multipart/form-data
Accept: application/json

const inputBody = '{
  "file_upload": "string"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json'
};

fetch('/api/v2/file_asset',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json'
}

result = RestClient.post '/api/v2/file_asset',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

r = requests.post('/api/v2/file_asset', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'multipart/form-data',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/file_asset', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/file_asset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/file_asset", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/file_asset

Body parameter

file_upload: string

Parameters

Name In Type Required Description
body body object false none
» file_upload body string(binary) false none

Example responses

200 Response

{
  "uri": "string",
  "ext": "string"
}

Responses

Status Meaning Description Schema
200 OK none Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» uri string false none none
» ext string false none none

reboot

Reboot system

Code samples

# You can also use wget
curl -X POST /api/v2/reboot

POST /api/v2/reboot HTTP/1.1


fetch('/api/v2/reboot',
{
  method: 'POST'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

result = RestClient.post '/api/v2/reboot',
  params: {
  }

p JSON.parse(result)

import requests

r = requests.post('/api/v2/reboot')

print(r.json())

<?php

require 'vendor/autoload.php';

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/reboot', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/reboot");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/reboot", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/reboot

Responses

Status Meaning Description Schema
200 OK No response body None

recover

Recover from backup

Code samples

# You can also use wget
curl -X POST /api/v2/recover \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json'

POST /api/v2/recover HTTP/1.1

Content-Type: multipart/form-data
Accept: application/json

const inputBody = '{
  "backup_upload": "string"
}';
const headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json'
};

fetch('/api/v2/recover',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'multipart/form-data',
  'Accept' => 'application/json'
}

result = RestClient.post '/api/v2/recover',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

r = requests.post('/api/v2/recover', headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'multipart/form-data',
    'Accept' => 'application/json',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/recover', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/recover");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/recover", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/recover

Recover data from a backup file. The backup file must be a .tar.gz file.

Body parameter

backup_upload: string

Parameters

Name In Type Required Description
body body object false none
» backup_upload body string(binary) false none

Example responses

200 Response

"Recovery successful."

Responses

Status Meaning Description Schema
200 OK none string

shutdown

Shut down system

Code samples

# You can also use wget
curl -X POST /api/v2/shutdown

POST /api/v2/shutdown HTTP/1.1


fetch('/api/v2/shutdown',
{
  method: 'POST'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

result = RestClient.post '/api/v2/shutdown',
  params: {
  }

p JSON.parse(result)

import requests

r = requests.post('/api/v2/shutdown')

print(r.json())

<?php

require 'vendor/autoload.php';

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/api/v2/shutdown', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("/api/v2/shutdown");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api/v2/shutdown", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /api/v2/shutdown

Responses

Status Meaning Description Schema
200 OK No response body None

Schemas

AssetSerializerV2

{
  "asset_id": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true,
  "is_active": "string",
  "is_processing": true
}

Properties

Name Type Required Restrictions Description
asset_id string true read-only none
name string¦null false none none
uri string¦null false none none
start_date string(date-time)¦null false none none
end_date string(date-time)¦null false none none
duration integer¦null false none none
mimetype string¦null false none none
is_enabled boolean false none none
nocache boolean false none none
play_order integer false none none
skip_asset_check boolean false none none
is_active string true read-only none
is_processing boolean false none none

CreateAssetSerializerV2

{
  "asset_id": "string",
  "ext": "string",
  "name": "string",
  "uri": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "mimetype": "string",
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}

Properties

Name Type Required Restrictions Description
asset_id string true read-only none
ext string false write-only none
name string true none none
uri string true none none
start_date string(date-time) true none none
end_date string(date-time) true none none
duration integer true none none
mimetype string true none none
is_enabled boolean true none none
is_processing boolean false none none
nocache boolean false none none
play_order integer false none none
skip_asset_check boolean false none none

PatchedUpdateAssetSerializerV2

{
  "name": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}

Properties

Name Type Required Restrictions Description
name string false none none
start_date string(date-time) false none none
end_date string(date-time) false none none
duration integer false none none
is_enabled boolean false none none
is_processing boolean false none none
nocache boolean false none none
play_order integer false none none
skip_asset_check boolean false none none

UpdateAssetSerializerV2

{
  "name": "string",
  "start_date": "2019-08-24T14:15:22Z",
  "end_date": "2019-08-24T14:15:22Z",
  "duration": 0,
  "is_enabled": true,
  "is_processing": true,
  "nocache": true,
  "play_order": 0,
  "skip_asset_check": true
}

Properties

Name Type Required Restrictions Description
name string true none none
start_date string(date-time) true none none
end_date string(date-time) true none none
duration integer true none none
is_enabled boolean true none none
is_processing boolean false none none
nocache boolean false none none
play_order integer false none none
skip_asset_check boolean false none none