Restreaming API (ENG)

Restreaming API (ENG)

Description

The Restream API lets you create stream targets and link the to Icareus Suite Linear Channels.
The Restream Set can contain one or more stream targets. The host address of each stream target is treated as an RTMP ingest URL to which the stream is pushed once the stream is sent to the Icareus Suite Linear Channel.

Please not that Restream targets for a given Icareus Suite Linear Channel are only created as the stream is received on our Origin. So creating and linking Restream Sets to a channel while a stream is active will have no effect. The stream must be stopped and started again for the changes to take effect.

API Path

  1. /api/restream
Config JSON
The config value expected by the config parameter of this API should be in the following format.
  1. {
  2.   "set": [
  3.     {
  4.       "host": "127.0.0.1",
  5.       "port": "1935",
  6.       "applicationName": "liveApplication1",
  7.       "streamName": "stream1",
  8.       "username": "",
  9.       "password": ""
  10.     },
  11.     {
  12.       "host": "localhost",
  13.       "port": "1935",
  14.       "applicationName": "liveApplication2",
  15.       "streamName": "stream2",
  16.       "username": "appUsername",
  17.       "password": "appPassword"
  18.     }
  19.   ]
  20. }
Since the config JSON is sent to the API as a query parameter, it should ideally be URL encoded and minified.

Get Restream Sets

Returns the list of Restream Sets for the Organization.

Parameters
Name
Value
Requirement
Info
action
getRestreamSets
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization

Example

  1. /api/restream?action=getRestreamSets&organizationId=2631609&secret=secret

Response

Successful response
  1. {
  2.   "status": "ok",
  3.   "sets": [
  4.     {
  5.       "config": "{\"set\":[{\"port\":\"1935\",\"username\":\"\",\"host\":\"46.137.187.148\",\"applicationName\":\"suitelive\",\"password\":\"\",\"streamName\":\"restream\"},{\"port\":\"1935\",\"username\":\"\",\"host\":\"46.137.187.148\",\"applicationName\":\"suitelive\",\"password\":\"\",\"streamName\":\"another-restream\"}]}",
  6.       "restreamSetId": 4411301
  7.     }
  8.   ],
  9.   "organizationId": 2631609
  10. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }

Add Restream Set

Adds a new Restream Set to the Organization

Parameters
Name
Value
Requirement
Info
action
addRestreamSet
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
name
string
Mandatory
Name of the Restream Set
config
string
Mandatory
Restream set configuration JSON (stringified)

Example

  1. /api/restream?organizationId=2631609&secret=secret&action=addRestreamSet&name=Restream%20set%201&config=%7B%22set%22%3A%5B%7B%22host%22%3A%22127.0.0.1%22%2C%22port%22%3A%221935%22%2C%22applicationName%22%3A%22testapplication%22%2C%22streamName%22%3A%22teststream%22%2C%22username%22%3A%22%22%2C%22password%22%3A%22%22%7D%5D%7D

Response

Successful response
  1. {
  2.   "message": "added",
  3.   "status": "ok",
  4.   "restreamSetId": 4425901
  5. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }

Update Restream Set

Updates an existing Restream Set

Parameters
Name
Value
Requirement
Info
action
updateRestreamSet
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
restreamSetId
number
Mandatory
ID of the Restream Set to update
config
string
Mandatory
Restream set configuration JSON

Example

  1. /api/restream?organizationId=2631609&secret=secret&action=updateRestreamSet&restreamSetId=4425901&config=%7B%22set%22%3A%5B%7B%22host%22%3A%22localhost%22%2C%22port%22%3A%221935%22%2C%22applicationName%22%3A%22newapplication%22%2C%22streamName%22%3A%22restream%22%2C%22username%22%3A%22%22%2C%22password%22%3A%22%22%7D%5D%7D

Response

Successful response
  1. {
  2.   "message": "updated",
  3.   "status": "ok",
  4.   "restreamSetId": 4425901
  5. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }

Remove Restream Set

Removes an existing Restream Set
Parameters
Name
Value
Requirement
Info
action
removeRestreamSet
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
restreamSetId
number
Mandatory
ID of the Restream Set to remove

Example

  1. /api/restream?action=removeRestreamSet&organizationId=2631609&secret=secret&restreamSetId=4425901

Response

Successful response
  1. {
  2.   "message": "4425901 deleted",
  3.   "status": "ok"
  4. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }

Get linked Restream Sets

Returns the Restream Sets linked to an Icareus Suite Linear Channel
Parameters
Name
Value
Requirement
Info
action
getLinkedRestreamSets
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
serviceId
number
Mandatory
Icareus Suite Linear Channel ID

Example

  1. /api/restream?organizationId=2631609&secret=secret&action=getLinkedRestreamSets&serviceId=4014601

Response

Successful response
  1. {
  2.   "serviceId": 4014601,
  3.   "status": "ok",
  4.   "sets": [
  5.     {
  6.       "config": "{\"set\":[{\"port\":\"1935\",\"username\":\"\",\"host\":\"46.137.187.148\",\"applicationName\":\"suitelive\",\"password\":\"\",\"streamName\":\"restream\"},{\"port\":\"1935\",\"username\":\"\",\"host\":\"46.137.187.148\",\"applicationName\":\"suitelive\",\"password\":\"\",\"streamName\":\"another-restream\"}]}",
  7.       "restreamSetId": 4411301
  8.     }
  9.   ]
  10. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }
Links a Restream Set to a Icareus Suite Linear Channel

Parameters
Name
Value
Requirement
Info
action
linkRestreamSet
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
serviceId
number
Mandatory
Icareus Suite Linear Channel ID
restreamSetId
number
Mandatory
Restream Set ID

Example

  1. /api/restream?organizationId=2631609&secret=secret&action=linkRestreamSet&serviceId=4014601&restreamSetId=4425901

Response

Successful response
  1. {
  2.   "message": "restreamSet:4425901 added to channel:4014601",
  3.   "status": "ok",
  4.   "restreamSetId": 4425901
  5. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }
Unlinks a Restream Set from an Icareus Suite Linear Channel

Parameters
Name
Value
Requirement
Info
action
unlinkRestreamSet
Mandatory

organizationId
number
Mandatory
Icareus Suite Organization ID
secret
string
Mandatory
Secret key of the Organization
serviceId
number
Mandatory
Icareus Suite Linear Channel ID
restreamSetId
number
Mandatory
Restream Set ID

Example

  1. /api/restream?organizationId=2631609&secret=secret&action=unlinkRestreamSet&serviceId=4014601&restreamSetId=4425901

Response

Successful response
  1. {
  2.   "message": "restreamSet:4425901 removed from channel:4014601",
  3.   "status": "ok"
  4. }
Error response
  1. {
  2.   "status": "error",
  3.   "message": "information about what went wrong"
  4. }