Server REST API

Table of Contents

Definition

HTTP Status Codes

HTTP Status Codes are defined by RFC7213.

API Access Level

Includes Administrator, Reseller and generic Levels. Administrator Level API is only for the user defined by Administrator option in IPTV Panel, Reseller Level API is for Supper Reseller and Reseller options.

Specification

System API


get_system_uptime

Get System Uptime

Syntax

  • GET /server/get_system_uptime?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • if successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "UptimeSec=xxx\r\nUptime=x days xx:xx:xx\r\n" for system.

  • UptimeSec: its unit is by second.

 

Token API


createtokenbased64

The initial EZserver API is to get the authorization token.

Syntax

  • GET /token/createtokenbased64?encrpty=xxxxxxxxxx  HTTP/1.0 \r\n\r\n

Parameters

  • encrypt: base64-encoded string of user id and password

Return value

  • HTTP response status code : "200 OK" with "token=value".

  • If successful, value >=0, else value

  • -1: parameter error

    -2: Wrong User ID or Password

    -3: User ID Time Expired

Remarks

  • An application needs to get a token from EZserver first, then it uses the token to do the following sequential EZserver APIs.

  • This initial EZserver APIs are createtoken with user id and password or createtokenbased64 with base64-encoded string of user id and password.

  • The application needs to destroy the token by destroytoken with the token, user id and password.

Example

function encode64(input) 

var keyStr = "ABCDEFGHIJKLMNOP" + 
"QRSTUVWXYZabcdef" + 
"ghijklmnopqrstuv" + 
"wxyz0123456789+/" + 
"="; 
// input = escape(input); 
var output = ""; 
var chr1, chr2, chr3 = ""; 
var enc1, enc2, enc3, enc4 = ""; 
var i = 0; 

do { 
chr1 = input.charCodeAt(i++); 
chr2 = input.charCodeAt(i++); 
chr3 = input.charCodeAt(i++); 

enc1 = chr1 >> 2; 
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 
enc4 = chr3 & 63; 

output = output + 
keyStr.charAt(enc1) + 
keyStr.charAt(enc2) + 
keyStr.charAt(enc3) + 
keyStr.charAt(enc4); 
chr1 = chr2 = chr3 = ""; 
enc1 = enc2 = enc3 = enc4 = ""; 
} while (i < input.length); 
return output; 

function login(){

 var cgi_url;

 var encrypt_str;

 var userid_pass;

 g_user_id = document.getElementById("user_id").value;

 g_password = document.getElementById("password").value;

 userid_pass=g_user_id+':'+g_password;

 encrypt_str=encode64(userid_pass);

cgi_url = "/token/createtokenbased64?encrpty="+escape(encrypt_str)+"&flag="+Math.random();

xmlHttp.open("GET", cgi_url, true);

xmlHttp.onreadystatechange = login_return;

xmlHttp.send(null);

}

function login_return() {

  if (xmlHttp.readyState == 4)

  {

    var response = xmlHttp.responseText;

    if (response.search("-1")>0)

    {

       alert("parameter error");

    } else if (response.search("-2")>0)

    {

       alert("Wrong User ID or Password");

    } else if (response.search("-3")>0)

    {

       alert"User ID Time Expired");

    }

    else

    {

               g_token=response.slice(6,response.length-2);

}

}

}

function logout()

{

var cgi_url;

  var confirm_msg="Logout?";

  if (confirm(confirm_msg))

{

     g_token=find_cookie_value("token");

          g_user_id=find_cookie_value("userid");

          g_password=find_cookie_value("password");

     cgi_url = "/token/destroytoken?token="+escape(g_token)+"&flag="+Math.random();

         xmlHttp.open("GET", cgi_url, true);

         xmlHttp.onreadystatechange = login_out_return;

         xmlHttp.send(null);

}

}

function login_out_return() {

  if (xmlHttp.readyState == 4)

  {

    var response = xmlHttp.responseText;

      g_token=0;       

   }

}


createtoken

The initial HTTP API is to get the authorization token.

Syntax

  • GET /token/createtoken?userid=xxx&password=xxxx  HTTP/1.0 \r\n\r\n

Parameter

  • userid: User ID

  • password: User Password

Return value

  • HTTP response status code : "200 OK" with "token=value". 

  • If successful, value >=0, else value

  • -1: parameter error

    -2: Wrong User ID or Password

    -3: User ID Time Expired

Remarks

  • An application needs to get a token from EZserver first, then it uses the token to do the following sequential EZserver APIs. 

  • This initial EZserver APIs are createtoken with user id and password or createtokenbased64 with base64-encoded string of user id and password.

  • The application needs to destroy the token by destroytoken with the token, user id and password.


