Token

Content playback may require a digitally signed playback URL. Use the following endpoint to validate a signature against the playback URL.

/token/checkurl

Verifies a playback URL with an auth token, similar to the token tester in the CMS UI. This API is for testing only and not for use in a production environment.

Request Parameter

Type

Description

url

string

The full playback URL, with an authorization token as a query string.

 

Response Parameter

Type

Description

notes

list

A list of objects detailing the analysis of the URL. Each object contains a msg and type member. The msg is a human-readable description of the note, and the type is one of 'ok', 'error', 'warning', 'info', 'question'.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/token/checkurl', url='https://content.uplynk.com/channel/0933d7856fc54e759032c3296dc4613e.m3u8?iph=12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0&oid=a735c56ea4014685bc74c0a375236cc5&cid=0933d7856fc54e759032c3296dc4613e&exp=1365781908&ct=c&sig=839c2a1dbfcba933b11456fa2bf9d3e4f69919b5802827115f3ed562e116c923'))

{
    "notes": [
        {
            "msg": "Valid hostname found",
            "type": "ok"
        },
        {
            "msg": "M3U8 format (standard URL)",
            "type": "info"
        },
        {
            "msg": "URL type: Channel by ID",
            "type": "info"
        },
        {
            "msg": "The channel does exist",
            "type": "ok"
        },
        {
            "msg": "Query string found",
            "type": "ok"
        },
        {
            "msg": "Content type is correct ('c')",
            "type": "ok"
        },
        {
            "msg": "Token signature is valid",
            "type": "ok"
        },
        {
            "msg": "Token has not yet expired (2592000 seconds left)",
            "type": "ok"
        },
        {
            "msg": "URL content ID and token content ID match",
            "type": "ok"
        },
        {
            "msg": "IP address hash matches",
            "type": "ok"
        },
        {
            "msg": "No ads will be inserted during playback",
            "type": "info"
        }
    ],
    "error": 0
}

As noted, this API is intended for use during the development or testing phase of a project, and not for use in a production environment. An example of an appropriate use of this API would be as part of a regression test suite. An example of an inappropriate use of this API would be calling it each time your system generates an auth token in a deployed website. If you are unsure if whether or not your use case is appropriate, contact our support. Inappropriate use of this API can lead to additional charges in your account and/or account termination.