Results for:

Suppor Center

Security API

Security API

Create Session

Create Session

The method CreateSession has two functions: you can use it for protection of the content delivery, or if you want to create your own player by using Flash or HTML5

By calling this method you ask to the server to generate an authentication password that is valid for 24 hours.


<?xml version="1.0" encoding="utf-8" ?>
    "token": "MY_API_KEY",
    "title": "title",
    "description": "description",
    "note": "Notes",
    "utcStartDate": "Start date",
    "utcEndDate": "End date"
The call must have API key, contentID of the content you want to create the session and even the user agent and client IP Adress that is trying to watch the video (the user of your site), in order to track views and get true statistics.


token Specify your MainStreaming API KEY
contentId Specify the contentID of the content you want to delivery.
userAgent UserAgent of the client that is requesting the content (you have to specify it, for a true statistic tracking)
userHostAddress IP Address of the client that is requesting the content (you have to specify it, for a true statistic tracking)


<SessionStruct xmlns="" xmlns:i="">
    "contentId": "MY_CONTENT_ID",
    "cupertinoHLSUrl": "IOS_ADAPTIVE_URL",
    "rtmpSmil": "RTMP_ADAPTIVE_SMIL_URL",
    "sessionId": "SESSION_ID",

The response give to you four values:

SessionId is the value to be used to protect the content. With this value you can embed your content using this URL: http(s)://

In this way the client can watch the content through a session code, valid for a limited time. All the session have a duration of 24 hours. In the next version of the API will be available the possibilty to customize the duration of the session.

The IFRAME embedding procedure is the same and all parameters are valid.

With cupertinoHLSUrl, rtmpSmil and sanJoseHTTPUrl you can create a custom player in Flash or HTML5.

Session ID can be used as a access password and is secure enough because limits the session to a 24 hours duration. It's important to not distribute the ContentID because the creation of the session is not more valid to protect your content.

The video is visible by any IP Address, even if you specify the IP Address of the user on the request parameters. The field is used only for statistic purposes. There isn't an IP blocking system because there are a lot of devices that have more than one internet connection (ethernet/wifi/3g/4g) and can appear with different IP address even after the create session request.