destroytoken

The final HTTP API is to release the authorization token.

Syntax

  • GET /token/destroytoken?token=xxxx  HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • HTTP response status code : "200 OK" with "token=value". 

  • If successful, value >=0, else value

  • -3: Non-Login User ID

    -4: Mismatch token for login user id

Remarks

  • An application needs to get a token from EZserver first, then it uses the token to do the following sequential EZserver APIs.

  • This initial EZserver APIs are createtoken with user id and password or createtokenbased64 with base64-encoded string of user id and password.

  • The application needs to destroy the token by destroytoken with the token, user id and password.

 

Channel API


get_channels

Get the major information of limited channels.

Syntax

  • GET /server/get_channels?token=xxx&position=xxx&limit=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • position: starting position.

  • limit: limit number.

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "CH=xx\r\nname=xxx\r\nsrc=xxx\r\nicon=xxx\r\ncategory=xxx\r\ntype=xxx\r\nstatus=xxx\r\nbitrate=xxx\r\n" for each channel, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • CH: Channel no

    • name: Channel name

    • src: input stream path

    • icon: Channel icon path

    • category: Channel category

    • type: live, delay,dvr, inactive

    • status: On with uptime/OFF/Connecting/FWD, 

    • bitrate: Channel upload bandwidth


get_channel_category

Get categories of all channels.

Syntax

  • GET /server/get_channel_category?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "category=xx\r\ncategory=xxx\r\ncategory=xxx\r\n" for Channel Category, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • category: Channel category

Remarks

  • For example, CH1 category is "Sport", CH2 category is "Sport",  CH3 category is "Kids" and CH4 category is "Action", the response is "category=Sport\r\ncategory=Kids\r\ncategory=Action".


query_status_channel_list (Administrator Level API)

Get all channels' status

Syntax

  • GET /server/query_status_channel_list?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "status=xxx\r\nbitrate=xxx\r\n" for each channel, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • status: On with uptime/OFF/Connecting,

    • bitrate: Channel upload bandwidth


query_channel_more (Administrator Level API)

Get channel more information.

Syntax

  • GET /server/query_channel_more?token=xxx&ch_no=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and

"CH=xx\r\nname=xxx\r\nsrc=xxx\r\nsr2=xxx\r\nsr3=xxx\r\nsid=xxx\r\ntolerance=xxx\r\nforward=xxx\r\nbitratetype=xxx\r\n

video_format=xxx\r\naudio_format=xxx\r\nmobilebitrate=xxx\r\nsdbitrate=xxx\r\nhdbitrate=xxx\r\n

mobilewidth=xxx\r\nsdwidth=xxx\r\nhdwidth=xxx\r\nmobileheight=xxx\r\nsdheight=xxx\r\nhdheight=xxx\r\nvideoaspect=xxx\r\n

preset=xxx\r\ncacheondemand=x\r\nnetip=xxx\r\ncatch_up_days=xx\r\nepg_channel_id=xxx\r\nhttp_user_agent=xxx\r\nindicatorurl=x\r\n",

else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • CH: Channel no

    • name: Channel name

    • src: input stream path

    • sr2: if src is not available, then try sr2 URL.

    • sr3: if src and sr2 are not available, then try sr3 URL.

    • sid: for enigma EPG use

    • tolerance:  for video streaming performance of a channel, it is same as "Channel Streaming Bitrate Tolerance" of Setting Windows that is for all channels., 

    • forward: 0/1. if forward=1, ezserver acts Proxy server.

    • bitratetype:  HTTP Live Streaming Type: 

      • 0: Disabled

      • 1: Constant Bitrate

      • 2: Adaptive Bitrate

        • video_format:  H264/H265

        • audio_format: aac/mp3

        • mobilebitrate: kbps

        • sdbitrate: kbps

        • hdbitrate:kbps

        • mobilewidth:px

        • sdwidth:px

        • hdwidth:px

        • mobileheight:px

        • sdheight:px

        • hdheight:px

        • videoaspect: null, 16:9, 4:3, 21:9, 18:9

        • preset: ultrafast/fast/medium/slow

      • 3:Logo Watermark

      • 4:AES-128 Encrption

    • cacheondemand:  0/1: disabled/enabled

    • netip: network adapter IP for multicast stream

    • catch_up_days: channel record duration

    • epg_channel_id: define EPG channel name 

    • http_user_agent: HTTP User Agent

    • genre: genre ids

    • indicatorurl: the index of current src urls

      • 0: main url

      • 1: the 2nd url

      • 2: the 3rd url

