AVP Contribution API
AVP Contribution API
NBI
FM CM CM CM CM
Parameter Store
Device XML
Config Manager
Map
Option card
Rev PC3
AVP Contribution API
Abstract
The AVP Contribution API is designed to be used by third-party control
systems. The goals are:
2
AVP Contribution API
Contents
1 Terminology ................................................................................ 4
2 Requirements .............................................................................. 5
2.1 Hardware requirements................................................................. 5
2.2 Common API requirements ........................................................... 6
2.3 Configuration at base .................................................................... 7
2.4 Configuration in the field ............................................................... 8
3 General concepts ........................................................................ 8
3.1 Base URL ..................................................................................... 9
3.2 Methods supported ....................................................................... 9
3.3 HTTP status codes ..................................................................... 10
3.4 Timeout....................................................................................... 11
3.5 HTTP request headers ................................................................ 11
3.6 HTTP response headers ............................................................. 12
3.7 HTTP Authentication ................................................................... 12
4 Carrier ID configuration ............................................................ 13
4.1 Reading the Carrier ID ................................................................ 13
4.2 Setting the Carrier ID .................................................................. 13
4.3 CarrierID object ........................................................................... 14
5 System operation ...................................................................... 15
5.1 Setting the system operations ..................................................... 15
6 Device Status ............................................................................ 16
6.1 Reading the Device Status.......................................................... 16
7 Services ..................................................................................... 17
7.1 List all services ........................................................................... 17
7.2 Service update ............................................................................ 18
7.3 Service object ............................................................................. 20
8 Pre-stored configurations ........................................................ 34
8.1 List all the pre-sets ...................................................................... 35
8.2 Read a single pre-set .................................................................. 35
8.3 Saving the current parameters in a pre-set ................................. 36
8.4 Re-calling a pre-set ..................................................................... 36
8.5 Clear a pre-set ............................................................................ 37
8.6 Pre-set Object ............................................................................. 37
9 Alarms ....................................................................................... 37
9.1 List all the alarms ........................................................................ 37
9.2 Alarm object ................................................................................ 38
10 Error messages ......................................................................... 38
11 References ................................................................................ 41
12 Change information .................................................................. 41
3
AVP Contribution API
1 Terminology
ACM Adaptive Coding and Modulation
HD High Definition
RF Radio Frequency
SD Standard Definition
4
AVP Contribution API
2 Requirements
External sync card shall be present in the chassis in order to use External
clock-mode in the Modulation object.
SatMod (optional) 1 6
5
AVP Contribution API
SatMod (optional) 1 2
The API shall provide a configuration counter, incrementing every time a new
configuration has been successfully applied. This is to allow a third-party
control system to detect changes made through the Web User Interface or
other interfaces into the configuration of the device.
Access to this API shall be activated by a license. MediaKind uses this to track
API usage. Once activating this API by license, use of the web interface and
existing control interfaces are allowed but with the following limitations:
• The two first services will be controlled by this API, as well as editable
through the user interface and the front panel.
When the API is disabled, either by using the global On/Off switch or by not
applying the license, the device shall return 404 Not Found on all URLs
specified in the document.
If the API license is not present on the device, the device shall return:
HTTP/1.1 404 Not Found
Content-Length: nnn
Content-Type: application/json
If the API is disabled via the global On/Off switch, the device shall return:
HTTP/1.1 403 Forbidden
Content-Length: nnn
Content-Type: application/json
6
AVP Contribution API
{
"error" : {
"status" : "403 Forbidden",
"title" : "Third-party API is disabled. Enable it through
the user interface."
}
The API shall provide the developer the ability to create encoding services,
without having to specify on which physical resource each phase of the
encoding process (e.g. SDI de-embedding, Encoding, MUX, Satellite
Modulation) will be achieved.
The API shall be the only point of contact for configuration. This API is
dedicated to third-party control system and does not provide the same
features as the web user interface or the front panel, if available.
The Contribution device shall support every item exposed in the API.
The API shall use clean URLs. E.g: Error! Hyperlink reference not valid.
The body of the HTTP requests and responses uses JSON, which is an easy
interchange format and faster to parse than XML. JSON is completely
independent of the programming language. In many cases, JSON is smaller
than XML.
The current version of this API should be backwards compatible with previous
releases. Commands implemented now should continue to work in future
releases of this API.
The API shall provide the ability to store configurations on the device.
7
AVP Contribution API
o Set RF parameters:
o Modulation = ON
o Set output = ON
o Set output = ON
The traffic generated by the API shall allow control over slow links (e.g.
56Kbit/s dial-up connections).
3 General concepts
This API is based on the Hypertext Transfer Protocol, as defined in [1]. The
bodies of HTTP request and responses are encoded in JSON, as defined in
[2], and carried in the HTTP body as defined in [3].
Note: The HTTP Host header and the \r\n at the end of each line (as defined in
[1]) are omitted from the examples, but shall still be inserted accordingly:
GET /API/Contribution/CarrierID HTTP/1.1\r\n
8
AVP Contribution API
Host: 10.0.0.1\r\n
Accept: application/json\r\n
\r\n
A Collection URI contains several items. Each item can be another Collection
or an Object. Items in a Collection are addressed by index number.
GET Retrieve data from the device. List all the Items and Retrieve a
This method is ’safe’ in the sense Collections contained representation of the
that it does not modify the device in the URI. object at the URI.
configuration.
PUT Update the addressed data with Update items in order Update the object by
provided representation. This is of appearance in the replacing the values
method is ‘idempotent’, as multiple array. Each object is of properties with
identical requests shall have the updated as if it were values in the object
same effect that a single request PUT as an object. supplied. Omitted
properties will be left
in their previous state.
POST Not allowed. The device shall Not allowed. The Not allowed. The
respond 405 Method Not device shall respond device shall respond
Allowed, with the Allow header 405 Method Not 405 Method Not
set to GET, PUT Allowed, with the Allowed, with the
Allow header set to Allow header set to
GET, PUT GET, PUT
DELETE Not allowed. The device shall Not allowed. The Not allowed. The
respond 405 Method Not device shall respond device shall respond
Allowed, with the Allow header 405 Method Not 405 Method Not
set to GET, PUT Allowed, with the Allowed, with the
Allow header set to Allow header set to
GET, PUT GET, PUT.
9
AVP Contribution API
http://<hostname>/API/Contribution/Services/
http://<hostname>/API/Contribution/Presets/
http://<hostname>/API/Contribution/Alarms/
Requests to Object URIs shall provide JSON objects. Note: JSON Objects are
naturally un-ordered.
The service-index is the index number of the service within the Services
collection.
The preset-index is the index number of the pre-set within the Pre-sets
collection.
[
{},
{},
{"bitrate": 192}
]
The use of empty objects means that audio components 1 and 2 will not be
updated, only the third component will be updated.
10
AVP Contribution API
3.4 Timeout
The default HTTP timeout is 15 seconds. Some messages may require an
adjusted timeout, which will be specified in this documentation.
Where a HTTP request body is provided, the Content-Type field shall be set
to application/json.
3.5.1 X-API-Key
The device may accept the X-API-Key HTTP header in every API call made.
The device shall allow API access for every call made with the special API
key.
If the X-API-Key is not present in the request or invalid and the API license is
on the device, the device shall allow API requests.
If the X-API-Key is not present in the request or invalid and the API license is
not on the device, the device shall not allow API requests and shall return the
following error:
HTTP/1.1 404 Not Found
Content-Length: nnn
11
AVP Contribution API
Content-Type: application/json
The api_key parameter is the user's secret API key that can be retrieved from
the API Key Database. The url parameter is the path of the URL being
requested (minus any parameters, host name, IP address, and http://), e.g.
http://<server>/API/Services/1 would be simply /API/Services/1. The '+'
indicates string concatenation without any delimiters.
Example:
md5(“12345” + md5(“/API/Contribution/CarrierID” +
“12345”)
md5(“12345” + “bac1e7b7404eb51559d37b0dc6caa196”)
3bb206cf18b469b5e4ddb7c05ececbd4
When creating resources, the Location field shall be set to the URI of newly
created resources.
Or:
HTTP/1.1 403 Forbidden
12
AVP Contribution API
Content-Length: nnn
Accessing the API will require disabling Web Authentication on the device.
4 Carrier ID configuration
The carrier ID uniquely identifies the transmitting station. The inclusion of this
information in the transport stream is activated through the user interface for
each service.
4.1.1 Request
To read the current Carrier ID, the HTTP client shall send the following
request:
GET /API/Contribution/CarrierID HTTP/1.1
Accept: application/json
4.1.2 Response
{
"operator": "DSNG1",
"phone": "+44 2380 48 4000",
"user-info": "User defined string",
"longitude": 50.916203,
"latitude": -1.3222
}
4.2.1 Request
To update the Carrier ID, the HTTP client shall send to the server:
PUT /API/Contribution/CarrierID HTTP/1.1
Accept: application/json
Content-Type: application/json
Content-Length: nnn
13
AVP Contribution API
"operator": "Operator",
"phone": "+44 2380 48 4000",
"user-info": "Another user defined string",
"longitude": 50.916203,
"latitude": -1.3222
}
4.2.2 Response
When the request is successful, the device shall return the following HTTP
response:
HTTP/1.1 200 OK
Content-Length: 0
Up to five characters
14
AVP Contribution API
5 System operation
5.1.1 Request
To update the system parameters, the HTTP client shall send to the server:
PUT /API/Contribution/System HTTP/1.1
Accept: application/json
Content-Type: application/json
Content-Length: nnn
{
"reboot": true,
"name": "System name",
"default-view": "simple"
}
5.1.3 Response
NOTE that for a reboot command, the unit may reset before sending the
response, so no reply may be received.
When the request is successful, the device shall return the following HTTP
response:
15
AVP Contribution API
HTTP/1.1 200 OK
Content-Length: 0
When the request is malformed, the device shall return the following HTTP
response:
HTTP/1.1 400 Bad Request
Content-Length: nnn
6 Device Status
6.1.1 Request
To read the current Device status, the HTTP client shall send the following
request:
GET /API/Contribution/Status HTTP/1.1
Accept: application/json
6.1.2 Response
{
"config-count": 154,
"highest-alarm-severity": "normal",
"last-preset-restored": "Preset 1",
"alarm-count": 3
}
Where:
16
AVP Contribution API
The highest alarm severity level shall be calculated as the maximum level of
all active alarms. The level of an alarm is defined according to:
normal or information 1
indeterminate 2
warning 3
minor 4
major 5
critical 6
7 Services
This API provides access to a maximum of two services per device.
The device shall respond with a JSON array of all the service Objects. For
example:
HTTP/1.1 200 OK
Content-Length: nnn
Content-Type: application/json
[
{
"name" : "My Service 1",
...
},
{
"name" : "My Service 2",
17
AVP Contribution API
...
}
]
The Service object is abbreviated in the example. The full service Object is
defined in 7.3.
Note: The index of a JSON array starts at zero. Services 1 and 2 are
accessed in the JSON array as index 0 and 1. The Service Object URI uses
the same index.
{
"name": "My Service 1",
"transport-stream-id": 3001,
"original-network-id": 3002,
"service-id": 3003,
"input": [
{
"type": "SDI" ,
"format": "HD 1080i25"
}
],
"video": [
{
"PID" : 101,
"aspect-ratio" : "16/9",
"encoding" : "H264",
"profile" : "4:2:0",
"BISS" : "Off",
18
AVP Contribution API
"BISS-key" : "************”
"bitrate-tracking" : "Off",
"manual-bitrate" : "7.5",
"GOP-structure" : "Auto",
"GOP-length" : "Auto",
"buffer-mode" : "CBR"
}
],
"audio" : [
{
"PID" : 102,
"encoding" : "MPEG Layer II",
"channel-mode" : "2/0",
"bitrate" : "128"
},
{
"PID" : 103,
"encoding" : "HE-AAC",
"channel-mode" : "2/0",
"bitrate" : "128"
}
],
"data": [
{
"type" : "VANC",
"PID" : 104,
"mode" : "On",
"max-bitrate" : 1500
}
]
"output": [
{
"type" : "modulator",
"relation" : "main",
"output-select" : "LBand",
"carrier-mode" : "Off",
"standard" : "DVB-S2",
"modulation" : "QPSK",
"uplink-frequency" : 12079,
"symbol-rate" : 4,
"FEC" : "3/4",
"low-power" : -20,
"nominal-power" : 5,
"clock-mode" : "Internal",
"roll-off" : 20,
"frame-size" : "Normal",
"RAS" : "On",
"RAS-key" : "",
"BISS" : "On",
"pilots" : "Off",
},
{
"type" : "IP",
"relation" : "mirror",
"destination-address" : "239.0.0.1",
"destination-port" : 5500,
"gateway" : "0.0.0.0",
"source-address" : "0.0.0.0",
"source-port" : 5000,
19
AVP Contribution API
"subnet" : "255.255.0.0",
"FEC-row" : 4,
"FEC-col" : 1,
"mode" : "On",
"BISS" : "On"
},
{
"type" : "ASI",
"relation" : "mirror"
"mode" : "On",
"ASI-bitrate" : 8.5,
"BISS" : "On"
}
]
}
Note: Editing properties within a service will adjust those properties for mirror
outputs, but may not have an effect on independent outputs.
20
AVP Contribution API
Type ‘SDI’, ’Analog’, ‘Color bars’, ‘Black’, ‘Moving object’, ‘Slate’ string
Default: ‘SDI’
Format ‘SD 576i25’, ‘SD 480i29.97’, ‘HD 720p50’, ‘HD 720p59.94’, string
‘HD 1080i25’, ‘HD 1080i29.97’, ‘3G 1080p50’, ‘3G
1080p59.94’, ‘UHD 2160p50’, ‘UHD 2160p59.94, ‘Auto’
Note that the output video resolution shall be the same as the input video
resolution.
Default: ‘16/9’
Default: ‘4:2:0’
21
AVP Contribution API
Default ‘SD’
Default: ‘H264’
Default: ‘Off’
22
AVP Contribution API
Default ‘On’
Default: Off
Default: ‘IBBBP’
Sets the number of B frames between reference frames.
IBBBBBBBP can only be used for 720p video format
encoded with a H.264 video profile.
Default: 32
buffer-mode ‘CBR’, ‘Low Delay’, ‘Mega Low Delay’, ‘Stripe Refresh’, string
‘Stripe Refresh (+Audio Encode)’
Default: ‘CBR’
bit-depth 0, 8, 10 number
Default: 8
Note that some of the above are really service-level parameters, however
since there is assumed to always be a single video component, they are
placed within that video object.
Note that if any of bit-depth, profile, or encoding are set to the ‘Off’ value (or
equivalent), all three properties must be set to the ‘Off’ value (or equivalent)
when sending updated values to the device, or the values will be rejected.
23
AVP Contribution API
24
AVP Contribution API
1080i25’, ‘HD
1080i29.97’
‘HD 720p50’, ‘HD
720p59.94’, ‘HD HEVC 4:2:2 10
1080i25’, ‘HD
1080i29.97’
‘3G 1080p50’, ‘3G
1080p59.94 H264 4:2:0 8
‘3G 1080p50’, ‘3G
1080p59.94 H264 4:2:2 8
‘3G 1080p50’, ‘3G
1080p59.94 H264 4:2:2 10
‘3G 1080p50’, ‘3G
1080p59.94 HEVC 4:2:0 8
‘3G 1080p50’, ‘3G
1080p59.94 HEVC 4:2:2 8
‘3G 1080p50’, ‘3G
1080p59.94 HEVC 4:2:2 10
‘UHD 2160p50’,
‘UHD 2160p59.94’ HEVC 4:2:0 10
‘UHD 2160p50’,
‘UHD 2160p59.94’ HEVC 4:2:2 10
The audio array contains up to eight audio objects. If there are zero audio
components created in the service, the audio array will not be present (the
property itself will not be present).
Default: ‘Off’
25
AVP Contribution API
Default: ‘2/0’
Default: 128
Unit: bits
26
AVP Contribution API
Default: ’20-bit’
Unit: ms
Default: 0
Default ‘Off’‘
The ANC object will appear in the data array. Note that this object will relate
to the VBI Output component and it is assumed the component is configured
to provide ANC output.
Default ‘Off’
27
AVP Contribution API
The following properties will be present in each object in the output array:
Default: ‘Off’
The “relation” property will denote what relation the output has to the other
outputs:
• “main” denotes the primary output. This is the output that the services
(and therefore the components) have been fetched from
If there are multiple outputs defined, the main output is found by searching for
mux (i.e. standard rather than mirror or pass-through) transport streams on the
following outputs, in order:
28
AVP Contribution API
Generally speaking, a mirror that is higher up the above list than its main is not
a supported output and may not appear in the output list.
Satellite Modulator
IP
ASI
• For all outputs, the property operates to/from the nth service in the
transport stream, where n is the index of service object in the services
array.
Default: ‘Off’
See Table 1 Carrier modes for other values.
Default: ‘DVB-S2’
29
AVP Contribution API
32APSK 16APSK
16APSK-L
32APSK
32APSK-L
64APSK
64APSK-L
FEC 1/41,4, 1/31,4, 2/51,4, 1/2, 3/51,4, 2/3, 3/4, 4/51,4, 5/6, 7/82,3, string
8/91,4, 9/101,4,
30
AVP Contribution API
Default: ‘Internal’
Default: 20
Default: ‘Normal’
1 Applies to DVB-S2
2 Applies to DVB-DSNG
3 Applies to DVB-S
4 Applies to DVB-S2X
‘Modulated’ nominal-power On
31
AVP Contribution API
DVB-S2 QPSK Normal 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 9/10
Short 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9
DVB-S2X QPSK Normal 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 9/10,
13/14, 9/20, 11/20
Short 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9
8PSK, Normal 3/5, 2/3, 3/4, 5/6, 8/9, 9/10, 23/36, 25/36, 13/18
16APSK Normal 2/3, 3/4, 4/5, 5/6, 8/9, 9/10, 26/45, 3/5, 28/45, 23/36,
25/36, 13/18, 7/9, 77/90
32APSK Normal 3/4, 4/5, 5/6, 8/9, 9/10, 32/45, 11/15, 7/9
32
AVP Contribution API
The ‘output’ array contains a single ASI object, if an ASI card is present and a
transport stream has been created on it.
7.3.6.4 IP object
gateway The gateway address to use. Leave at 0.0.0.0 to use the string
default gateway. Default is 0.0.0.0.
33
AVP Contribution API
The BISS key for each service is unique. Setting the BISS key for each
service will set the following BISS keys in the device’s BISS key store:
• “mirror” –Attempts to set this to a value different from the BISS value
for the main output will produce a 400 error.
8 Pre-stored configurations
In addition to the current running configuration, Contribution devices offer up
to 64 pre-set slots.
34
AVP Contribution API
The current configuration can be saved in a pre-set slot. This will replace to
existing content of the pre-set with the current running configuration.
The server shall return the Collection of all 64 pre-set Objects. For example:
HTTP/1.1 200 OK
Content-Length: nnn
Content-Type: application/json
[
{
"name" : "My Preset 1",
"description" : "Describes the content of preset 1",
"timestamp" : 1627893
},
...
{
"name" : "My Preset 64",
"description" : "Describes the content of preset 64",
"timestamp" : 24892123
}
]
Note: The index of a JSON array starts at zero. Pre-sets 1 to 64 are accessed
in the JSON array as index 0 to 63. The same index is used later in the Pre-
set Object URI.
The server shall return the Collection of all 64 pre-set Objects. For example:
HTTP/1.1 200 OK
Content-Length: nnn
Content-Type: application/json
35
AVP Contribution API
{
"name" : "My Preset 1",
"description" : "Describes the content of preset 1",
"timestamp" : 1627893
}
{
"name" : "My Preset 1",
"description" : "Describes the content of preset 1"
}
The index specified in the URL must be within the following range: [0 - 63].
The index specified in the URL must be within the following range: [0 - 63].
Warning: This will replace the current device configuration with the
configuration from the pre-set!
36
AVP Contribution API
set-carrier-off true forces carrier into the “Off” state. If absent, is inferred value
to mean false
The index specified in the URL must be within the following range: [0 - 63].
9 Alarms
The device shall return the Collection of all active Alarms. For example:
HTTP/1.1 200 OK
Content-Length: nnn
Content-Type: application/json
[
{
"severity" : "critical",
37
AVP Contribution API
timestamp NTP 64-bit timestamp at the time the alarm was raised number
10 Error messages
The API may return the following error messages:
Parameter value out-of-range. The API shall return the object(s) passed,
highlighting the invalid parameters. If an invalid combination of parameters
was passed, then the device configuration shall not be changed.
38
AVP Contribution API
Unlicensed features. The API shall indicate that a particular object wasn’t
modified because of a missing license.
500 Internal Server "An unknown error has 1 The request has failed
Error occurred." because of an internal
device error
"Request body of
400 Bad Request HTTP %1% shall be 3 Repeat the same request
empty." without the HTTP request
body.
400 Bad Request "JSON input is invalid." 6 Check the JSON syntax is
correct and only attempt to
write properties that are
not read-only
400 Bad Request "JSON root must be 8 Make sure the JSON root
an object." object is present.
400 Bad Request "An index must be 9 Specify a valid index for
specified to use this this collection
method."
39
AVP Contribution API
400 Bad Request "An invalid value has 11 Specify a valid index for
been specified as this collection
index."
400 Bad Request "%1% with index %2% 12 Specify a valid index for
not found." this collection
404 Not Found "Path '%1%' not found" 15 Check the Path given
in %1% is a valid API path
405 Method Not "Path '%1%' shall be 16 Make sure the method
Allowed called with %2% given in %2% is used for
(got %3%)." Path given in %1%
Note: In some cases, the error “400 Bad request” “JSON input is invalid” with
Code 6 may also return a body containing a “details” object:
{
"error" : {
"status" : "400 Bad Request",
"title" : " JSON input is invalid.",
"code" : 6,
"details" : {
"name" : "<-- OK",
"input" : [
{
"format" : "<-- invalid value",
"type" : "<-- OK"
}
]
}
}
}
40
AVP Contribution API
11 References
[1] HTTP/1.1: http://www.ietf.org/rfc/rfc2068.txt
[2] JSON: http://www.json.org
[3] application/json: http://www.ietf.org/rfc/rfc4627.txt
[4] AVP2000, AVP3000 Reference Guide http://www.mediakind.com
12 Change information
Version Date Author Comments
PB2 06/08/2013 EJEROCH Added RAS, output-select
PB3 29/03/2013 EJEROCH Added DVB triplet in Service
PB4 25/09/2013 EJEROCH Merged Web UI and 3PP REST API
PB5 27/11/2013 EJEROCH Added ‘Stripe Refresh (+Audio
Encode)’ and ‘1/0 (L+R)/2’ options.
Clarified audio ‘Off’.
PB6 10/12/2013 EJEROCH Updated to support eight audios.
PB7 16/04/2014 EJEROCH Updated to support additional roll-offs
in DVB-S2
PB8 9/10/2014 EANNRUT Updated to support DVB-S2X and off
profile for video
PB9 07/04/2015 EANNRUT Updated to include:
& • support for ASI and IP outputs
EDARWIN • support for VANC components
• configurable default GUI
41
AVP Contribution API
42