Results for:

Suppor Center

Basics

Api home

HOW APIS WORK

HOW APIS WORK

All the requests to our web services are in HTTPS (Secure HTTP). Every request needs a Authentication token (or API Key), that is a unique code assigned to every API enabled Stream Service .

The requests must be executed in POST via HTTP protocol specifying the content/type of the request sent:

text/xml

application/json

Web Services are normally available in port 443.

It's really important that all the requests are done from your server by using PHP, ASP, ASP.NET, etc.., and never through a published application (such as Flash Objects, Javascripts), because the requests can expose your token to the users even with the use of HTTPS protocol.

CALL SAMPLE

CALL SAMPLE

Here we show a request sample to get the currently on air video delivered into a playlist loop at the time of the request.

This sample use an XML based request sent through HTTP POST protocol to the specified URL; content-type must be specified to let the message to be correctly understood by the webservice.

All the commands available are described in the others help pages.

Request

Post:
<?xml version="1.0" encoding="utf-8" ?>
    <GetPlaylistLoopVideoOnAir>
        <token>MY_API_KEY</token>
        <playlistLoopContentId>Gb2xm12f</playlistLoopContentId>
    </GetPlaylistLoopVideoOnAir
                
{
    "token": "MY_API_KEY"
    "playlistLoopContentId": "Gb2xm12f"
}
                
Web Service replies with the current published video.

Response

<VodContentDTO xmlns="http://schemas.datacontract.org/2004/07/Mainsoft.Streaming.Sdk._13.model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <categoryDescription i:nil="true"/>
    <contentId>dk2lsod</contentId>
    <duration>PT27m120S</duration>
    <filename>filename.mp4</filename>
    <idCategory>555</idCategory>
    <longDescription i:nil="true"/>
    <referenceID i:nil="true"/>
    <relatedLinkText i:nil="true"/>
    <relatedLinkURL i:nil="true"/>
    <shortDescription i:nil="true"/>
    <tags i:nil="true"/>
    <title>Video Title</title
</VodContentDTO>
                
{
    "categoryDescription": "Category 1",
    "contentId": "dk2lsod",
    "duration": "PT27m120S",
    "filename": "filename.mp4",
    "idCategory": "555",
    "longDescription": "long description",
    "ShortDescription":"short description 1",
    "referenceID": null,
    "relatedLinkText": null,
    "relatedLinkURL": null,
    "tags": "tag1;tag2;tag3",
    "title":Video Title
},
                        

Call sample - Javascript / Jquery / XML

Call sample - Javascript / Jquery / XML

The following code have to be used only for testing purposes. It's strongly discouraged to publish API Key through Javascript.
<script type="text/javascript">
    var xml_string = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    xml_string += "<GetPlaylistLoopVideoOnAir>";
    xml_string += "<token>MY_API_KEY</token>";
    xml_string += "<playlistLoopContentId>MY_PLAYLIST_LOOP_CONTENT_ID</playlistLoopContentId>";
    xml_string += "</GetPlaylistLoopVideoOnAir>";
    $.ajax({
        type: 'POST',
        contentType: 'text/xml',
        dataType: 'xml',
        url: 'https://video.mainstreaming.tv/Sdk/13/WCFMSApi.svc/xml/GetPlaylistLoopVideoOnAir',
        data: xml_string
    }).done(function (msg) {
        alert("Data Saved: " + msg);
    });
</script>
                
keyboard_arrow_up