Remarks

  • sid is for enigma epg. For example sid=:0:1:13F:157C:13E:820000:0:0:0, it means the channel has EPG information in channel list for enigma devices.

  • forward=1 will publish src URL to players and ezserver does not stream video to players. This way is that players does not spend ezserver network bandwidth.

  • forward=0 does not publish your source url to players and ezserver stream video to players..


save_channel_more (Administrator Level API)

Save more information of a  channel

Syntax

  • GET /server/save_channel_more?token=xxx&ch_no=xxxsr2=xxx&sr3=xxx&netip=xxx&sid=xxx&tolerance=xxx&forward=xxx&bitratetype=x&

cacheondemand=x&catch_up_days=xx&epg_channel_id=xxx&http_user_agent=xxx HTTP/1.0 \r\n\r\n

  • bitratetype=2 needs to add more information: &video_format=xxx&audio_format=xxx&mobilebitrate=xxx&sdbitrate=xxx&hdbitrate=xxx&

mobilewidth=xxx&sdwidth=xxx&hdwidth=xxx&mobileheight=xxx&sdheight=xxx&hdheight=xxx&videoaspect=xxx&preset=xxx;


Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • sr2: if src is not available, then try sr2 URL.

  • sr3: if src and sr2 are not available, then try sr3 URL.

  • netip: network adapter IP for multicast stream

  • sid: for enigma EPG use

  • genre:  genre ids

  • tolerance:  for video streaming performance of a channel, it is same as "Channel Streaming Bitrate Tolerance" of Setting Windows that is for all channels., 

  • forward: 0/1. if forward=1, ezserver acts Proxy server.

  • bitratetype:  HTTP Live Streaming Type: 

    • 0: Disabled

    • 1: Constant Bitrate

    • 2: Adaptive Bitrate

      • video_format:  H264/H265

      • audio_format: aac/mp3

      • mobilebitrate: kbps

      • sdbitrate: kbps

      • hdbitrate:kbps

      • mobilewidth:px

      • sdwidth:px

      • hdwidth:px

      • mobileheight:px

      • sdheight:px

      • hdheight:px

      • videoaspect: null, 16:9, 4:3, 21:9, 18:9

      • preset: ultrafast/fast/medium/slow

    • 3:Logo Watermark

    • 4:AES-128 Encrption

  • cacheondemand:  0/1: disabled/enabled

  • catch_up_days: channel record duration

  • http_user_agent: HTTP User Agent

  • epg_channel_id: define EPG channel name

Return value

  •  If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

Remarks

  • sid is for enigma epg. For example sid=:0:1:13F:157C:13E:820000:0:0:0, it means the channel has EPG information in channel list for enigma devices.

  • forward=1 will publish src URL to players and ezserver does not stream video to players. This way is that players does not spend ezserver network bandwidth.

  • forward=0 does not publish your source url to players and ezserver stream video to players.


add_channel (Administrator Level API)

Add a new channel into the specific channel or the last channel.

Syntax

  • GET /server/add_channel?token=xxx&ch_no=xxx&ch_name=xxx&src=xxx &category=xxx&icon=xxx&type =xxx HTTP/1.0 \r\n\r\n

  • GET /server/add_channel?token=xxx&ch_name=xxx&src=xxx &category=xxx&icon=xxx&type =xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • ch_ name: channel name

  • src: input stream path

  • category: channel category

  • icon: channel icon path

  • type: live, delay,dvr, inactive

Return value

  • with ch_no option

    • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

  • without ch_no option

    • Add new channel into the last channel.

    • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


update_channel (Administrator Level API)

Modify the channel information by channel no. or channel name.

Syntax

  • GET /server/update_channel?token=xxx&ch_no=xxx&ch_name=xxx&src=xxx&category=xxx&icon=xxx&type =xxxHTTP/1.0 \r\n\r\n

  • GET /server/update_channel?token=xxx&ch_name=xxx&src=xxx&category=xxx&icon=xxx&type =xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no (optional)

  • ch_ name: channel name

  • src: input stream path

  • category: channel category

  • icon: channel icon path

  • type: live, delay, dvr, inactive

Return value

  •  If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


del_channel (Administrator Level API)

Delete a channel by channel no. or channel name.

Syntax

  • GET /server/del_channel?token=xxx&ch_no=xxx HTTP/1.0 \r\n\r\n

  • GET /server/del_channel?token=xxx&ch_name=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • ch_ name: channel name

Return value

  •  If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


refresh_channel (Administrator Level API)

Refresh all channels

