https://api.onnetwork.tv/api.phpAll input parameters need to be send as POST, secure connection only.
{ "action" : { "actionname" : "listwebsites" } }
{ "action": { "actionname":"listwebsites" } }Result:
{ "status":"OK", "action":"listwebsites", "result":[ { "id":"123", "name":"Website about dogs", "url":"http:\/\/www.dogs.org" }, { "id":"234", "name":"Website about kitties", "url":"http:\/\/www.kitty.org" } ] }Each record contains fields:
id - unique website id (integer)
name - website name (string)
url - website url (string)
{ "action": { "actionname":"liststorages" } }Result:
{ "status":"OK", "action":"liststorages", "result":[ { "id":"2058", "name":"Test storage" }, { "id":"1316", "name":"Soccer videos" } ] }Each record contains fields:
id - unique storage id (integer)
name - storage name (string)
{ "action": { "actionname":"listadcats" } }Result:
{ "status":"OK", "action":"listadcats", "result":[ { "movieadtype":0, "movieadtypename":"Film nie zatwierdzony dla reklam" }, { "movieadtype":1, "movieadtypename":"Film ukazuj\u0105cy erotyk\u0119" }, { "movieadtype":2, "movieadtypename":"Film ukazuj\u0105cy przemoc" }, { "movieadtype":3, "movieadtypename":"Film kontrowersyjny" }, { "movieadtype":4, "movieadtypename":"Film z wypadku, ukazuj\u0105cy poszkodowanych" }, { "movieadtype":5, "movieadtypename":"Ca\u0142kowity zakaz reklam" }, { "movieadtype":10, "movieadtypename":"Dopuszczony dla wszystkich reklam" } ] }Each record contains fields:
movieadtype - unique advertisement category number(integer)
movieadtypename - name or description of category(string)
{ "action": { "actionname":"listvideocategories" } }Result:
{ "status":"OK", "action":"listvideocategories", "result":[ { "videocatid":0, "videocatname":"Nieprzypisana" }, { "videocatid":1, "videocatname":"Gaming" }, { "videocatid":2, "videocatname":"Ksi\u0105\u017cka" }, { "videocatid":3, "videocatname":"Muzyka" }, { "videocatid":4, "videocatname":"Polityka" }, { "videocatid":5, "videocatname":"Rozrywka" }, { "videocatid":6, "videocatname":"Styl \u017cycia" }, { "videocatid":7, "videocatname":"Uroda" }, { "videocatid":8, "videocatname":"Motoryzacja" }, { "videocatid":9, "videocatname":"Edukacja" }, { "videocatid":10, "videocatname":"Ekonomia i Gospodarka" }, { "videocatid":11, "videocatname":"Kobieta" }, { "videocatid":12, "videocatname":"Kulinaria i od\u017cywianie" }, { "videocatid":13, "videocatname":"" }, { "videocatid":14, "videocatname":"Parenting" }, { "videocatid":15, "videocatname":"Poradniki" }, { "videocatid":16, "videocatname":"Sport" }, { "videocatid":17, "videocatname":"Zdrowie" }, { "videocatid":18, "videocatname":"Ekologia" }, { "videocatid":19, "videocatname":"Popularnonaukowe" }, { "videocatid":20, "videocatname":"Film" }, { "videocatid":21, "videocatname":"Spo\u0142ecze\u0144stwo" }, { "videocatid":22, "videocatname":"Prawo" }, { "videocatid":23, "videocatname":"Kultura i sztuka" }, { "videocatid":24, "videocatname":"Fitness" }, { "videocatid":25, "videocatname":"Turystyka" }, { "videocatid":26, "videocatname":"Technologie" }, { "videocatid":27, "videocatname":"Informacje" }, { "videocatid":28, "videocatname":"Moda" }, { "videocatid":29, "videocatname":"Nauka" }, { "videocatid":33, "videocatname":"Foto" }, { "videocatid":34, "videocatname":"Audio, wideo" } ] }Each record contains fields:
videocatid - unique category number (integer)
videocatname - name or description of category(string)
{ "action": { "actionname":"listprivcats" } }Result:
{ "status":"OK", "action":"listvideocategories", "result":[ { "id":99, "name":"PrivCat1" }, { "id":108, "name":"PrivCat2" } ] }Each record contains the following information:
id - unique number of the private category of the video
name - the name or description of the private video category.
NOTE: Not every Partner has defined private categories of video content. In this case, a corresponding error is returned.
{ "action": { "actionname":"listwebsitecategories" } }Result:
{ "status":"OK", "action":"listwebsitecategories", "result":[ { "websitecatid":"ab", "websitecatname":"biznes, finanse, prawo" }, { "websitecatid":"ac", "websitecatname":"blogi, fora" }, { "websitecatid":"ad", "websitecatname":"budownictwo i nieruchomo\u015bci" }, { "websitecatid":"ae", "websitecatname":"dla dzieci" }, { "websitecatid":"af", "websitecatname":"e-commerce, og\u0142oszenia i oferty" }, { "websitecatid":"ag", "websitecatname":"edukacja" }, { "websitecatid":"ah", "websitecatname":"erotyka" }, { "websitecatid":"ai", "websitecatname":"film, muzyka, wydarzenia" }, { "websitecatid":"aj", "websitecatname":"fotografia" }, { "websitecatid":"bb", "websitecatname":"hobby" }, { "websitecatid":"ak", "websitecatname":"informacje i publicystyka" }, { "websitecatid":"al", "websitecatname":"kobieta" }, { "websitecatid":"am", "websitecatname":"kultura i sztuka" }, { "websitecatid":"an", "websitecatname":"media" }, { "websitecatid":"ao", "websitecatname":"motoryzacja" }, { "websitecatid":"ba", "websitecatname":"m\u0119\u017cczyzna" }, { "websitecatid":"ap", "websitecatname":"nowe technologie" }, { "websitecatid":"aq", "websitecatname":"praca" }, { "websitecatid":"ar", "websitecatname":"rozrywka" }, { "websitecatid":"at", "websitecatname":"sport" }, { "websitecatid":"as", "websitecatname":"spo\u0142eczno\u015bci" }, { "websitecatid":"au", "websitecatname":"styl \u017cycia" }, { "websitecatid":"av", "websitecatname":"technologia" }, { "websitecatid":"aw", "websitecatname":"telefonia kom\u00f3rkowa" }, { "websitecatid":"ax", "websitecatname":"turystyka" }, { "websitecatid":"ay", "websitecatname":"wyszukiwarki i katalogi" }, { "websitecatid":"az", "websitecatname":"zdrowie, dom, rodzina" } ] }Each record contains fields:
websitecatid - unique category id (char(2))
websitecatname - name or description of category(string)
{ "action": { "actionname":"listlanguages" } }Result:
{ "status":"OK", "action":"listlanguages", "result":[ { "languageid":0, "languagename":"polski" }, { "languageid":1, "languagename":"angielski" }, { "languageid":2, "languagename":"niemiecki" }, { "languageid":3, "languagename":"czeski" }, { "languageid":4, "languagename":"w\u0119gierski" }, { "languageid":5, "languagename":"s\u0142owacki" }, { "languageid":6, "languagename":"rumu\u0144ski" }, { "languageid":7, "languagename":"litewski" }, { "languageid":8, "languagename":"\u0142otewski" }, { "languageid":9, "languagename":"esto\u0144ski" }, { "languageid":10, "languagename":"hebrajski" } ] }Each record contains fields:
languageid - unique language id (integer)
languagename - name of language(string)
{ "action": { "actionname":"listvideo", "actionparams": { "itemid":"1316", "listall":"0|1" } } }Command arguments:
{ "status":"OK", "action":"listvideo", "result":[ { "id":"38623", "storage":"1316", "title":"Niewiarygodne zjawisko nad Polsk\u0105! Trwa\u0142o tylko 3 sekundy", "description":"\u017ar\u00f3d\u0142o: youtube.com", "tags":"terlik", "language":"0", "length":"32", "adddate":"1514357593", "adcat":"10", "category":"0", "sdfile":"https://cdn.onnetwork.tv/.............................", "orgfile":"https://cdn.onnetwork.tv/.............................", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.Fields listed below are available only for users with creators right to listed video:
sdfile - url to sd version of file, url is valid 3 hours from time of generation orgfile - url to original file (uploaded to platform), url is valid 3 hours from time of generation. Original file is available after migration from conversion servers to storage servers - it may take up to 24h from upload.
{ "action": { "actionname":"liststoragevideos", "actionparams": { "storageid":"1316" , "page":"1", "count":"10", "expublic":"0", "exvcm":"0", "exavail":"0", "sort":"0", "searchstring":"string to search", "searchfields":"7" } } }Command arguments:
{ "status":"OK", "action":"listvideo", "result":[ { "id":"38623", "storage":"1316", "title":"Niewiarygodne zjawisko nad Polsk\u0105! Trwa\u0142o tylko 3 sekundy", "description":"\u017ar\u00f3d\u0142o: youtube.com", "tags":"terlik", "language":"0", "length":"32", "adddate":"1514357593", "adcat":"10", "category":"0", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.
{ "action": { "actionname":"listwebsitevideos", "actionparams": { "websiteid":"1324" , "page":"1", "count":"10", "expublic":"0", "exvcm":"0", "exavail":"0", "sort":"0", "searchstring":"string to search", "searchfields":"7" } } }Command arguments:
{ "status":"OK", "action":"listwebsitevideos", "result":[ { "id":"38623", "storage":"1835", "title":"Niewiarygodne zjawisko nad Polsk\u0105! Trwa\u0142o tylko 3 sekundy", "description":"\u017ar\u00f3d\u0142o: youtube.com", "tags":"terlik", "language":"0", "length":"32", "adddate":"1514357593", "adcat":"10", "category":"0", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"31885", "storage":"1813", "title":"beskid niski", "description":"beskid niski", "tags":"beskid niski", "language":"0", "length":"108", "adddate":"1507124259", "adcat":"0", "category":"100", "vcm":"1", "vcm_start":"1507123680", "vcm_end":"1507728480", "vcm_income":"5.00", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"38425", "storage":"1795", "title":"Miejska Wigilia w Pu\u0142awach", "description":"", "tags":"", "language":"0", "length":"84", "adddate":"1513535943", "adcat":"10", "category":"0", "public":"1", "public_since":"1513535943", "public_fee":"1.20", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.
{ "action": { "actionname":"listvideos", "actionparams": { "page":"1", "count":"10", "expublic":"0", "exvcm":"0", "exavail":"0", "sort":"0", "searchstring":"string to search", "searchfields":"7", "listlang":"0,1" // list videos in polish and english only } } }Command arguments:
{ "status":"OK", "action":"listwebsitevideos", "result":[ { "id":"38623", "storage":"1835", "title":"Niewiarygodne zjawisko nad Polsk\u0105! Trwa\u0142o tylko 3 sekundy", "description":"\u017ar\u00f3d\u0142o: youtube.com", "tags":"terlik", "language":"0", "length":"32", "adddate":"1514357593", "adcat":"10", "category":"0", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"31885", "storage":"1813", "title":"beskid niski", "description":"beskid niski", "tags":"beskid niski", "language":"0", "length":"108", "adddate":"1507124259", "adcat":"0", "category":"100", "vcm":"1", "vcm_start":"1507123680", "vcm_end":"1507728480", "vcm_income":"5.00", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"38425", "storage":"1795", "title":"Miejska Wigilia w Pu\u0142awach", "description":"", "tags":"", "language":"0", "length":"84", "adddate":"1513535943", "adcat":"10", "category":"0", "public":"1", "public_since":"1513535943", "public_fee":"1.20", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.
{ "action": { "actionname":"listpartnervideos", "actionparams": { "page":"1", "count":"10", "sort":"0", "searchstring":"string to search", "searchfields":"7" } } }Command arguments:
{ "status":"OK", "action":"listpartnervideos", "result":[ { "id":"38623", "storage":"1835", "title":"Niewiarygodne zjawisko nad Polsk\u0105! Trwa\u0142o tylko 3 sekundy", "description":"\u017ar\u00f3d\u0142o: youtube.com", "tags":"terlik", "language":"0", "length":"32", "adddate":"1514357593", "adcat":"10", "category":"0", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"31885", "storage":"1813", "title":"beskid niski", "description":"beskid niski", "tags":"beskid niski", "language":"0", "length":"108", "adddate":"1507124259", "adcat":"0", "category":"100", "vcm":"1", "vcm_start":"1507123680", "vcm_end":"1507728480", "vcm_income":"5.00", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] }, { "id":"38425", "storage":"1795", "title":"Miejska Wigilia w Pu\u0142awach", "description":"", "tags":"", "language":"0", "length":"84", "adddate":"1513535943", "adcat":"10", "category":"0", "public":"1", "public_since":"1513535943", "public_fee":"1.20", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.An example:
$_Zmienne["apikey"] = $_ApiKEY; $_Zmienne["json" ] = '{ "action":{ "actionname":"listpartnervideos", "actionparams":{ "sort":"2" } } }' ; $tmpf = "/tmp/_".@md5(time()."_".@mt_rand(1,1000000).@mt_rand(1,1000000).@mt_rand(1,1000000).@mt_rand(1,1000000)).".dat"; $plik = @fopen($tmpf, "w"); $ch = @curl_init(); @curl_setopt($ch, CURLOPT_URL, "https://api.onnetwork.tv/apiwork.php"); @curl_setopt($ch, CURLOPT_TIMEOUT, 3600); @curl_setopt($ch, CURLOPT_HEADER, false); @curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); @curl_setopt($ch, CURLOPT_VERBOSE, false); @curl_setopt($ch, CURLOPT_FILE, $plik); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); @curl_setopt($ch, CURLOPT_POST, true); @curl_setopt($ch, CURLOPT_POSTFIELDS, $_Zmienne); @curl_exec($ch); $err = @curl_error($ch); @curl_close($ch); @fclose($plik); $result = @file_get_contents($tmpf); @unlink($tmpf); echo( json_encode( json_decode( $sendst , true ) , JSON_PRETTY_PRINT )); // print pretty output
{ "action": { "actionname":"listplaylists", "actionparams": { "websiteid":"123", "playlistid":"123", "listauto":"1" } } }Command arguments:
{ "status":"OK", "action":"listplaylists", "result":[ { "playlistid":"22", "website":"458", "name":"Praca i pieni\u0105dze", "comment":"", "tags":"", "defaultplaylist":"0", "sid":"N2QsMCxN", // KOD2 "items":[ { "id":"1813", "storage":"302", "title":"Jak si\u0119 zmienia polski rynek pracy? Wyniki Bilansu Kapita\u0142u Ludzkiego", "description":"", "tags":"", "language":"0", "length":"227", "adddate":"1449758877", "adcat":"10", "category":"10", "public":"1", "public_since":"0", "public_fee":"1.00", "sid":"N2QsVUQsTQ==" // KOD3 }, { "id":"1806", "storage":"302", "title":"Imigracja z Ukrainy szans\u0105 dla polskiej gospodarki", "description":"", "tags":"", "language":"0", "length":"216", "adddate":"1449755165", "adcat":"10", "category":"10", "public":"1", "public_since":"0", "public_fee":"1.00", "sid":"N2QsVTYsTQ==" // KOD3 } ] } ] }Result fields:
playlistid - unique playlist id (integer) website - uniquer website id (integer) where playlist belongs to name - playlist name comment - playlist comment tags - playlist tags defaultplaylist - contains "1" if this playlist id default playlist. sid - short code for embed playlist without starting video items - array of videos in playlist in order set by user using onnetwork platform (see "listVideo" for fields desriptions).
CAUTION!!! "sid" fields in array "items" contains short codes for embeding playlist WITH STARTING VIDEO.
{ "action": { "actionname":"getmidcode", "actionparams": { "websiteid":"123", "playlistid":"123", "itemid":"123" "midparams":{ "size":"16x9", "autoplay":"0", "volume":"20", "volumem":"50", "showtitle":"3", "naa":"0", "pinv":"1", "pls":"0" } } } }Command arguments:
{ "status":"OK", "action":"getmidcode", "result":{ "mid":"Mzk0OTEsNHgzLDEsMjAsMCwxMzI0LDEsMCwzLDUwLDAsMCwwLDAsMCwwLDAsMSww" } }Result field:
mid - full code to use as "mid" parameter for embed code.Remarks on full code construction: If not all player options are given for missing options default values from website or playlist (if given by playlistid) default setting are taken.
{ "action": { "actionname":"listvideostats", "actionparams": { "year":"2018", "month":"2", "videoid":"123", "storageid":"123", "websites":"0", "devices":"0", "ademission":"0", "group":"0" } } }Command arguments:
{ "status":"OK", "action":"listvideostats", "result":{ {"started":"49448420","first_quartile":"41387011","midpoint":"36990919","third_quartile":"33890526","finished":"27907174"} } }or
{ "status":"OK", "action":"listvideostats", "result":{ {"day":"31","started":"918545","first_quartile":"756465","midpoint":"674917","third_quartile":"615588","finished":"477359"}, {"day":"30","started":"1129033","first_quartile":"932983","midpoint":"834588","third_quartile":"763842","finished":"603729"}, ... } }or
{ "status":"OK", "action":"listvideostats", "result":{ {"day":"31","hour":"23","started":"29124","first_quartile":"24287","midpoint":"22037","third_quartile":"20452","finished":"15503"}, {"day":"31","hour":"22","started":"35584","first_quartile":"29028","midpoint":"26076","third_quartile":"23956","finished":"17735"}, ... } }Report contains data for all selected month.
day - hour - started - number of videos starts first_quartile - number of videos played at least 25% midpoint - number of videos played at least 50% third_quartile - number of videos played at least 75% finished - number of videos played till end.
{ "action":{ "actionname":"listadstats", "actionparams":{"year":2019,"month":4,"day":14} } }Command arguments:
{ "status":"OK", "action":"listadstats", "result":{ {"country":"1","partner":"2488","website":"4655","adprovider":"1064","mobile":"1","started":6,"first":5,"mid":5,"third":5,"finished":5,"click":0,"viewa":4} ..... } }Result record fields:
country - partners country as integer, partner - unique partners id as integer, partners can be listed using listPartners command , website - unique website id as integer, websites can be listed using listWebsites command , adprovider - unique ad provider id, ad providers can be listed using listAdProviders command , mobile - "0" means desktop traffic, value other than 0 means mobile traffic. For now it is always 1 for mobile but use rather !=0 comparision because we plan to differ smartphone and tablet traffic in future.
started - number of ads started, first - number of ads played with at least 25% of length, mid - number of ads played with at least 50% of length, third - number of ads played with at least 75% of length, finished - number of ads completed, click - number of ads with registered clicks, viewa - number of ads "viewable" according to IAB video meetrics (at least 50% of ad pixels continously viewable for user for at least 2 seconds during playback).
https://upload.onnetwork.tv/apiup.phpArgument json:
{ "action": { "actionname":"uploadvideo", "actionparams": { "storageid": "2733", "title": "Nagranie z legendii", "description": "Opis do nagrania z legendii", "tags": "Wesołe Miasteczko,Legendia" , "movielink": "https://www.of.pl/", "lang": 0, // if not set - storage language "public": 0, "public_since": 0, "public_fee": 0, "pubcat": 0, "adcat": 10, "ageallow": "0", "geoallow": "pl,cz,sk" } } }This command requires to send POST variable of type "file" with name "fileToUpload".
{ "status":"OK", "action":"uploadvideo", "result":{ {"videoid":"123456"} } }Video is available after conversion and it should be checked before use with listvideo command.
$_ApiKEY = "API key for user"; unset($_Zmienne); $_Zmienne["apikey"] = $_ApiKEY; $_Zmienne["json"] = json_encode( array( "action" => array( "actionname" => "uploadVideo" , "actionparams" => array( "storageid" => "2733" , "title" => "Tytuł materiału", "description" => "Opis materiału", "tags" => "tagi,rozdzielone,przecinkami" , "movielink" => "https://www.of.pl/", "lang" => 0, "public" => 0, "public_since" => 0, "public_fee" => 0, "pubcat" => 21, "adcat" => 10, "ageallow" => 6, "geoallow" => "pl,cz,sk" ) ) ) ); $_Zmienne["fileToUpload"] = new CurlFile($fileName); $tmpf = "/tmp/log_file_name"; $plik = @fopen($tmpf, "w"); $ch = @curl_init(); @curl_setopt($ch, CURLOPT_URL, "https://upload.onnetwork.tv/apiup.php"); @curl_setopt($ch, CURLOPT_TIMEOUT, 3600); // timeout depends on file size @curl_setopt($ch, CURLOPT_HEADER, false); @curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); @curl_setopt($ch, CURLOPT_VERBOSE, false); @curl_setopt($ch, CURLOPT_FILE, $plik); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); @curl_setopt($ch, CURLOPT_POST, true); @curl_setopt($ch, CURLOPT_POSTFIELDS, $_Zmienne); @curl_exec($ch); $err = @curl_error($ch); @curl_close($ch); @fclose($plik); $result = @file_get_contents($tmpf); @unlink($tmpf);
https://upload.onnetwork.tv/apiup.phpArgument json:
{ "action": { "actionname":"uploadposter", "actionparams": { "videoid": "274721", "posternum": 1, "setdefault": 1 } } }This command requires to send POST variable of type "file" with name "fileToUpload".
{ "status":"OK", "action":"uploadposter", "result":{ {"videoid":"274721", "posternum":1, "setdefault":1, "size":32126 } // size of uploaded file - can be used to control operation success. } }
$_ApiKEY = "API key for user"; unset($_Zmienne); $_Zmienne["apikey"] = $_ApiKEY; $_Zmienne["json"] = json_encode( array( "action" => array( "actionname" => "uploadposter" , "actionparams" => array( "videoid" => "274721" , "posternum" => "1", "setdefault" => "1" ) ) ) ); $_Zmienne["fileToUpload"] = new CurlFile($fileName); // $fileName contains file path and name $tmpf = "/tmp/nazwa_pliku_z_rezultatem"; $plik = @fopen($tmpf, "w"); $ch = @curl_init(); @curl_setopt($ch, CURLOPT_URL, "https://upload.onnetwork.tv/apiup.php"); @curl_setopt($ch, CURLOPT_TIMEOUT, 3600); @curl_setopt($ch, CURLOPT_HEADER, false); @curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); @curl_setopt($ch, CURLOPT_VERBOSE, false); @curl_setopt($ch, CURLOPT_FILE, $plik); @curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); @curl_setopt($ch, CURLOPT_POST, true); @curl_setopt($ch, CURLOPT_POSTFIELDS, $_Zmienne); @curl_exec($ch); $err = @curl_error($ch); @curl_close($ch); @fclose($plik); $result = @file_get_contents($tmpf); @unlink($tmpf);
{ "action": { "actionname":"listpartners" } }Results:
{ "status":"OK", "action":"listpartners", "result":[ { "id":1234, "name":"partner name" }, .... ] }Every record consist of:
id - partners unique id
name - partners name.
{ "action": { "actionname":"listadproviders" } }Results:
{ "status":"OK", "action":"listadproviders", "result":[ { "id":1234, "name":"provider name" }, .... ] }Every record consists of:
id - ad provider unique id
name - ad provider name.
{ "action": { "actionname":"updatevideo", "actionparams": { "itemid" : 1316 , // ID of video "title": "Nagranie z legendii", "description": "Opis do nagrania z legendii", "tags": "Wesołe Miasteczko,Legendia" , "author": "author of video", "lang": 0, "public": 0, "public_since": 0, "public_fee": 0, "category": 0, "adcat": 10 } }Only fields to modify should be present in arguments. If You pass as argument field without value it will be set to empty or default value.
{ "action": { "actionname":"removevideo", "actionparams": { "itemid":"1316" // id of material } } }The only argument is an ID of material to remove. Material is not removed at once - it is only marked as "to remove". Since marking material as "to remove" it is not availble to delivery.
{ "action": { "actionname":"addspeech", "actionparams": { "storageid": "2733", "title": "Ogniem i mieczem", "description": "Część pierwsza. Czyta lektor", "tags": "Ogniem i mieczem, lektor" , "speech_text" : "Rok 1647 był to dziwny rok, w którym rozmaite znaki na niebie i ziemi zwiastowały jakoweś klęski i nadzwyczajne zdarzenia.", "lang": 0, // if not set - storage language "voice": "pl-PL-Wavenet-D" , "public": 0, "public_since": 0, "public_fee": 0, "pubcat": 0, "adcat": 10, "geoallow": "pl,cz,sk" } } }
{ "status":"OK", "action":"addspeech", "result":[ { "id":"38623", "storage":"2733", "title":"Ogniem i mieczem", "description":"Część pierwsza. Czyta lektor", "tags":"Ogniem i mieczem, lektor", "language":"0", "length":"0", "adddate":"1514357593", "adcat":"10", "category":"0", "webcodes":[ { "website":"1324", "sid":"TTQsQWt0LDA=" // KOD1 }, { "website":"2118", "sid":"YUksQWt0LDA=" // KOD1 }, { "website":"14", "sid":"RSxBa3QsMA==" // KOD1 } ] } ]}Result fields for all videos:
id - unique video id (integer) storage - id of storage where video is located (integer) title - title of the video description - description of the video tags - tags of the video language - language of the video (integer - see "listLanguages") length - length of the video, seconds (integer) adddate - date and time when the video was added (unix timestamp - integer) adcat - advertisement category of the video (integer - see "listAdCats") category - general category of the video (integer - see "listVideoCategories") webcodes - array of websites which can use this video material containing field "sid" - embed parameter for this video and website.Additional fields for public videos:
public - this fields contains "1" if this is public video public_since - since this date and time this video can be used by publisher on its websites. There is no possibility to play this video on publishers website (except owner of video) before this date. public_fee - rate which publisher has to pay for using this video on its website (float, changed to publishers currency according to current bank exchange rate). This is rate for 1000 starts of video with advertisements played before. Publisher does not pay for video impressions without advertisement played before.Material is available for playback after about 2 minutes from adding. You should check if it is available using listvideo command. Result of addSpeech alwayd returns length=0. Value of length is changed during conversion and should be more than 0.
{ "action": { "actionname":"listvoices" } }Result:
{ "status":"OK", "action":"listvoices", "result":[ { "name":"ar-XA-Wavenet-A", "gender":"FEMALE", "lang":"ar-XA" }, .... ] }Every record contains:
name - name of voice,
gender - voice gender,
lang - language.