# Store New Channel

API call format

POST /broker/channels                   //Use token autorization
POST /broker/private/channels           //Use Api Key
{
  "mediatailor": "<mediatailor_guid>",  
  "allowedForUsers": [                 
    "uder_guid_01",                     
    "uder_guid_02",
    ...
  ],
  "externalUrl": "string",                  
  "hasAds": 0,                          
  "loopInterval": 0,                     
  "imageUrl": "string",
  "allowedForRoles": [                  //use GET /organizations/{guid}/roles to get available user roles
    "user_role_01",
    "user_role_02",
    ...
  ],
  "name": "<channel_name>",
  "description": "<channel_description>",
  "active": 1,
  "type": "externalHLS||virtual",      
  "restrictedFor": [                    //use GET /organizations/{guid}/users to get user guids
    "uder_guid_03",                     
    "uder_guid_04",
    ...
  ]
}  

Description

This call creates a new video channel.

Precondition

  • Authorization token/Api key is needed.
  • Mandatory elements (should be specified):
    • "hasAds" - flag indicating "mediatailor" attribute should be specified
    • "name" - channel name
    • "description" - channel description
    • "active" - flag indicating if channel is visible in GUI
    • "type" - if "externalHLS" => "externalUrl" should be specified. If "virtual" "externalUrl" is missed.
  • Not mandatory (optional):
    • "mediatailor" - guid of external advertisement.
    • "allowedForUsers" - channel is allowed for specified array of user guids.
    • "externalUrl" - external link to HLS master manifest file (.m3u8).
    • "hasAds" - flag indicating mediatailor must be specified.
    • "loopInterval" - interval back from the end of the channnel to be looped after (in hours).
    • "imageUrl" - link to channel image.
    • "allowedForRoles" - channel is allowed for specified array of user roles guids.
    • "name" - channel description.
    • "restrictedFor" - channel is resticted for for specified array of user guids.

Postcondition

  • On success response code should be 200
  • On success message for successful creation in JSON format is returned.
  • On failure an error will be returned with the right error code and description.

Example:

[Request] POST https://<base_api_url>/broker/channels
[Request] POST https://<base_api_url>/broker/private/channels
{
  "mediatailor": "<mediatailor_guid>", 
  "allowedForUsers": [                 
    "uder_guid_01",                     
    "uder_guid_02",
    ...
  ],
  "externalUrl": "https://<external_server>/<path>/master.m3u8",             
  "hasAds": 1,                        
  "loopInterval": 1,                 
  "imageUrl": "string",
  "allowedForRoles": [                  
    "user_role_01",
    "user_role_02",
    ...
  ],
  "name": "<channel_name>",
  "description": "<channel_description>",
  "active": 1,
  "type": "externalHLS||virtual",       
  "restrictedFor": [                    
    "uder_guid_03",                     
    "uder_guid_04",
    ...
  ]
}  
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","Authorization":"<IdToken>"} //Use token autorization
[Request Headers] {"Content-Type":"application/json","Accept":"application/json","X-Api-Key":"<api_key>"}     //Use Api Key

[Response] 200
[Response Headers] {"Content-Type":["application/json"],"Content-Length":["..."],"Connection":["keep-alive"],"Date":["..... GMT"],"x-amzn-RequestId":["....."],....]}
[Response] 
{
    "status":true,
    "data":"Item was created successfully"
}