Syntax

  • GET /server/refresh_channel?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • HTTP response status code : "200 OK" with "1"


refresh_a_channel (Administrator Level API)

Refresh a channel by channel no. or channel name.

Syntax

  • GET /server/refresh_a_channel?token=xxx&ch_no=xxx HTTP/1.0 \r\n\r\n

  • GET /server/refresh_a_channel?token=xxx&ch_name=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • ch_ name: channel name

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


get_channel_uptime

Get channel uptime.

Syntax

  • GET /server/get_channel_uptime?token=xxx HTTP/1.0 \r\n\r\n

  • GET /server/get_channel_uptime?token=xxx&ch_no=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

Return value

  • with ch_no option

    • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "UptimeSec=xxx\r\nUptime=x days xx:xx:xx\r\n" for the channel.

  • without ch_no option

    • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "UptimeSec=xxx\r\nUptime=x days xx:xx:xx\r\n" for all channels

  • UptimeSec: its unit is by second.


get_channel_statistics (Administrator Level API)

Get channel statistics.

Syntax

  • GET /server/get_channel_statistics?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "CH=xx\r\nname=xxx\r\nWatched_No=xxx\r\n

Active_No=xxx\r\nnUptime=xxx days xx:xx:xx\r\nstatus=xxxxx" for each channel, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • CH: Channel no

    • name: Channel name

    • Watched_No: The accumulated watched No. of a channel from 00:00:00 AM..

    • Active_No: The watching no.   

    • Uptime: dd days hh:mm:ss from previous refreshing time.

    • Status: ON with Buffer Index and Size / OFF / Connectin

Remarks

  • Channel buffer is a ring buffer to keep the latest video stream. Its status has ON with 2 digital no./OFF/Connecting.

  • ON status includes channel current buffer index and available buffer size of Channel buffer. 

  • For example, CH1 status : ON(200 8000) means CH1 has 8000 input streaming buffer entries and the current index is 200. 


 

 

 

 

 

 

 

 


get_channel_group (Administrator Level API)

Get channel groups.

Syntax

  • GET /server/get_channel_group?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and 

        "CH=xx\r\nname=xxx\r\ngroup1=xxxx\r\ngroup2=xxxx\r\ngroup4=xxxx\r\n

        CH=xx\r\nname=xxx\r\ngroup1=xxxx\r\ngroup5=xxxx\r\ngroup6=xxxx\r\n\r\n",

         else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • CH: Channel no

    • name: Channel name

    • groupx: group no. with group name.


get_channel_no

Get channel no.

Syntax

  • GET /server/get_channel_no?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "chno=xxx\r\n"

 

Movie API


get_movies

Get the major information of limited movies.

Syntax

  • GET /server/get_movies?token=xxx&position=xxx&limit=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • position: starting position.

  • limit: limit number.

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx andmovieno=xxx\r\nname=xxx\r\nsrc=xxx\r\nimg=xxx\r\n

category=xxx\r\nduration=xxx\r\nbitrate=xxx\r\nstatus=x\r\n for each movie, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • movieno: Movie No

    • name: Movie Name

    • src: input Movie path

    • img: Movie icon path

    • category: Movie category

    • duration: Movie duration (unit: second)

    • bitrate: Movie bitrate (unit: 1K bps)

    • status: 1/0


get_movie_category

Get categories of all movies

Syntax

  • GET /server/get_movie_category?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "category=xx\r\ncategory=xxx\r\ncategory=xxx\r\n" 

for Movie Category, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • category: Movie category 

Remarks

  • For example, Movie 1 category is "Sport", Movie 2 category is "Sport",  Movie 3 category is "Kids" and Movie 4 category is "Action", the response is "category=Sport\r\ncategory=Kids\r\ncategory=Action".


add_movie (Administrator Level API)

Add a new movie

Syntax

  • GET /server/add_movie?token=xxx&movie_no=xxx&movie_name=xxx&src=xxx&category=xxx&img=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movieno: Movie No

  • movie_name: Movie Name

  • src: input Movie path

  • img: Movie icon path

  • category: Movie category

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


update_movie (Administrator Level API)

Modify the movie information

Syntax

  • GET /server/update_movie?token=xxx&movie_no=xxx&movie_name=xxx&src=xxx&category=xxx&img=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movieno: Movie No

  • movie_name: Movie Name

  • src: input Movie path

  • img: Movie icon path

  • category: Movie category

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


del_movie (Administrator Level API)

Delete a movie

Syntax

  • GET /server/del_movie?token=xxx&&movie_no=xxx  HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movie_no: Movie No

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


refresh_movie (Administrator Level API)

