Skip to content

AsRun

Overview

The AsRun API provides programmatic access to post-broadcast logs and reports.

It allows clients to: - retrieve filtered AsRun log entries - apply saved or custom filters - generate reports in JSON or CSV format (saved filter name + day) - manage saved AsRun filters (create, update, delete)

Base path

/api/logs/asrun

Get logs using a saved filter

POST /api/logs/asrun/:name/filter

Returns AsRun log entries for a specific day using a saved filter or a custom filter definition.

Request

Parameter Type Description
name String (path) Saved filter name or BROWSE
day String (query) Report date (YYYY-MM-DD)

If name is BROWSE, the filter definition must be provided in the request body.
If name is a saved filter, the system loads the filter automatically.

Request

1
2
3
4
5
6
7
8
{
    "from": "20:00",
    "to": "23:00",
    "action": "Take In",
    "show": "EveningNews",
    "profile": "Main",
    "channel": "Program"
}

Response

The response is an array of AsRun log entries.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[
    {
        "timestamp": "2024-02-28 21:05:39.53",
        "message": "Take In",
        "meta": {
            "show": "EveningNews",
            "profile": "Main",
            "channel": "Program"
        }
    }
]

Errors

1
2
3
4
{
    "status": "ERROR",
    "error": "Filter Not Found"
}

Get data for a saved filter

GET /api/logs/asrun/filter/:filter/data

Returns preprocessed or aggregated AsRun data for the specified saved filter.

Request

Parameter Type Description
filter String (path) Name of the saved filter

Response

The response contains computed or aggregated AsRun data.
The exact structure depends on the filter configuration.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
    "totalEntries": 128,
    "byAction": {
        "Take In": 64,
        "Take Out": 64
    },
    "byChannel": {
        "Program": 128
    },
    "byProfile": {
        "Main": 128
    }
}

Generate AsRun report (JSON / CSV)

Generates an AsRun report using a saved filter for a specific day.

Note

A saved filter name and a specific day must be provided. Reports can be generated only for one day at a time.

Request

Parameter Type Description
filter String (path) Name of the saved filter
day String Report date (YYYY-MM-DD)

The AsRun API supports generating reports in:

  • JSON format
  • CSV format

JSON response example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
[
 {
 "timestamp": "2024-02-28 21:05:39.53",
 "action": "Take In",
 "show": "EveningNews",
 "page": "Opening",
 "profile": "Main",
 "channel": "Program"
 },
 {
 "timestamp": "2024-02-28 21:10:12.11",
 "action": "Take Out",
 "show": "EveningNews",
 "page": "Opening",
 "profile": "Main",
 "channel": "Program"
 }
 ]

CSV report example

1
2
3
Time,Show,Page Name,Action,Profile,Channel
 21:05:39,EveningNews,Opening,Take In,Main,Program
 21:10:12,EveningNews,Opening,Take Out,Main,Program

Get all AsRun filters

GET /api/logs/asrun/filters

Returns all stored AsRun filters.

Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[
 {
 "name": "PrimeTime",
 "from": "20:00",
 "to": "23:00",
 "action": "Take In",
 "show": "EveningNews",
 "profile": "Main",
 "channel": "Program"
 }
 ]

Create an AsRun filter

POST /api/logs/asrun/filters

Creates a new AsRun filter.

Request

1
2
3
4
5
6
7
8
9
{
 "name": "PrimeTime",
 "from": "20:00",
 "to": "23:00",
 "action": "Take In",
 "show": "EveningNews",
 "profile": "Main",
 "channel": "Program"
 }

Update an AsRun filter

PUT /api/logs/asrun/filters/:name

Updates an existing AsRun filter.

Request

Parameter Type Description
name String Filter name

Request

1
2
3
4
5
6
7
8
{
 "name": "PrimeTime",
 "from": "19:30",
 "to": "23:00",
 "show": "EveningNews",
 "profile": "Main",
 "channel": "Program"
 }

Delete an AsRun filter

DELETE /api/logs/asrun/filters/:name

Deletes a saved AsRun filter.

Request

Parameter Type Description
name String (path) Filter name

Response If the filter exists, the removed filter is returned:

1
2
3
4
5
6
7
"name": "PrimeTime",
"from": "19:30",
"to": "23:00",
"show": "EveningNews",
"profile": "Main",
"channel": "Program"
}
If the filter does not exist, the response is:
null