Refresh all movies

Syntax

  • GET /server/refresh_movie?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • HTTP response status code : "200 OK" with "1"


refresh_a_movie (Administrator Level API)

Refresh a movie

Syntax

  • GET /server/refresh_a_movie?token=xxx&movie_no=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movie_no: movie no

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


get_movie_more (Administrator Level API)

Get movie more information

Syntax

  • GET /server/get_movie_more?token=xxx&&movie_no=xxx  HTTP/1.0\r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movie_no: Movie No

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "movieno=xx\r\nname=xxx\r\ndescription=xxx\r\nrentpoint=xxx\r\nbuypoint=xxx\r\nratingflag=xx\r\nquality=xx\r\nrentperiod=xx\r\nforward=x\r\n\r\n", 

else return HTTP response status code : "404 Not Found".

  • Content meaning: 

    • movie_no: Movie No

    • name: Movie Name.

    • description: Movie description

    • rentpoint: Rent Point

    • buypoint: Buy Point.

    • ratingflag: 0/1. 1: needs rating password to access the movie..

    • quality: Mobile/SD/HD

    • rentperiod: Rent Period by hours.

    • genre: genre ids

    • forward: 0/1. if forward=1, ezserver acts Proxy server.


save_movie_more (Administrator Level API)

Save movie more information

Syntax

  • GET /server/save_movie_more?token=xxx&&movie_no=xxx&description=xxx&entpoint=xxx&buypoint=xxx&ratingflag=xxx&quality=xxx&

entperiod=xx&forward=xHTTP/1.0\r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • movie_no: Movie No

  • description: Movie description

  • rentpoint: Rent Point

  • buypoint: Buy Point.

  • ratingflag: 0/1. 1: needs rating password to access the movie..

  • quality: Mobile/SD/HD

  • rentperiod: Rent Period by hours.

  • genre: genre ids

  • forward: 0/1. if forward=1, ezserver acts Proxy server.

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

 

Group API


query_group

Get all group information

Syntax

  • GET /server/query_group?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and 

"No=xx\r\nname=xxx\r\nconnection=xxx\r\nsrc=xxx\r\n

mc_src=all=x,ccc=x,ccc=x,ccc=x\r\n" for each group, else return HTTP response status code : "404 Not Found"

  • Content meaning: 

    • No: Group No

    • name: Group Name

    • connection: Define the max concurrent connection for a user in the group

    • src: Allowed Channels

      • Define allowed Channel Categories for the group. The keyword "all" is for all Channel Categories.   .

      • Ex. Actions=1,Kids=0,Sprts=1 means the group users can watch all Channels in Actions and Sports Categories.

      • Ex. all means the group users can watch all channels

    • mc_src: Allowed Movie Categories

      • Define allowed Movie Categories for the group. The keyword "all" is for all Movie Categories.  

      • Ex. Actions=1,Kids=0,Sprts=1 means the group users can watch all movies in Actions and Sports Categories.

      • Ex. all means the group users can watch all Movie Categories.


add_group (Administrator Level API)

Add a new group

Syntax

  • GET /server/add_group?token=xxx&group_name=xxx&group_concurrent_connection=xxx&group_src=xxx&group_mcsrc=all=x,ccc=x,ccc=xHTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • group_name: Group Name

  • group_src: Allowed Channel Categories separated by comma, ex: "all=0,Actions=1,Kids=0,Sports=1" or "all=1,Actions=0,Kids=0,Sports=0" for all Channel Categories.

  • group_mcsrc: Allowed Movie Categories separated by comma, ex: "all=0,Actions=1,Kids=0,Sports=1" or "all=1,Actions=0,Kids=0,Sports=0" for all Movie Categories.

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


update_group (Administrator Level API)

Modify the group information

Syntax

  • GET /server/update_group?token=xxx&group_name=xxx&group_concurrent_connection=xxx&group_src=xxx&group_mcsrc=all=x,ccc=x,ccc=xHTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • group_name: Group Name

  • group_concurrent_connection: max. concurrent connection

  • group_src: Allowed Channel Categories separated by comma, ex: "all=0,Actions=1,Kids=0,Sports=1" or "all=1,Actions=0,Kids=0,Sports=0" for all Channel Categories.

  • group_mcsrc: Allowed Movie Categories separated by comma, ex: "all=0,Actions=1,Kids=0,Sports=1" or "all=1,Actions=0,Kids=0,Sports=0" for all Movie Categories.

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


del_group (Administrator Level API)

Delete a group

Syntax

  • GET /server/del_group?token=xxx&group_name=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • group_name: Group Name

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

 

User API


add_user (Administrator / Reseller Level API)

Add a new user information

Syntax

  • GET /server/add_user?token=xxx&userno=xxx&username=xxx&password=xxx&group=xxx&max_connection=x&expired_time=xxx&userip=xxx&macid=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • userno: it is optional, if assign userno=xxx, then the new user is inserted after the userno. Otherwise, the new user is inserted in the end.

  • username: User Name

  • password: Password

  • group: group name

  • expired_time: user expired time (YY/MMDD) or days (DDD).

    • YY/MM/DD : ex. 2018/12/31 

    • DDD: 180 (available days after the first video connection).

  • userip: client IP

  • macid: device MAC Address

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0" for failed, "2" Database Internal Error, "3" Duplicated User, "4" Password has : symbol.


update_user (Administrator / Reseller Level API)

Update a user information

Syntax

  • GET /server/update_user?token=xxx&username=xxx&password=xxx& group=xxx&expired_time=xxx&userip=xxx&macid=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • username: User Name

  • password: Password

  • group: group name

  • expired_time: user expired time

  • userip: client IP

  • macid: device MAC Address

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


del_user (Administrator / Reseller Level API)

Delete a user information

Syntax

  • GET /server/del_user?token=xxx&username=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • username: User Name

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


query_user_more (Administrator / Reseller Level API)

Get the extra information of the specified user

Syntax

  • GET /server/query_user_more?token=xxx&username=xxx HTTP/1.0 \r\n\r\n

  • GET /server/query_user_more?token=xxx&user_no=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • username: User Name

  • user_no: User Index 

Return value

If successful, HTTP response 

"username=xxx\r\nuser2ndip=xxxx\r\nuser3rdip=xxxx\r\nuser4thip=xxxx\r\nuser5thip=xxxx\r\nrating_password=xxxx\r\nlevel=x\r\nmaxconnection=xxx\r\n

curconnection=xxx\r\npaymodel=xxxx\r\nsmart_phone=xxx\r\ntablet=xxx\r\ndesktop=xxx\r\ntv=xxx\r\nfirst_name=xxx\r\nlast_name=xxx\r\n

address=xxx\r\ncity=xxx\r\nzip=xxx\r\ntel=xxx\r\nemail=xxx\r\n" else Null string

¡@

  • Content meaning: 

    • username: User Name

    • user2ndip: the 2nd user IP for protection

    • user3rdip: the 3rd user IP for protection

    • user4thip: the 4th user IP for protection

    • user5thip: the 5th user IP for protection

    • rating_password: Rating Password

    • level: 0: user, 1: Administrator, 2: Super Reseller, 3: Reseller

    • maxconnection: max. concurrent connections

    • curconnection: active concurrent connections

    • paymodel: vod model: Free, Post, Pre

    • smart_phone: smart phone name

    • tablet: tablet name

    • desktop: desktop name

    • tv: Smart TV name

    • first_name

    • last_name

    • address

    • city

    • zip

    • tel

    • email


save_user_more (Administrator / Reseller Level API)

Save the extra information of the specified user

Syntax

¡@

GET /server/save_user_more?

token="xxx&username=xxx&user2ndip=xxx&user3rdip=xxx&user4thip=xxx&user5thip=xxx&rating_password=xxxx&level=xxxx&maxconnection=xxx

paymodel=xxxx&smart_phone=xxx&tablet=xxx&desktop=xxx&tv=xxx&first_name=xxx&last_name=xxx&address=xxx&

city=xxx&zip=xxx&tel=xxx&email=xxx HTTP/1.0 \r\n\r\n

¡@

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • username: User Name

  • user2ndip: the 2nd user IP for protection

  • user3rdip: the 3rd user IP for protection

  • user4thip: the 4th user IP for protection

  • user5thip: the 5th user IP for protection

  • rating_password: Rating Password

  • level: 0: user, 1: Administrator, 2: Super Reseller, 3: Reseller

  • maxconnection: max. concurrent connections

  • paymodel: vod model: Free, Post, Pre

  • user_point: VOD remainder Points

  • smart_phone: smart phone name

  • tablet: tablet name

  • desktop: desktop name

  • tv: Smart TV name

  • first_name

  • last_name

  • address

  • city

  • zip

  • tel

  • email

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

 

EPG API


get_epg_info

Get a Channel EPG information.

Syntax

  • GET/server/get_epg_info?token=xxx&ch_no=xxx&from_year=YYYY&from_month=MM&to_month=MM HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • from_year: year

  • from_month: from month

  • to_month: to month

Return value

  • If successful, HTTP response status code : "200 OK" with Content-Length: xxxx and "starttime=YYYY/MM/DD hh:mm:rr\r\nstoptime=YYYY/MM/DD hh:mm:rr\r\ntitle=xxxx\r\ndescription=xxxx\r\nicon=xxxx\r\nrec=x\r\n" for each channel, else return HTTP response status code : "404 Not Found"

  •  Content meaning: 

    • starttime: Program Start Time

    • stoptime: Program Stop Time

    • title: Program Name

    • description: Program Detail

    • icon: Icon path: file://xxxx/xxxxx/x.jpg

    • rec: 0/1: OFF/ON for record live channel


add_epg_info (Administrator Level API)

Add the program EPG information of a channel

Syntax

  • GET/server/add_epg_info?token=xxx&ch_no=xxx&&program_no=xxx&starttime=YYYY/MM/DD hh:mm:ss&stoptime=YYYY/MM/DD hh:mm:ss&program_title=xxx&program_descrption=xxx&program_icon=xxxx&program_rec=xx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • program_no: program no

  • starttime: Program Start Time

  • stoptime: Program Stop Time

  • program_title: Program Name

  • program_descrption: Program Detail

  • program_icon: Program icon path: file://xxxx/xxxxx/x.jpg

  • program_rec: ON/OFF¡@

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


update_epg_info (Administrator Level API)

Update the program EPG information of a channel

Syntax

  • GET/server/update_epg_info?token=xxx&ch_no=xxx&&program_no=xxx&starttime=YYYY/MM/DD hh:mm:ss&stoptime=YYYY/MM/DD hh:mm:ss&program_title=xxx&program_descrption=xxx&program_icon=xxxx&program_rec=xx  HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • program_no: program no

  • starttime: Program Start Time

  • stoptime: Program Stop Time

  • program_title: Program Name

  • program_descrption: Program Detail

  • program_icon: Program icon path: file://xxxx/xxxxx/x.jpg

  • program_rec: ON/OFF

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


del_epg_info (Administrator Level API)

Delete the program EPG information of a channel

Syntax

  • GET/server/del_epg_info?token=xxx&ch_no=xxx&&program_no=xxx&starttime=YYYY/MM/DD hh:mm:ss HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • ch_no: channel no

  • program_no: program no

  • starttime: Program Start Time

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

 

Player Management API


get_player_list  (Administrator Level API)

Get active player information.

Syntax

  • GET /player/get_player_list?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    sessionno=xxx\r\nusername=xxx\r\nplayername=xxx\r\nwatching_ch=xxx\r\nplayer_time=xxx\r\nplayer_ip=xxx\r\n

    player_macid=xxx\r\nispname=xxx\r\ncountry=xxx\r\ngroup=xxx\r\n"  for each player, 

    else return HTTP response status code : 404 Not Found"

  • Content meaning: 

    • sessionno: Session no.

    • username: User Name

    • playername: User agent

    • watching_ch: Watching channel name with channel no or movie name, 

    • player_time: Player starting time.

    • player_ip: Player IP.

    • player_macid: Player mac address.

    • ispname: Player ISP.

    • country: Player country.

    • group: Player connection protocol (HTTP, RTMP).


get_alert_player_list  (Administrator Level API)

Get player information that its connection duration is over Alert Player Duration of Panel setting.

Syntax

  • GET /player/get_alert_player_list?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    sessionno=xxx\r\nusername=xxx\r\nplayername=xxx\r\nwatching_ch=xxx\r\nplayer_time=xxx\r\n

    player_watch_hour=xxx\r\nplayer_ip=xxx\r\nplayer_macid=xxx\r\n

    country=xxx\r\ngroup=xxx\r\n"  for each player, 

    else return HTTP response status code : 404 Not Found"

  • Content meaning: 

    • sessionno: Session no.

    • username: User Name

    • playername: User agent

    • watching_ch: Watching channel name with channel no or movie name, 

    • player_time: Player starting time.

    • player_watch_hour: Player connection duration over Alert Player Duration of Panel setting.

    • player_ip: Player IP.

    • player_macid: Player mac address.

    • country: Player country.

    • group: Player connection protocol (HTTP, RTMP).


get_reseller_player_list  (Reseller Level API)

Get active player information by a reseller.

Syntax

  • GET /player/get_reseller_player_list?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    sessionno=xxx\r\nusername=xxx\r\nplayername=xxx\r\nwatching_ch=xxx\r\nplayer_time=xxx\r\nplayer_ip=xxx\r\n

    player_macid=xxx\r\nispname=xxx\r\ncountry=xxx\r\ngroup=xxx\r\n"  for each player, 

    else return HTTP response status code : 404 Not Found"

  • Content meaning: 

    • sessionno: Session no.

    • username: User Name

    • playername: User agent

    • watching_ch: Watching channel name with channel no or movie name, 

    • player_time: Player starting time.

    • player_ip: Player IP.

    • player_macid: Player mac address.

    • ispname: Player ISP.

    • country: Player country.

    • group: group name


stop_player  (Administrator Level API)

Stop the player connection by its session no and connection protocol.

Syntax

  • GET /player/stop_player?token=xxx&sessionno=xxx&protocol=xxxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • sessionno: Player session no.

  • protocol: Player connection protocol (HTTP, RTMP).

Return value

  •  If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


block_player  (Administrator Level API)

Block the player connection by its session no and connection protocol.

Syntax

  • GET /player/block_player?token=xxx&sessionno=xxx&protocol=xxxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • sessionno: Player session no.

  • protocol: Player connection protocol (HTTP, RTMP).

Return value

  •  If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".

 

Reseller API


query_reseller_index (Administrator / Reseller Level API)

Get reseller profile.

Syntax

  • GET /server/query_reseller_index?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    username=xxx\r\nchecked=x\r\ncredit=xxx\r\ncredit_unit=xxx\r\ncreator=xxx\r\ntype=x\r\n" for each resller, else return HTTP response status code : "404 Not Found"

  • Content meaning: 

    • username: User Name

    • checked: 1:checked, 0: unchecked..

    • credit: Reseller total credit no.

    • credit_unit: User rent credit per month.

    • creator: Reseller parent.

    • type: 2: Supper reseller level, 3: Reseller level.


get_reseller_users (Reseller Level API)

Get all user information of a reseller.

Syntax

  • GET /server/get_reseller_users?token=xxx&position=xxx&limit=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • position: starting position.

  • limit: limit number.

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    username=xxx\r\npassword=xxx\r\ngroup=xxx\r\nexpired_time=yy/mm/dd\r\n userip =xxx\r\nmacid=xxx\r\nreseller=xxx\r\n" 

    for each group, else return HTTP response status code : "404 Not Found"

  • Content meaning: 

    • username: User Name

    • password: Password

    • group: group name

    • expired_time: user expired time

    • userip: client IP

    • macid: device MAC Address

    • reseller: Reseller name


reseller_add_user ( Reseller Level API)

Add a new user information by a reseller

Syntax

  • GET /server/reseller_add_user?token=xxx&userno=xxx&username=xxx&password=xxx& group=xxx&expired_time=xxx&userip=xxx&macid=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • userno: it is optional, if assign userno=xxx, then the new user is inserted after the userno. Otherwise, the new user is inserted in the end.

  • username: User Name

  • password: Password

  • group: group name

  • expired_time: user expired time

  • userip: client IP

  • macid: device MAC Address

Return value

  • If successful, HTTP response status code : "200 OK" with "1", else HTTP response status code : "200 OK" with "0".


search_reseller_user (Reseller Level API)

Get the position of the user by a reseller.

Syntax

  • GET /server/search_reseller_user?token=xxx&position=xxx&searchvalue=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

  • position: starting position.

  • searchvalue: user name.

Return value

  • If successful, HTTP response status code : "200 OK" with position, else HTTP response status code : "404 Not found".

 

Blacklist API


 

query_black_list  (Administrator Level API)

Get blacklist  information.

Syntax

  • GET /server/query_black_list?token=xxx HTTP/1.0 \r\n\r\n

Parameter

  • token: the token returned by createtoken or createtokenbased64

Return value

  • If successful, return HTTP response status code : "200 OK" with Content-Length: xxxx and "

    No=xxx\r\nusername=xxx\r\nip=xxx\r\nmacid=xxx\r\ncountry=xx\r\ntryno=xxx\r\navailno=xxx\r\n"  for each player, 

    else return HTTP response status code : 404 Not Found"

  • Content meaning: 

    • No: List index..

    • username: User Name

    • ip: Player IP.

    • macid: Player mac address.

    • country: Player country.

    • tryno: Player failure connection no..

    • availno: Player available connection no., the player is blocked for availno=0.

Appendix A:  Revision History

 

 

Version Date Notes
3.0.1 2017-12-28

Add Resolution and Video Aspect of Query_Channel_More

3.0.1 2017-12-28

Add Resolution and Video Aspect of Save_Channel_More

3.0.2 2018-01-11

Add user_no option in query_user_more

3.0.3 2018-08-28

Add examples

3.0.4 2018-12-10

Add query_black_list