NAV Navbar
JavaScript
  • Introduction
  • User
  • Mixed content
  • Video based
  • Video Chapter
  • Collection Feed
  • Collection video category
  • Collection livestream category
  • Category
  • Video tag
  • Video feed
  • Heartbeat endpoint
  • Livestream
  • Default livestream values
  • Livestream tag
  • Livestream Chapter
  • Livestream feed
  • Video based
  • Packages
  • Channel based
  • Activate coupon
  • Campaign
  • Campaign video
  • Search
  • Statistics
  • Geo restrictions
  • Admin for channels and collections
  • Errors
  • Currencies
  • Glossary
  • Geo-data
  • Introduction

    Welcome to StayLives public API documentation! You can use our API to access StayLives API endpoints, which can get information on various livestreams, videos, and channels in our database.

    We have language bindings in JavaScript with more on the way! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    If you want to test API-calls, use the following link as the API-point: https://dev.api.staylive.tv

    User

    Register a new user

    This endpoint registers a new user. You need a unique email to register.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Email A valid email-address String Yes
    firstname The users first name, minimum 2 letters max 40 String Yes
    lastname The users last name, minimum 2 letters max 40 String Yes
    Password The users selected password, minimum 6 letters String Yes

    The expected format of data looks like this:

      const register = {email: 'test@emails.se', firstname: 'Chris', lastname: 'Developer', password: 'Abc!23'}
    

    Response to a properly made request

    {
        "message": [
            {
                "firstname": "Chris",
                "lastname": "Developer",
                "email": "test@emails.se"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response returns the data that was used to create the account.

    This endpoint registers users.

    HTTP Request

    POST https://api.staylive.tv/user/register

    Login a user

    This endpoint logs in the user.

    The expected format of data looks like this:

      const user = {email: 'real@gmail.com', password: 'm0stS3cureP4ssw0rd!'}
    

    Fill in with your already registered user details. The above command returns JSON structured like this:

    {
        "message": "eyJhbGciOi467IUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZW1hfgjfh29tZGRmcyIsImlkIjoxMDMsInRpbWVzdGFtcCI6MTUyMDQwNzcxMjMzMiwiZGV2aWNlIjoiT3RoZXIiLCJpYXQiOjE1MjA0MDc3MTJ9.dNoEYgecu9JnA0VBP22NjxW5954W3szDLh72hXjyGdfhA",
        "statuscode": 200,
        "success": true
    }
    

    HTTP Request

    POST https://api.staylive.tv/user/login

    Reset password

    This endpoint resets a users password.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Email A valid email-address String Yes

    The expected format of data looks like this:

      const register = {email: 'test@emails.se'}
    

    Response to a properly made request

    {
        "message": "Reset link has been sent to the given email",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response returns a confirmation regarding the password being reset.

    This endpoint resets passwords.

    HTTP Request

    POST https://api.staylive.tv/user/forgotpassword

    Get user data

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    This endpoint gets the basic information from a users registered data.

    Response to a request made by a user with a valid login

    {
        "message": [
            {
                "firstname": "Chris",
                "lastname": "Developer",
                "email": "test@emails.se"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the data returned is basic user information, supplied by the user when creating the account.

    This endpoint returns basic user data.

    HTTP Request

    GET https://api.staylive.tv/user

    Update user data

    This endpoint updates user data.

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Email A valid email-address String No
    Firstname The users first name, minimum 2 letters max 40 String No
    Lastname The users last name, minimum 2 letters max 40 String No
    old_password The users selected old password to confirm a password change, minimum 6 letters String No
    new_Password The users new password, minimum 6 letters String No

    The expected format of data looks like this:

      const register = { firstname: 'Changed name' }
    

    Response to a properly made request

    {
        "message": [
            {
                "firstname": "Changed name",
                "lastname": "Developer",
                "email": "test@emails.se"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response returns the updated data.

    This endpoint updates user data.

    HTTP Request

    PUT https://api.staylive.tv/user

    Get user data

    This endpoint deletes a user

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    Response to a request made by a user with a valid token

    {
        "message": "User deleted.",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response, its a confirmation that the user has been deleted.

    This endpoint deletes a user

    HTTP Request

    DELETE https://api.staylive.tv/user

    Get all receipts

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    This endpoint returns all of the receipt a user owns.

    Response to a request made by a user with a valid login

    {
        "message": {
            "stream": [
                {
                    "id": 1,
                    "user": 103,
                    "stream": 3,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "21",
                    "created_at": "2018-08-24T07:39:03.000Z"
                },
                {
                    "id": 2,
                    "user": 103,
                    "stream": 2,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "22",
                    "created_at": "2018-08-24T07:39:03.000Z"
                },
                {
                    "id": 3,
                    "user": 103,
                    "stream": 1,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "23",
                    "created_at": "2018-08-24T07:39:03.000Z"
                }
            ],
            "video": [
                {
                    "id": 1,
                    "user": 103,
                    "video": 3,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "21",
                    "created_at": "2018-08-24T07:39:03.000Z"
                },
                {
                    "id": 2,
                    "user": 103,
                    "video": 2,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "22",
                    "created_at": "2018-08-24T07:39:03.000Z"
                },
                {
                    "id": 3,
                    "user": 103,
                    "video": 1,
                    "city": "Stockholm",
                    "payment": "paypal",
                    "price": 99,
                    "fee": 1,
                    "refunded": 0,
                    "deleted": 0,
                    "stats": 1,
                    "txn": "23",
                    "created_at": "2018-08-24T07:39:03.000Z"
                }
            ],
            "package": []
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to be all receipts, including: Livestream, video and package receipts.

    This endpoint returns all the receipts a user owns.

    HTTP Request

    URL Parameters

    GET https://api.staylive.tv/user/receipts

    Refunds

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    This route makes it possible for users to request a refund on a specific purchase. You can request refunds on: packages, livestream or videos.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Reason The reason a refund is requested String Yes

    The expected format of data looks like this:

      const refund = {reason: 'The livestream kept crashing'}
    

    Response to a request made by a user with a valid login

    {
        "message": "Request for refund has been added",
        "statuscode": 200,
        "success": true,
        "data": [
            5
        ]
    }
    

    Returns

    The return data is going to be a confirmation on the refund request.

    This endpoint requests a refund on the users behalf.

    HTTP Request

    POST https://api.staylive.tv/user/refund/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    Type The type of object a refund is requested on, can be "Livestream", "video", "package"
    ID The ID of object to request a refund on

    Get channel connection overview

    This endpoint returns all of the channels a user is connected to as an owner, company, statistician or any other above normal user levels.

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    Response to a request made with a valid header and special access to channels

    {
        "message": {
            "collections": [
                {
                    "name": "Stockholms klubben",
                    "id": 1,
                    "account_level": "0"
                }
            ],
            "channels": [
                {
                    "id": 2,
                    "name": "Årsta pojkarna",
                    "tickets": 0,
                    "storage": 0,
                    "ticket_cost": 0,
                    "storage_cost": "0",
                    "transaction_fee": 0,
                    "taxes": "0",
                    "allow_ads": 0,
                    "button_color": "0",
                    "primary_color": "0",
                    "text_color": "0",
                    "hide_profile_image": 0,
                    "google_analytics": "0",
                    "expose": 0,
                    "published": 0,
                    "focus": "0",
                    "path": "arsta",
                    "about": "0",
                    "website": "0",
                    "revenue": 0,
                    "deleted": 0,
                    "created_at": "2018-08-24T07:39:02.000Z",
                    "account_level": "0"
                },
                {
                    "id": 4,
                    "name": "Brandbergen boys",
                    "tickets": 0,
                    "storage": 0,
                    "ticket_cost": 0,
                    "storage_cost": "0",
                    "transaction_fee": 0,
                    "taxes": "0",
                    "allow_ads": 0,
                    "button_color": "0",
                    "primary_color": "0",
                    "text_color": "0",
                    "hide_profile_image": 0,
                    "google_analytics": "0",
                    "expose": 0,
                    "published": 0,
                    "focus": "0",
                    "path": "brand",
                    "about": "0",
                    "website": "0",
                    "revenue": 0,
                    "deleted": 0,
                    "created_at": "2018-08-24T07:39:02.000Z",
                    "account_level": "0"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes a lot of information regarding the channels that the user has high access to.

    This endpoint returns channel data from channels the user is connected to.

    HTTP Request

    GET https://api.staylive.tv/user/channels

    Mixed content

    Get a Mixed tag

    A tag can contain videos and livestreams from several channels. The tag also contains videos, to see how to access videos please see the videos tag header. If you want to find out how to get all videos from a specific tag, please see the video tags header. If you want to get all livestreams from a specific tag, please see the livestream tags header.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
        "message": {
          "Video": [
              {
                  "name": "New original video"
              },
              {
                  "name": "Old original video"
              }
        ],
        "Livestream": [
            {
                "name": "New original livestream"
            },
            {
                "name": "Old original livestream"
            }
        ],
        "statuscode": 200,
        "success": true
      }
    }
    

    Returns

    When the request gets a response the response includes the livestreams and videos that are tagged with the requested tag.

    This endpoint retrieves a tag and all livestreams and videos with the tag.

    HTTP Request

    GET https://api.staylive.tv/mixed/tags/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tag to retrieve livestreams and videos from.

    Video based

    Post a video to a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required Keys
    Name The name of the video String Yes None
    Price The price of the video Integer No None
    Description The description of the video String No None
    Publish_date The date that the video will go live and be viewable for normal users Date No None
    Subscriptions Subscription ID's that the video is connected to. Separated with commas String No None
    Tags Tag-names separated with commas, that will be connected to the video String No None
    Categories Category ID's that will be connected to the video. Separated with commas. String No None
    Video The video file File No None
    Thumbnail The thumbnail file File No None
    Geo_restriction If the video should be tied to a blacklist/whitelist of countries Integer No None
    special_prices An array with objects in it for prices in different countries Array No [{ country, currency, price }]
    translations An array with objects in it for translations in different countries Array No [{ language, description, name }]
    Currency The currency the video will accept as payment, defaults to SEK String No None
    Draft If the video will be set as a draft and not published, defaults to not a draft Boolean No None
    Ads If the video will have ads enabled or not Boolean No None

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The files accepted for the video file are as follows: mp4, mov and flv. Thumbnail files are only accepted in the formats: jpg/jpeg, png and gif.

    The tag names are separated by a comma, the tag names can be already existing tags or non-existing tags, that will be created. Categories will require an existing category's ID to connect it to the video. If you submit a PUT/POST request with a category that you do not have access to, the connection will not be made, but the PUT/POST request will go through. Subscriptions can be tied to an entire channel, or just specific videos depending on the end goal. Via the PUT of videos or POST of videos, you can create/update a video and directly connect it to a subscription.

    A draft will not show up in GET, feed or be purchasable. It makes it possible to start a draft of a video but not necessarily finish and publish it until a later date.

    The currency attribute decides what currency to accept payments in. To see the available currencies see "currency".

    If a video is set as "subscribers_only", it means that the video can only be accessed through an active subscription. The video can not be bought separately or obtained through any other way than a valid subscription that includes the video. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the video.

    For videos that may have an international audience, you have the option to include translations, geo-restrictions and special prices. Translations change the name and description of the video for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    To whitelist or blacklist countries, you first need to create a list of countries to black/white-list. During the creation of a video you can supply the ID of the list to geo_restriction, and that video is black/white-listed in those countries.

    Geo-restrictions and special prices are based on IP addresses. Geo restriction blocks access to certain videos and special prices change the video price. If no geo restriction, special price or translation is found, the default values are used.

    The expected format of data looks like this:

      const video = {
        "name": "Hammarby vs AIK", "description": "A classic matchup in football", "price": 200, "video": "videofile.mp4", "categories": "1, 2, 3, 4", "tags": "Allsvenskan, fotboll, Stockholm", "translations": [{ "language": "se", "name": "Hammarby mot AIK", "description": "En klassisk match i fotboll" }, { "language": "es", "name": "Hammarby vs AIK", "description": "el clásico" }], "special_prices": [{ "currency": "eur", "country": "es", "price": 12 }]
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 12,
            "geo_restriction": null,
            "subscribers_only": 0,
            "ads": 0,
            "campaign": 0,
            "publish_date": null,
            "currency": "SEK",
            "name": "Hammarby vs AIK",
            "channel": 2,
            "channelPath": "arsta",
            "channelName": "Årsta pojkarna",
            "price": 200,
            "description": "A classic matchup in football",
            "duration": "0",
            "created_at": "2019-08-21T08:15:06.000Z",
            "private": 0,
            "url_string": "url",
            "location": 4,
            "verified": 0,
            "draft": 0,
            "converted": 0,
            "size": 0,
            "source_is_created": 0,
            "updated_at": null,
            "playback_url": "playback_url",
            "special_prices": [
                {
                    "currency": "eur",
                    "price": 12,
                    "country": "es"
                }
            ],
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "download_url": "download_url",
            "uploaded_by": "Christoffer Owner",
            "origin": null,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://video-cache-sto-01.staylive.se/gmulla/thumbnail.jpg",
            "categories": [
                {
                    "id": 1,
                    "name": "test Category"
                },
                {
                    "id": 2,
                    "name": "generic category"
                },
                {
                    "id": 4,
                    "name": "category with children"
                }
            ],
            "tags": [],
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ],
            "translations": [
                {
                    "name": "Hammarby vs AIK",
                    "description": "el clásico",
                    "language": "es",
                    "created_by": 103
                },
                {
                    "name": "Hammarby mot AIK",
                    "description": "En klassisk match i fotboll",
                    "language": "se",
                    "created_by": 103
                }
            ],
            "signedUrl": {
                "signerUrl": "url",
            }
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the video route.

    This endpoint posts a video to the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/videos/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the video on

    Update video data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the video String No
    Price The price of the video Integer No
    Description The description of the video String No
    Publish_date The date that the video will go live and be viewable for normal users Date No
    Subscriptions Subscription ID's that the video is connected to. Separated with commas String No
    Tags Tag-names separated with commas, that will be connected to the video String No
    Categories Category ID's that will be connected to the video. Separated with commas. String No
    Video The video file File No
    Thumbnail The thumbnail file File No
    Geo_restriction If the video should be tied to a blacklist/whitelist of countries Integer No
    special_prices An array with objects in it for prices in different countries Array No
    translations An array with objects in it for translations in different countries Array No
    Currency The currency the video will accept as payment, defaults to SEK String No
    Draft If the video will be set as a draft and not published, defaults to not a draft Boolean No
    Ads If the video will have ads enabled or not Boolean No

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The tag names are separated by a comma, the tag names can be already existing tags or non-existing tags, that will be created. To remove tag connections, submit a PUT request without that tag.

    The category ID's are separated by a comma, only categories owned by the channel will be added.

    Subscriptions can be tied to an entire channel, or just specific videos depending on the end goal. Via the PUT of videos or POST of videos, you can create/update a video and directly connect it to a subscription.

    The request will automatically remove all tag-, category- and subscription connections and add the connections that is included in the request.

    A draft will not show up in GET, feed or be purchasable. It makes it possible to start a draft of a video but not necessarily finish and publish it until a later date.

    The currency attribute decides what currency to accept payments in. To see the available currencies see "currency".

    If a video is set as "subscribers_only", it means that the video can only be accessed through an active subscription. The video can not be bought separately or obtained through any other way than a valid subscription that includes the video. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    For videos that may have an international audience, you have the option to include translations, geo-restrictions and special prices. Translations change the name and description of the video for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the video.

    Geo-restrictions and special prices are based on IP addresses. Geo restriction blocks access to certain videos and special prices change the video price. If no geo restriction, special price or translation is found, the default values are used.

    To whitelist or blacklist countries, you first need to create a list of countries to black/white-list. During the creation of a video you can supply the ID of the list to geo_restriction, and that video is black/white-listed in those countries.

    To reset the translations and special prices, you submit their respective keys as empty arrays. Works the same way as tag removal, where you need to include all of the translations and special prices in order for it to included for the video.

    The expected format of data looks like this:

      const video = {name: 'New original video', description: 'The best matchup in football', price: 0}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 12,
            "geo_restriction": null,
            "subscribers_only": 0,
            "ads": 0,
            "campaign": 0,
            "publish_date": null,
            "currency": "SEK",
            "name": "New original video",
            "channel": 2,
            "channelPath": "arsta",
            "channelName": "Årsta pojkarna",
            "price": 0,
            "description": "The best matchup in football",
            "duration": "0",
            "created_at": "2019-08-21T08:15:06.000Z",
            "private": 0,
            "url_string": "gmulla.mp4",
            "location": 4,
            "verified": 0,
            "draft": 0,
            "converted": 0,
            "size": 0,
            "source_is_created": 0,
            "updated_at": null,
            "playback_url": "playback_url",
            "special_prices": [
                {
                    "currency": "eur",
                    "price": 12,
                    "country": "es"
                }
            ],
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "download_url": "download_url",
            "uploaded_by": "Christoffer Owner",
            "origin": null,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://video-cache-sto-01.staylive.se/gmulla/thumbnail.jpg",
            "categories": [
                {
                    "id": 1,
                    "name": "test Category"
                },
                {
                    "id": 2,
                    "name": "generic category"
                },
                {
                    "id": 4,
                    "name": "category with children"
                }
            ],
            "tags": [],
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ],
            "signedUrl": {
                "signedRequest": null,
                "url": null
            }
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the video route.

    This endpoint updates a video.

    HTTP Request

    PUT https://api.staylive.tv/videos/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to update

    Get a specific video

    If a video is set as "subscribers_only", it means that the video can only be accessed through an active subscription. The video can not be bought separately or obtained through any other way than a valid subscription that includes the video. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    A video can have a "special price", where the price is changed depending on the country the video is requested from. A Swedish user can have a different price compared to someone in Finland etc. The video can be set to have different currencies and price depending on country. Translations are also possible, depending on the language that has been set for the user. If a Swedish user accesses something that has a Swedish translation, the user will see the Swedish name and description. If no special price, restriction or translation has been set for the video, the default values are shown.

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, statistics, company and statistics

    Response to a request made with no header

    {
        "message": {
            "id": 12,
            "geo_restriction": null,
            "subscribers_only": 0,
            "ads": 0,
            "campaign": 0,
            "publish_date": null,
            "currency": "SEK",
            "name": "New original video",
            "channel": 2,
            "channelPath": "arsta",
            "channelName": "Årsta pojkarna",
            "price": 0,
            "description": "The best matchup in football",
            "duration": "0",
            "created_at": "2019-08-21T08:15:06.000Z",
            "private": 0,
            "url_string": "url_string",
            "location": 4,
            "verified": 0,
            "playback_url": "playback_url",
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "origin": null,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://video-cache-sto-01.staylive.se/gmulla/thumbnail.jpg",
            "categories": [
                {
                    "id": 1,
                    "name": "test Category"
                },
                {
                    "id": 2,
                    "name": "generic category"
                },
                {
                    "id": 4,
                    "name": "category with children"
                }
            ],
            "tags": [],
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 12,
            "geo_restriction": null,
            "subscribers_only": 0,
            "ads": 0,
            "campaign": 0,
            "publish_date": null,
            "currency": "SEK",
            "name": "New original video",
            "channel": 2,
            "channelPath": "arsta",
            "channelName": "Årsta pojkarna",
            "price": 0,
            "description": "The best matchup in football",
            "duration": "0",
            "created_at": "2019-08-21T08:15:06.000Z",
            "private": 0,
            "url_string": "url_string",
            "location": 4,
            "verified": 0,
            "draft": 0,
            "converted": 0,
            "size": 0,
            "source_is_created": 0,
            "updated_at": null,
            "playback_url": "playback_url",
            "special_prices": [
                {
                    "currency": "eur",
                    "price": 12,
                    "country": "es"
                }
            ],
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "download_url": "download_url",
            "uploaded_by": "Christoffer Owner",
            "origin": null,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://video-cache-sto-01.staylive.se/gmulla/thumbnail.jpg",
            "categories": [
                {
                    "id": 1,
                    "name": "test Category"
                },
                {
                    "id": 2,
                    "name": "generic category"
                },
                {
                    "id": 4,
                    "name": "category with children"
                }
            ],
            "tags": [],
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the channel that owns the requested video.

    This endpoint retrieves a video.

    HTTP Request

    GET https://api.staylive.tv/videos/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to retrieve

    Get likes from a specific video

    Role required

    This route requires no special access to get data back

    Response to a request

    {
        "message": {
            "likes": 9,
            "dislikes": 5,
            "video": 3
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The endpoint retrieves the likes and dislikes on the video

    HTTP Request

    GET https://api.staylive.tv/videos/<ID>/likes

    URL Parameters

    Parameter Description
    ID The ID of the video to retrieve likes from

    Delete a video from a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "The video 'New original video' has been deleted from the channel Årsta pojkarna",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the video has been deleted from the channel

    This endpoint delete a video from the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/videos/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to delete

    Video Chapter

    Create a chapter on a video

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Time The time stamp for the start of the chapter String Yes

    The timestamp needs to be formatted correctly to work. There are two ways to format it. Either 11:01:01, or 1:01:01 is accepted.

    The expected format of data looks like this:

      const chapter = {name: 'Highlights för Hammarby vs AIK', time: '11:11:11'}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 2,
                "video": 2,
                "time": "21:21:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Goal"
            },
            {
                "id": 3,
                "video": 2,
                "time": "21:26:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Self-goal"
            },
            {
                "id": 6,
                "video": 2,
                "time": "11:11:11",
                "created_at": "2018-05-30T10:49:47.000Z",
                "name": "Highlights för Hammarby vs AIK"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint creates a chapter to the supplied video.

    HTTP Request

    POST https://api.staylive.tv/videos/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to post the chapter on

    Update chapter data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String No
    Time The time stamp for the start of the chapter String No

    The timestamp needs to be formatted correctly to work. There are two ways to format it. Either 11:01:01, or 1:01:01 is accepted.

    The expected format of data looks like this:

      const chapter = {name: 'Highlights'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 3,
                "video": 2,
                "time": "21:26:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Self-goal"
            },
            {
                "id": 4,
                "video": 2,
                "time": "21:31:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "header-goal"
            },
            {
                "id": 6,
                "video": 2,
                "time": "11:11:11",
                "created_at": "2018-05-30T10:49:47.000Z",
                "name": "Highlights "
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint updates an existing chapter.

    HTTP Request

    PUT https://api.staylive.tv/videos/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the chapter to update

    Get all chapters from a video

    Role required

    This route requires no special access to get data back

    Response to a request made with no header json { "message": [ { "id": 1, "video": 2, "time": "11:11:11", "date": null, "name": "Epic chapter" }, { "id": 6, "video": 2, "time": "1:01:12", "date": null, "name": "A new chapter" }, ], "statuscode": 200, "success": true }

    Returns

    When the request gets a response the response includes all the chapters that has been linked to the selected video.

    This endpoint retrieves all chapters from a video.

    HTTP Request

    GET https://api.staylive.tv/videos/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to retrieve chapters from

    Delete a chapter from a video

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "The chapter 'New cool chapter', with ID 6 has been deleted from the video 'paid video'",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the chapter has been deleted from the video

    This endpoint delete a chapter from the supplied video.

    HTTP Request

    DELETE https://api.staylive.tv/videos/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the chapter to delete

    Collection Feed

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header

    {
        "message": {
            "channels": [
                {
                    "name": "Stockholms bandyklubb",
                    "id": 2,
                    "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                },
                {
                    "name": "Brandbergen boys",
                    "id": 4,
                    "channelImage": "https://image.staylive.se/profiles/4/profile.png"
                }
            ],
            "collection": {
                "name": "Stockholms klubben",
                "id": 1,
                "image": "0",
                "header_image": "0",
                "description": "0",
                "translations": [
                    {
                        "description": "New description",
                        "language": "EN",
                        "created_by": 106
                    },
                    {
                        "description": "En beskrivning på svenska",
                        "language": "swe",
                        "created_by": 106
                    }
                ]
            }
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    This endpoint retrieves all channels from a collection and the name of the collection.

    HTTP Request

    GET https://api.staylive.tv/collections/feed/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the collection to retrieve the channels from

    Add or update translations to a collection

    Role required

    You can only access this route with a valid login and if the login is tied to a collection with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Language The shorthand for the language that the translation is in String Yes
    Name The name users see if their preset is the same as the selected language String Yes
    Description The description users see if their preset is the same as the selected language String Yes

    This endpoint is used to implement translations for collections. If a user's language does not have a translation, the default values will be used.

    The expected format of data looks like this:

      const translations =
      {
        "translations": [{ "language": "EN", "description": "New description"}, { "language": "swe", "description": "En beskrivning på svenska" }]
      }
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the collection

    {
        "message": {
            "channels": [
                {
                    "name": "Stockholms bandyklubb",
                    "id": 2,
                    "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                },
                {
                    "name": "Brandbergen boys",
                    "id": 4,
                    "channelImage": "https://image.staylive.se/profiles/4/profile.png"
                }
            ],
            "collection": {
                "name": "Stockholms klubben",
                "id": 1,
                "image": "0",
                "header_image": "0",
                "description": "0",
                "translations": [
                    {
                        "description": "New description",
                        "language": "EN",
                        "created_by": 106
                    },
                    {
                        "description": "En beskrivning på svenska",
                        "language": "swe",
                        "created_by": 106
                    }
                ]
            }
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the collection route.

    This endpoint creates a translation to the supplied collection.

    HTTP Request

    POST/PUT https://api.staylive.tv/translation/collection/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the collection to translate

    Collection video category

    Create a collection video category in a collection

    A video can only have one category, but a category can have several videos. These categories reference categories made in collections that the collection owns. With this logic the owner of a collection can have a gathering place for specific categories from several collections. E.g if a league is ongoing, the collection may have a category with the name of the league. The collection owner can reference categories that the collections in the collection has made, that are relevant to this league. When that is done, these videos will end up in the collection categories.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Allsvenskan', parent: 11}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the collection

    {
        "message": "The category 'Fotbollens cup' has been created in the collection Stockholms klubben",
        "statuscode": 200,
        "success": true,
        "data": [
            8
        ]
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been created on the collection, with the included ID of the category.

    This endpoint creates a category on the supplied collection.

    HTTP Request

    POST https://api.staylive.tv/collection/videos/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the collection to post the category on

    Update collection video category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the category String No
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'A new category', parent: 8}
    

    Response to a request made by a user with owner status on the collection

    {
        "message": "The category 'New cool category', with ID 6 has been updated in the collection Stockholms Klubben",
        "statuscode": 200,
        "success": true,
        "data": {
          "name": "A new category",
          "parent": 8
        }
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been updated and the data that was sent in.

    This endpoint updates an existing category.

    HTTP Request

    URL Parameters

    PUT https://api.staylive.tv/collection/videos/categories/<ID>

    Parameter Description
    ID The ID of the category to update

    Get all livestream collection categories

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header json { "message": { "parent": 0, "id": 1, "name": "Video Master category, has videos connected to it", "category": 1, "videos": [ { "name": "paid video", "video_category_id": 2, "description": "0", "video_id": 2, "duration": "0", "channelName": "Årsta pojkarna", "channelid": 2, "private": 0, "created_at": "2019-04-01T10:22:45.000Z", "location": 0, "url_string": null, "channelImage": "https://image.staylive.se/profiles/2/profile.png", "thumbnail": "https://image.staylive.se/thumbnails/videos/2.jpg" }, { "name": "free video", "video_category_id": 1, "description": "0", "video_id": 1, "duration": "0", "channelName": "Västerhaninge boys", "channelid": 1, "private": 0, "created_at": "2019-04-01T10:22:45.000Z", "location": 0, "url_string": null, "channelImage": "https://image.staylive.se/profiles/1/profile.png", "thumbnail": "https://image.staylive.se/thumbnails/videos/1.jpg" } ], "subCategories": [ { "id": 10, "collection": 1, "created_at": "2019-04-01T10:23:12.000Z", "name": "test1", "parent": 1 }, { "id": 19, "collection": 1, "created_at": "2019-04-01T10:23:40.000Z", "name": "test2", "parent": 1 }, { "id": 22, "collection": 1, "created_at": "2019-04-01T10:23:58.000Z", "name": "test3", "parent": 1 } ], "parentCategories": [] }, "statuscode": 200, "success": true, "data": { "totalPages": 1, "objects": 2 } }

    Returns

    When the response is received, the user gets information about the collection video categories.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    The data that is limited is the amount of videos returned.

    This endpoint retrieves a all collection video categories.

    HTTP Request

    GET https://api.staylive.tv/collection/videos/category/<ID>?limit=12&page=2

    URL Parameters

    Parameter Description
    ID The ID of the collection to retrieve categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Get all video collection categories

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header json { "message": [ { "id": 1, "collection": 1, "date": null, "name": "Allsvenskan", "parent": 0 }, { "id": 2, "collection": 1, "date": null, "name": "Hockey", "parent": 1 }, { "id": 8, "collection": 1, "date": null, "name": "Fotbollens cup", "parent": 0 } ], "statuscode": 200, "success": true, "data": { "totalPages": 1, "objects": 3 } }

    Returns

    When the response is received, the user gets information about the collection video categories.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    This endpoint retrieves a all collection video categories.

    HTTP Request

    GET https://api.staylive.tv/collection/videos/categories/<ID>?limit=12&page=2

    URL Parameters

    Parameter Description
    ID The ID of the collection to retrieve categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Delete a video category reference to a collection category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the collection

    {
        "message": "The reference to 'Allsvenskan' with channel category 'Fotboll' has been deleted!",
        "statuscode": 200,
        "success": true,
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category reference has been deleted from the collection.

    This endpoint deletes a category reference.

    HTTP Request

    DELETE https://api.staylive.tv/collection/videos/categories/references/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category reference to delete.

    Delete a video category from a collection

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the collection

    {
        "message": "The category 'A new category', with id 231 has been deleted from the channel Årsta pojkarna and 1 categories have been updated to have no parent",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been deleted from the collection and how many updated reference categories exist. If a category that has reference categories is deleted, the reference categories parent is set to 0, as the parent category no longer exists.

    This endpoint deletes a category.

    HTTP Request

    POST https://api.staylive.tv/collection/videos/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to delete

    Collection livestream category

    Create a collection livestream category in a collection

    A livestream can only have one category, but a category can have several livestreams. These categories reference categories made in collections that the collection owns. With this logic the owner of a collection can have a gathering place for specific categories from several collections. E.g if a league is ongoing, the collection may have a category with the name of the league. The collection owner can reference categories that the collections in the collection has made, that are relevant to this league. When that is done, these livestreams will end up in the collection categories.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Stockholms Bandyklubbs kategorier'}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the collection

    {
        "message": {
            "id": 9,
            "name": "Stockholms Bandyklubbs kategorier",
            "parent": 0,
            "streams": [],
            "subCategories": [],
            "parentCategories": []
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the collection livestream categories route.

    This endpoint creates a category on the supplied collection.

    HTTP Request

    POST https://api.staylive.tv/collection/livestreams/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the collection to post the category on

    Update collection livestream category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the category String No
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {parent: 4}
    

    Response to a request made by a user with owner status on the collection

    {
        "message": {
            "id": 9,
            "name": "Stockholms Bandyklubbs kategorier",
            "streams": [
                {
                    "name": "test stream",
                    "stream_category_id": 1,
                    "stream_id": 1
                },
                {
                    "name": "Real stream",
                    "stream_category_id": 2,
                    "stream_id": 2
                }
            ],
            "subCategories": [],
            "parentCategories": [
                {
                    "id": 4,
                    "collection": 2,
                    "created_at": "2018-05-30T05:50:05.000Z",
                    "name": "livestream no parents",
                    "parent": 0
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the collection livestream categories route.

    This endpoint updates an existing category.

    HTTP Request

    URL Parameters

    PUT https://api.staylive.tv/collection/livestreams/categories/<ID>

    Parameter Description
    ID The ID of the category to update

    Get a livestream collection category

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header json { "message": { "parent": 0, "id": 1, "name": "livestream Master category, has livestreams connected to it", "category": 1, "streams": [ { "name": "Real stream", "stream_category_id": 1, "stream_id": 2, "description": "0", "start": "2018-02-15T12:21:19.000Z", "end": "2018-02-25T12:21:19.000Z", "channelName": "Västerhaninge boys", "channelid": 1, "thumbnail": "https://image.staylive.se/thumbnails/streams/0.jpg", "channelImage": "https://image.staylive.se/profiles/0/profile.png" } ], "subCategories": [ { "id": 2, "collection": 1, "created_at": "2019-04-01T10:22:45.000Z", "name": "Livestream category", "parent": 1 }, ], "parentCategories": [] }, "statuscode": 200, "success": true, "data": { "totalPages": 1, "objects": 1 } }

    Returns

    When the response is received, the user gets information about a collection livestream category.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    The data that is limited is the amount of livestreams returned.

    This endpoint retrieves a all collection livestream categories.

    HTTP Request

    GET https://api.staylive.tv/collection/livestreams/category/<ID>?limit=12&page=2

    URL Parameters

    Parameter Description
    ID The ID of the collection to retrieve categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Get all livestream collection categories

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header json { "message": [ { "id": 1, "collection": 1, "date": null, "name": "Allsvenskan", "parent": 0 }, { "id": 2, "collection": 1, "date": null, "name": "Hockey", "parent": 1 }, { "id": 8, "collection": 1, "date": null, "name": "Fotbollens cup", "parent": 0 } ], "statuscode": 200, "success": true, "data": { "totalPages": 1, "objects": 3 } }

    Returns

    When the response is received, the user gets information about the collection livestream categories.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    This endpoint retrieves a all collection livestream categories.

    HTTP Request

    GET https://api.staylive.tv/collection/livestreams/categories/<ID>?limit=12&page=2

    URL Parameters

    Parameter Description
    ID The ID of the collection to retrieve categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Delete a livestream category reference to a collection category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the collection

    {
        "message": "The reference to 'Allsvenskan' with channel category 'Fotboll' has been deleted!",
        "statuscode": 200,
        "success": true,
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category reference has been deleted from the collection.

    This endpoint deletes a category reference.

    HTTP Request

    DELETE https://api.staylive.tv/collection/livestreams/categories/references/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category reference to delete.

    Delete a livestream category from a collection

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the collection

    {
        "message": "The category 'A new category', with id 231 has been deleted from the channel Årsta pojkarna and 1 categories have been updated to have no parent",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been deleted from the collection and how many updated reference categories exist. If a category that has reference categories is deleted, the reference categories parent is set to 0, as the parent category no longer exists.

    This endpoint deletes a category.

    HTTP Request

    DELETE https://api.staylive.tv/livestreams/categories/references/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to delete

    Category

    Create a video category

    A video can only have one category, but a category can have several videos.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Allsvenskan', parent: 5}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 232,
                "name": "Allsvenskan",
                "parent": 5,
                "channel": 2,
                "created_at": "2018-05-31T06:26:14.000Z",
                "videos": [],
                "subCategories": [],
                "parentCategories": [
                    {
                        "id": 4,
                        "name": "2017",
                        "parent": 0,
                        "channel": 2,
                        "created_at": "2018-05-30T05:50:05.000Z"
                    },
                    {
                        "id": 5,
                        "name": "Sista matcherna",
                        "parent": 4,
                        "channel": 2,
                        "created_at": "2018-05-30T05:50:05.000Z"
                    }
                ]
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the video categories route.

    This endpoint creates a category on the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/videos/categories/<ID/PATH>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the category on
    Path The Path of the channel to post the category on

    Update video category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the category String No
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Allsvenskan hockey'}
    

    Response to a request made by a user with owner status on the channel

    {
      "message": [
          {
              "id": 232,
              "name": "Allsvenskan hockey",
              "parent": 5,
              "channel": 2,
              "created_at": "2018-05-31T06:29:05.000Z",
              "videos": [],
              "subCategories": [],
              "parentCategories": [
                  {
                      "id": 4,
                      "name": "category with children",
                      "parent": 0,
                      "channel": 2,
                      "created_at": "2018-05-30T05:50:05.000Z"
                  },
                  {
                      "id": 5,
                      "name": "category with parent 2",
                      "parent": 4,
                      "channel": 2,
                      "created_at": "2018-05-30T05:50:05.000Z"
                  }
              ]
          }
      ],
      "statuscode": 200,
      "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the video categories route.

    This endpoint updates an existing category.

    HTTP Request

    PUT https://api.staylive.tv/videos/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to update

    Get a channel video category feed

    Role required

    This route requires no special access to get data back

    Response to a request made with no header json { "message": [ { "name": "Allsvenskan", }, { "name": "Fotbollsintervjuer" } { "name": "Mål" } ], "statuscode": 200, "success": true }

    Returns

    When the request gets a response the response includes the information about all of the video categories found from the requested channel.

    This endpoint retrieves all video categories from the requested channel.

    HTTP Request

    GET https://api.staylive.tv/videos/categories/feed/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to get the categories from

    Get a video category

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
        "message": [
            {
                "id": 231,
                "name": "Allsvenskan",
                "parent": 0,
                "channel": 2,
                "created_at": "2018-03-02T13:31:22.000Z",
                "videos": [
                    {
                        "name": "World cup in Football",
                        "price": 0,
                        "description": null,
                        "category": 3
                    }
                ],
                "subCategories": [
                  {
                    "id": 233,
                    "name": "A new category",
                    "parent": 231,
                    "channel": 2,
                    "created_at": "2018-03-02T13:31:22.000Z"
                  }
    
                ],
                "parentCategories": []
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
            "totalPages": 1,
            "objects": 1
        }
    
    }
    

    Returns

    When the request gets a response the response includes the information about the requested category and all of the videos that are included in the parent- and sub categories that are connected to the requested category. Included in the response is also information about parent and sub categories, if they exist. Otherwise an empty array is returned.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    The data that is limited is the amount of videos returned.

    This endpoint retrieves a category, parent- and sub categories and all of the videos tagged with the requested category.

    HTTP Request

    GET https://api.staylive.tv/videos/categories/<ID>?limit=20&page=1

    URL Parameters

    Parameter Description
    ID The ID of the category to retrieve videos, parent- and sub categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Get all video category top level parents

    This route returns all the top parent categories.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
    "message": [
        {
            "id": 4,
            "name": "category with children",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 6,
            "name": "Simning",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 10,
            "name": "new parent",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 201,
            "name": "No sub category or parent",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        }
    ],
    "statuscode": 200,
    "success": true
    }
    
    

    Returns

    The route responds with all categories that are at the top level and are tied to the requested channel.

    This endpoint retrieves all parent categories at the top level.

    HTTP Request

    GET https://api.staylive.tv/videos/categories/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to retrieve videos, parent- and sub categories from

    Delete a video category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "The category 'A new category', with id 231 has been deleted from the channel Årsta pojkarna and 1 categories have been updated to have no parent",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been deleted from the channel and how many updated sub categories exist. If a category that has sub categories is deleted, the sub categories parent is set to 0, as the parent category no longer exists.

    This endpoint deletes a category.

    HTTP Request

    DELETE https://api.staylive.tv/videos/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to delete

    Create a livestream category

    A livestream can only have one category, but a category can have several livestreams.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Bandy', parent: 4}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 231,
                "name": "Bandy",
                "parent": 4,
                "channel": 2,
                "created_at": "2018-05-30T13:30:32.000Z",
                "streams": [],
                "subCategories": [],
                "parentCategories": [
                    {
                        "id": 4,
                        "name": "category with children",
                        "parent": 0,
                        "channel": 2,
                        "created_at": "2018-05-30T05:50:05.000Z"
                    }
                ]
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the livestream categories route.

    This endpoint creates a category on the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/livestreams/categories/<ID/PATH>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the category on
    Path The path of the channel to post the category on

    Update livestream category data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the category String No
    Parent The parent categories ID Integer No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

      const category = {name: 'Bandymatcher', parent: 5}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 232,
                "name": "Bandymatcher",
                "parent": 5,
                "channel": 2,
                "created_at": "2018-05-30T13:33:16.000Z",
                "streams": [],
                "subCategories": [],
                "parentCategories": [
                    {
                        "id": 4,
                        "name": "category with children",
                        "parent": 0,
                        "channel": 2,
                        "created_at": "2018-05-30T05:50:05.000Z"
                    },
                    {
                        "id": 5,
                        "name": "category with parent 2",
                        "parent": 4,
                        "channel": 2,
                        "created_at": "2018-05-30T05:50:05.000Z"
                    }
                ]
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the livestream categories route.

    This endpoint updates an existing category.

    HTTP Request

    URL Parameters

    PUT https://api.staylive.tv/videos/categories/<ID>

    Parameter Description
    ID The ID of the category to update

    Get a livestream category

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied. If, for some reason, a category has a parent category that has a parent that is already in the sub categories, the parent categories parent is set to 0 and the data is returned normally, as seen below.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
        "message": [
            {
                "id": 231,
                "name": "Allsvenskan",
                "parent": 0,
                "channel": 2,
                "created_at": "2018-03-02T13:31:22.000Z",
                "livestreams": [
                    {
                        "name": "World cup in Football",
                        "price": 0,
                        "description": null,
                        "category": 3
                    }
                ],
                "subCategories": [
                  {
                    "id": 233,
                    "name": "A new category",
                    "parent": 231,
                    "channel": 2,
                    "created_at": "2018-03-02T13:31:22.000Z"
                  }
    
                ],
                "parentCategories": []
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 0,
          "objects": 1
        }
    }
    

    Returns

    When the request gets a response the response includes the information about the requested category and all of the livestreams that are included in the parent- and sub categories that are connected to the requested category. Included in the response is also information about parent and sub categories, if they exist. Otherwise an empty array is returned.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    The data that is limited is the amount of livestreams returned.

    This endpoint retrieves a category, parent- and sub categories and all of the livestreams tagged with the requested category.

    HTTP Request

    GET https://api.staylive.tv/livestreams/categories/<ID>?limit=20&page=1

    URL Parameters

    Parameter Description
    ID The ID of the category to retrieve livestreams, parent- and sub categories from
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Get a channel livestream category feed

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header json { "message": [ { "name": "Allsvenskan", }, { "name": "Fotbollsintervjuer" } { "name": "Mål" } ], "statuscode": 200, "success": true }

    Returns

    When the request gets a response the response includes the information about all of the livestream categories found from the requested channel.

    This endpoint retrieves all livestream categories from the requested channel.

    HTTP Request

    GET https://api.staylive.tv/livestream/categories/feed/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to get the categories from

    Get all video category top level parents

    This route returns all the top parent categories.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
    "message": [
        {
            "id": 4,
            "name": "category with children",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 6,
            "name": "Simning",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 10,
            "name": "new parent",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        },
        {
            "id": 201,
            "name": "No sub category or parent",
            "parent": 0,
            "channel": 2,
            "created_at": "2018-03-26T09:06:26.000Z"
        }
    ],
    "statuscode": 200,
    "success": true
    }
    

    Returns

    The route responds with all categories that are at the top level and are tied to the requested channel.

    This endpoint retrieves all parent categories at the top level.

    HTTP Request

    GET https://api.staylive.tv/videos/categories/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to retrieve videos, parent- and sub categories from

    Delete a livestream category

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "The category 'A new category', with id 231 has been deleted from the channel Årsta pojkarna and 1 categories have been updated to have no parent",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been deleted from the channel and how many updated sub categories exist. If a category that has sub categories is deleted, the sub categories parent is set to 0, as the parent category no longer exists.

    This endpoint deletes a category.

    HTTP Request

    POST https://api.staylive.tv/livestreams/categories/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the category to delete

    Video tag

    Create a video tag

    A video can have multiple tags, and a tag can have multiple videos.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the tag String Yes

    The tags are made in a way to decrease the amount of articles in the database. A tag is not owned by one channel, when a channel creates a tag, everyone can tag their own videos and come up in those tag searches. If a channel deletes a video that is the last referenced object to a specific tag, the tag is deleted. Because of this logic, there is no way to edit an already created tag, if you want to change the tag, you will have to delete it and create a new one. A tag in the database also references both the video and livestream version of the media. E.g if a livestream is uploaded with the tag "Fotbollskuppen", and is then made into a VOD, video on demand, the video keeps the "Fotbollskuppen"-tag, unless explicitly told not to.

    The expected format of data looks like this:

      const tag = {name: 'edsbyn, villa, vod'}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 3,
            "name": "Edsbyn vs Villa",
            "channel": 2,
            "description": "0",
            "size": 0,
            "price": 0,
            "duration": "0",
            "converted": 0,
            "ads": 0,
            "campaign": 0,
            "stats": 0,
            "deleted": 0,
            "private": 0,
            "location": 0,
            "source_is_created": 0,
            "uploaded_by": "Christoffer Developer",
            "created_at": "2018-05-30T05:50:05.000Z",
            "updated_at": "2018-05-30T05:50:05.000Z",
            "channelName": "Stockholms Bandyklubb",
            "origin": null,
            "categories": [],
            "tags": [
                {
                    "id": 11,
                    "name": "edsbyn"
                }
                {
                    "id": 12,
                    "name": "villa"
                }
                {
                    "id": 13,
                    "name": "vod"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the video route.

    This endpoint creates a tag on the supplied video.

    HTTP Request

    POST https://api.staylive.tv/videos/tags/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to post the tag on

    Get a video tag

    A tag can contain videos from several channels. The tag also contains livestreams, to see how to access livestreams please see the Livestream tag header. If you want to find out how to get a mix of videos and livestreams, please see the Mixed tags header.

    Role required

    This route requires no special access to get data back

    Response to a request made with no header

    {
        "message": [
            {
                "name": "New original video"
            },
            {
                "name": "Old original video"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes the videos that are tagged with the requested tag.

    This endpoint retrieves a tag and all videos with the tag.

    HTTP Request

    GET https://api.staylive.tv/videos/tags/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tag to retrieve videos.

    Delete a video tag from a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel and with a tag that only has 1 video/livestream left connected to it

    {
        "message": "Tag with name Fotbollskuppen, has been deleted",
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel and with a tag that has several videos/livestreams connected to it

    {
        "message": "Relation with tag Fotbollskuppen has been removed",
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel and with a tag that has several videos/livestreams connected to it and the source livestream is still connected

    {
        "message": "Tag relation has been removed",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the category has been deleted from the video. The responses may vary depending on how much was deleted.

    This endpoint deletes a tag.

    HTTP Request

    POST https://api.staylive.tv/videos/tag/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tag to delete

    Video feed

    Get all videos from a channel

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, statistics, company and statistics The user can supply IDs in two ways, if the user only wants one channels full feed they can go via the route /videos/feed/1. If the user wants several channels feeds, they can send in a header with the name "X-STAYLIVE-CHANNELS" with the ID's of the channels they want to access. They will get more information from the videos connected to the channels they own.

    Response to a request made with no header

    {
        "message": [
            {
                "id": 3,
                "name": "Edsbyn vs Kiruna",
                "channelName": "Stockholms Bandyklubb",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            },
            {
                "id": 4,
                "name": "Edsbyn vs Kristianstad",
                "channelName": "Stockholms Bandyklubb",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 2
        }
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "viewers": 92,
                "id": 3,
                "name": "Edsbyn vs Kiruna",
                "channel": 2,
                "description": "0",
                "size": 0,
                "price": 0,
                "duration": "0",
                "converted": 0,
                "ads": 0,
                "campaign": 0,
                "stats": 0,
                "deleted": 0,
                "private": 0,
                "location": 0,
                "source_is_created": 0,
                "uploaded_by": "Christoffer Developer",
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "viewers": 91,
                "id": 4,
                "name": "Edsbyn vs Kristianstad",
                "channel": 2,
                "description": "0",
                "size": 0,
                "price": 0,
                "duration": "0",
                "converted": 0,
                "ads": 0,
                "campaign": 0,
                "stats": 0,
                "deleted": 0,
                "private": 0,
                "location": 0,
                "source_is_created": 0,
                "uploaded_by": "Christoffer Developer",
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "channelName": "Stockholms Bandyklubb"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 2
        }
    }
    

    Response to a request made with a header that contains 2 channels

    {
        "message": [
            {
                "id": 1,
                "name": "Test video inför förspel",
                "channelName": "Västerhaninge boys",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            },
            {
                "id": 3,
                "name": "Edsbyn vs Kiruna",
                "channelName": "Stockholms Bandyklubb",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            },
            {
                "id": 4,
                "name": "Edsbyn vs Kristianstad",
                "channelName": "Stockholms Bandyklubb",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 3
        }
    }
    

    Response to a request made by a user with owner status on the channel with a header including several channels, some not owned by the user

    {
        "message": [
            {
                "viewers": 91,
                "id": 1,
                "name": "Test video inför förspel",
                "channelName": "Västerhaninge boys",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            },
            {
                "viewers": 92,
                "id": 3,
                "name": "Edsbyn vs Kiruna",
                "channel": 2,
                "description": "0",
                "size": 0,
                "price": 0,
                "duration": "0",
                "converted": 0,
                "ads": 0,
                "campaign": 0,
                "stats": 0,
                "deleted": 0,
                "private": 0,
                "location": 0,
                "source_is_created": 0,
                "currency": "SEK",
                "draft": 1,
                "uploaded_by": "Christoffer Developer",
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "viewers": 91,
                "id": 4,
                "name": "Edsbyn vs Kristianstad",
                "channel": 2,
                "description": "0",
                "size": 0,
                "price": 0,
                "duration": "0",
                "converted": 0,
                "ads": 0,
                "campaign": 0,
                "stats": 0,
                "deleted": 0,
                "private": 0,
                "location": 0,
                "source_is_created": 0,
                "currency": "SEK",
                "draft": 0,
                "uploaded_by": "Christoffer Developer",
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "channelName": "Stockholms Bandyklubb"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 3
        }
    }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the requested channel. The response includes a "reply" with a true or false value, telling the user if the video came from a livestream, or if has only existed as a video.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    This endpoint retrieves a video feed from a channel.

    HTTP Request

    GET https://api.staylive.tv/videos/feed/<ID>?draft=1&limit=20&page=2

    URL Parameters

    Parameter Description
    ID The ID of the channel to retrieve the video feed from
    Draft If the user has higher level access to a selected channel, they may see drafts that are otherwise hidden by default. This is not a required query, but can be reached by setting draft as '1'.
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 10, which results in 10 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-10 as a response, but want to access 11-20, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 11-20.

    Heartbeat endpoint

    Create a video heartbeat

    A heartbeat can be created both as a user and a non-user. A user gets more information saved, like user ID.

    This route is used to create statistics over the amount of current viewers, total unique viewers and total viewers overall on the video.

    Role required

    This route requires no special access to get data back

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": "Heartbeat added to video!",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data confirms there's been an added heartbeat to the video.

    This endpoint creates a heartbeat to the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/videos/heartbeat/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to add a heartbeat to

    Livestream

    Post a livestream to a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required Keys
    Name The name of the livestream String Yes None
    Price The price of the livestream Integer Yes None
    Description The description of the livestream String No None
    Subscriptions Subscription ID's that the livestream is connected to. Separated with commas String No None
    Tags Tag names that will be connected to the livestream String No None
    Categories Category ID's that will be connected to the livestream String No None
    Currency The currency the livestream will accept as payment, defaults to SEK String No None
    Draft If the livestream will be set as a draft and not published, defaults to not a draft Boolean No None
    Requires_login If the livestream will be set as a user only experience Boolean No None
    stream_sources The source of the streams data String No None
    special_prices An array with objects in it for prices in different countries Array No [{ country, currency, price }]
    translations An array with objects in it for translations in different countries Array No [{ language, description, name }]
    Ads If the livestream will be using ads Boolean No None
    Thumbnail If the livestream will be using a custom thumbnail. Can be a file or an ID to an already existing thumbnail. File or integer. No None
    Chat If the livestream will be using a chat Boolean No None
    Vod If the livestream will be uploaded as a VOD after the livestream is done Boolean No None
    Auto_alerts Automatically creates error messages if the livestream signal goes down Boolean No None
    Private If the livestream will be uploaded as a private livestream, only people with access will be able to see it (people who bought the livestream before it was set as private and users with heightened access) Boolean No None
    Start The time and date the livestream will be set to start Date No None
    End The time and date the livestream will be set to end Date No None

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The tag names are separated by a comma, the tag names can be already existing tags or non-existing tags, that will be created.

    Categories will require an existing category's ID to connect it to the livestream. If you submit a PUT/POST request with a category that you do not have access to, the connection will not be made, but the PUT/POST request will go through.

    Subscriptions can be tied to an entire channel, or just specific livestreams depending on the end goal. Via the PUT of livestreams or POST of livestreams, you can create/update a livestream and directly connect it to a subscription.

    A draft will not show up in GET, feed or be purchasable. It makes it possible to start a draft of a livestream but not necessarily finish and publish it until a later date. The currency attribute decides what currency to accept payments in. To see the available currencies see "currency".

    If a livestream is set as "subscribers_only", it means that the livestream can only be accessed through an active subscription. The livestream can not be bought separately or obtained through any other way than a valid subscription that includes the livestream. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    If a livestream is set as "requires_login", it means that the livestream can only be accessed by a logged in user. Even if the livestream is free, a guest, non-logged in user, can't access the livestream. These livestreams can also have a price, requiring users to be logged in and also requires the user to buy the livestream.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the livestream.

    For livestreams that may have an international audience, you have the option to include translations, geo-restrictions and special prices. Translations change the name and description of the livestream for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    To whitelist or blacklist countries, you first need to create a list of countries to black/white-list. During the creation of a livestream you can supply the ID of the list to geo_restriction, and that livestream is black/white-listed in those countries.

    Geo-restrictions and special prices are based on IP addresses. Geo restriction blocks access to certain livestreams and special prices change the livestream price. If no geo restriction, special price or translation is found, the default values are used.

    The expected format of data looks like this:

      const livestream = { name: 'Edsbyn vs Villa', description: 'A game featuring Edsbyn vs Villa', price: 20, tags: 'Bandy, edsbyn, villa, stream', auto_alerts: false, currency: 'eur', special_prices: [{ country: 'swe', currency: 'sek', price: 200 }, { country: 'no', currency: 'NOK', price: 180 }], translations: [{ language: 'se', name: 'Edsbyn vs villa bandy', description: 'En match som inkluderar Edsbyn och Villa' }, { language: 'no', name: 'Edsbyn vs villa bandy', description: 'En match med Edsbyn & Villa' }] }
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 26,
            "subscribers_only": 0,
            "geo_restriction": null,
            "campaign": 0,
            "ads": 0,
            "currency": "eur",
            "draft": 0,
            "name": "Edsbyn vs Villa",
            "price": 20,
            "description": "A game featuring Edsbyn vs Villa",
            "start": null,
            "end": null,
            "channelName": "Årsta pojkarna",
            "channelid": 2,
            "channelPath": "arsta",
            "chat": 0,
            "requires_login": 0,
            "verified": 0,
            "stream_sources": 0,
            "auto_alerts": 0,
            "viewers": 0,
            "streamid": "streamid",
            "private": 0,
            "vod": 1,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://image.staylive.se/thumbnails/streams/26.jpg",
            "playback_url": "playback_url.com",
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "created_by": "Christoffer Owner",
            "replay": [],
            "tags": [
                {
                    "name": "bandy"
                },
                {
                    "name": "edsbyn"
                },
                {
                    "name": "villa"
                },
                {
                    "name": "stream"
                }
            ],
            "categories": [],
            "errorMessage": "",
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [],
            "special_prices": [
                {
                    "currency": "sek",
                    "price": 200,
                    "country": "swe"
                },
                {
                    "currency": "nok",
                    "price": 180,
                    "country": "no"
                }
            ],
            "translations": [
                {
                    "name": "Edsbyn vs villa bandy",
                    "description": "En match som inkluderar Edsbyn och Villa",
                    "language": "se",
                    "created_by": 103
                },
                { "language": "no",
                  "name": "Edsbyn vs villa bandy",
                  "description": "En match med Edsbyn & Villa"
                 }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the livestreams route.

    This endpoint posts a livestream to the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/livestreams/<ID/PATH>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the livestream on
    Path The Path of the channel to post the livestream on

    Update livestream data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required Keys
    Name The name of the livestream String No None
    Price The price of the livestream Integer No None
    Description The description of the livestream String No None
    Subscriptions Subscription ID's that the livestream is connected to. Separated with commas String No None
    Tags Tag names that will be connected to the livestream String No None
    Categories Category ID's that will be connected to the livestream String No None
    Currency The currency the livestream will accept as payment, defaults to SEK String No None
    Draft If the livestream will be set as a draft and not published, defaults to not a draft Boolean No None
    Requires_login If the livestream will be set as a user only experience Boolean No None
    Geo_restriction If the livestream should be tied to a blacklist/whitelist of countries Integer No None
    stream_sources The source of the streams data String No None
    special_prices An array with objects in it for prices in different countries Array No [{ country, currency, price }]
    translations An array with objects in it for translations in different countries Array No [{ language, description, name }]
    Ads If the livestream will be using ads Boolean No None
    Chat If the livestream will be using a chat Boolean No None
    Thumbnail If the livestream will be using a custom thumbnail. Can be a file or an ID to an already existing thumbnail. File or integer. No None
    Vod If the livestream will be uploaded as a VOD after the livestream is done Boolean No None
    Auto_alerts Automatically creates error messages if the livestream signal goes down Boolean No None
    Private If the livestream will be uploaded as a private livestream, only people with access will be able to see it (people who bought the livestream before it was set as private and users with heightened access) Boolean No None
    Start The time and date the livestream will be set to start Date No None
    End The time and date the livestream will be set to end Date No None

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The tag names are separated by a comma, the tag names can be already existing tags or non-existing tags, that will be created. To remove tag connections, submit a PUT request without that tag.

    The category ID's are separated by a comma, only categories owned by the channel will be added.

    Subscriptions can be tied to an entire channel, or just specific livestreams depending on the end goal. Via the PUT of livestreams or POST of livestreams, you can create/update a livestream and directly connect it to a subscription.

    The request will automatically remove all tag-, category- and subscription connections and add the connections that is included in the request.

    A draft will not show up in GET, feed or be purchasable. It makes it possible to start a draft of a livestream but not necessarily finish and publish it until a later date.

    The currency attribute decides what currency to accept payments in. To see the available currencies see "currency".

    If a livestream is set as "subscribers_only", it means that the livestream can only be accessed through an active subscription. The livestream can not be bought separately or obtained through any other way than a valid subscription that includes the livestream. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    If a livestream is set as "requires_login", it means that the livestream can only be accessed by a logged in user. Even if the livestream is free, a guest, non-logged in user, can't access the livestream. These livestreams can also have a price, requiring users to be logged in and also requires the user to buy the livestream.

    For livestreams that may have an international audience, you have the option to include translations, geo-restrictions and special prices. Translations change the name and description of the livestream for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the livestream.

    Geo-restrictions and special prices are based on IP addresses. Geo restriction blocks access to certain livestreams and special prices change the livestream price. If no geo restriction, special price or translation is found, the default values are used.

    To whitelist or blacklist countries, you first need to create a list of countries to black/white-list. During the creation of a livestream you can supply the ID of the list to geo_restriction, and that livestream is black/white-listed in those countries.

    To reset the translations and special prices, you submit their respective keys as empty arrays. Works the same way as tag removal, where you need to include all of the translations and special prices in order for it to included for the livestream.

    The expected format of data looks like this:

      const livestream = { name: 'Edsbyn VERSUS Villa', tags: '' , categories: '1, 2, 3, 4', translations: [] }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 26,
            "subscribers_only": 0,
            "geo_restriction": null,
            "campaign": 0,
            "ads": 0,
            "currency": "eur",
            "draft": 0,
            "name": "Edsbyn VERSUS Villa",
            "price": 20,
            "description": "A game featuring Edsbyn vs Villa",
            "start": null,
            "end": null,
            "channelName": "Årsta pojkarna",
            "channelid": 2,
            "channelPath": "arsta",
            "chat": 0,
            "requires_login": 0,
            "verified": 0,
            "stream_sources": 0,
            "auto_alerts": 0,
            "viewers": 0,
            "streamid": "streamid",
            "private": 0,
            "vod": 1,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://image.staylive.se/thumbnails/streams/26.jpg",
            "playback_url": "playback_url.com",
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "created_by": "Christoffer Owner",
            "replay": [],
            "tags": [],
            "categories": [
                {
                    "name": "generic category",
                    "id": 2
                },
                {
                    "name": "category with children",
                    "id": 4
                }
            ],
            "errorMessage": "",
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ],
            "special_prices": [
                {
                    "currency": "sek",
                    "price": 200,
                    "country": "swe"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the streams route.

    This endpoint posts a livestream to the supplied channel.

    HTTP Request

    PUT https://api.staylive.tv/livestreams/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to edit

    Get a Specific livestream

    The return data includes general data about the livestream, but also tags that are connected to the livestream, categories that are connected and also an error message that the broadcaster can set, in case of interruptions or issues occurring during the livestream. Also included in the response is "viewers", which is current viewers.

    If a livestream is set as "subscribers_only", it means that the livestream can only be accessed through an active subscription. The livestream can not be bought separately or obtained through any other way than a valid subscription that includes the livestream. Some subscriptions includes everything on a channel, while some subscriptions only include selected videos & livestreams.

    If a livestream is set as "requires_login", it means that the livestream can only be accessed by a logged in user. Even if the livestream is free, a guest, non-logged in user, can't access the livestream. These livestreams can also have a price, requiring users to be logged in and also requires the user to buy the livestream.

    A livestream can have a "special price", where the price is changed depending on the country the livestream is requested from. A Swedish user can have a different price compared to someone in Finland etc. The livestream can be set to have different currencies and price depending on country. Translations are also possible, depending on the language that has been set for the user. If a Swedish user accesses something that has a Swedish translation, the user will see the Swedish name and description. If no special price, restriction or translation has been set for the livestream, the default values are shown.

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, statistics, company and statistics, company

    Response to a request made with no header

    {
        "message": {
            "id": 26,
            "subscribers_only": 0,
            "geo_restriction": null,
            "campaign": 0,
            "ads": 0,
            "currency": "eur",
            "draft": 0,
            "name": "Edsbyn VERSUS Villa",
            "price": 20,
            "description": "A game featuring Edsbyn vs Villa",
            "start": null,
            "end": null,
            "channelName": "Årsta pojkarna",
            "channelid": 2,
            "channelPath": "arsta",
            "chat": 0,
            "requires_login": 0,
            "verified": 0,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://image.staylive.se/thumbnails/streams/26.jpg",
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "replay": [],
            "tags": [],
            "categories": [
                {
                    "name": "generic category",
                    "id": 2
                },
                {
                    "name": "category with children",
                    "id": 4
                }
            ],
            "errorMessage": "",
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 26,
            "subscribers_only": 0,
            "geo_restriction": null,
            "campaign": 0,
            "ads": 0,
            "currency": "eur",
            "draft": 0,
            "name": "Edsbyn VERSUS Villa",
            "price": 20,
            "description": "A game featuring Edsbyn vs Villa",
            "start": null,
            "end": null,
            "channelName": "Årsta pojkarna",
            "channelid": 2,
            "channelPath": "arsta",
            "chat": 0,
            "requires_login": 0,
            "verified": 0,
            "channelImage": "https://image.staylive.se/profiles/2/profile.png",
            "thumbnail": "https://image.staylive.se/thumbnails/streams/26.jpg",
            "geo_restricted": {
                "allowed": true,
                "currentCountry": "Unknown",
                "restriction": {
                    "country_codes": "",
                    "restriction_type": "whitelist"
                }
            },
            "replay": [],
            "tags": [],
            "categories": [
                {
                    "name": "generic category",
                    "id": 2
                },
                {
                    "name": "category with children",
                    "id": 4
                }
            ],
            "errorMessage": "",
            "subscription": {
                "specific_access": [],
                "general_access": [
                    {
                        "id": 1,
                        "name": "Innebandy",
                        "price": 199,
                        "currency": "SEK"
                    }
                ]
            },
            "collectionCategories": [
                {
                    "id": 1,
                    "name": "Video Master category, has videos connected to it"
                },
                {
                    "id": 4,
                    "name": "Video no parents"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the channel that owns the requested livestream.

    This endpoint retrieves a livestream.

    HTTP Request

    GET https://api.staylive.tv/livestreams/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to retrieve

    Get chat from a specific livestream

    The object key isAdmin is set as true or false. This is used to show if a user is an admin or not on the channel.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request

    {
        "message": [
            {
                "nickname": "BestUser123",
                "message": "Heja Sverige!",
                "date": "2018-12-14T10:11:56.000Z",
                "isAdmin": true
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The endpoint retrieves chat from a livestream

    HTTP Request

    GET https://api.staylive.tv/livestreams/chat/ID

    URL Parameters

    Parameter Description
    ID The ID of the livestream to retrieve chat from

    Get likes from a specific livestream

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request

    {
        "message": {
            "likes": 9,
            "dislikes": 5,
            "stream": 3
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The endpoint retrieves the likes and dislikes on the livestream

    HTTP Request

    GET https://api.staylive.tv/livestreams/<ID>/likes

    URL Parameters

    Parameter Description
    ID The ID of the livestream to retrieve likes from

    Delete broadcast message from a livestream

    This endpoint is used to delete a broadcast message

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with access

    {
        "message": "Error message for stream 1 has been deleted",
        "statuscode": 200,
        "success": false
    }
    

    Returns

    The return data confirms that the broadcast message has been deleted.

    This endpoint deletes the broadcast message from the specified stream.

    HTTP Request

    DELETE https://api.staylive.tv/livestreams/message/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to delete the message from

    Post a broadcast to a livestream

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, company, company and statistics

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    message A message that will be shown to everyone watching the livestream String Yes

    This endpoint is used if there is some kind of widespread issue you want to tell everyone about, be it a delay or some kind of technical issues.

    The expected format of data looks like this:

      const broadcast = { message: 'Currently experiencing technical difficulties' }
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "message": "Currently experiencing technical difficulties"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the broadcast route.

    This endpoint posts a livestream broadcast to the supplied livestream.

    HTTP Request

    POST/PUT https://api.staylive.tv/livestreams/message/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to post the message on

    Update a broadcast to a livestream

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    message A message that will be shown to everyone watching the livestream String Yes

    This endpoint is used if there is some kind of widespread issue you want to tell everyone about, be it a delay or some kind of technical issues.

    The expected format of data looks like this:

      const broadcast = { message: 'Currently experiencing technical difficulties' }
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "message": "Currently experiencing technical difficulties"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the broadcast route.

    This endpoint posts a livestream broadcast to the supplied livestream.

    HTTP Request

    PUT https://api.staylive.tv/livestreams/message/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to update the message on

    Get the broadcast message from a livestream

    This endpoint is used to get the broadcast message tied to a livestream

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made by a normal user

    {
        "message": [
            {
                "message": "Currently experiencing technical difficulties"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is all the broadcast messages tied to a livestream.

    This endpoint retrieves all livestream broadcasts from the supplied livestream.

    HTTP Request

    GET https://api.staylive.tv/livestreams/message/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to get the message from

    Delete a livestream from a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, restricted production company, company and statistics

    Response to a request made by a user with owner status on the channel

    {
        "message": "The livestream 'New original livestream' has been deleted from the channel Årsta pojkarna",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the livestream has been deleted from the channel

    This endpoint delete a livestream from the supplied channel.

    HTTP Request

    DELETE https://api.staylive.tv/livestreams/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to delete

    Default livestream values

    Create a default livestream value for future livestreams

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Vod If the recorded livestream is going to be made into a video Boolean No
    Ads If advertisements will be able to be played during the livestream Boolean No
    Private If the livestream is going to be set to private Boolean No
    Chat If the livestream is going to have a chat Boolean No
    campaign The ID of the campaign the livestream will be part of Integer No
    Price The price of the livestream Integer No
    Channel The channel the livestream will be livestreamed on Integer No

    Creating a default livestream value is made possible to make it easier for creators to have the same values for every livestream.

    The expected format of data looks like this:

      const default_value = { vod: false, ads: true, private: false, chat: false, campaign: true, price: 69, channel: 2 }
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 5,
                "vod": 0,
                "ads": 1,
                "private": 0,
                "price": 69,
                "chat": 0,
                "channel": 2,
                "created_at": "2018-05-31T08:00:41.000Z",
                "updated_at": "2018-05-31T08:00:41.000Z",
                "campaign": 1
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the default values route.

    This endpoint creates a live source on the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/default/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the live source on
    Path The path of the channel to post the live source on

    Update live source data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String No
    StreamID The stream ID of the camera String No

    The category system follows a hierarchy where categories can be sub categories to a category that is a sub category to another category. There is, however, always an end to the categories. The end parent category is the one with a parent set as '0'. A category can not have a parent that is part of their subcategories, nor can it set a parent category that references one of the subcategories of the category. If this happens, the request is denied and the reasoning is supplied.

    The expected format of data looks like this:

    const default_value = { campaign: 3, price: 95, channel: 4 }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 5,
                "vod": 0,
                "ads": 1,
                "private": 0,
                "price": 95,
                "chat": 0,
                "channel": 4,
                "created_at": "2018-05-31T08:00:41.000Z",
                "updated_at": "2018-05-31T08:03:09.000Z",
                "campaign": 3
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the live-sources route.

    This endpoint updates an existing live source.

    HTTP Request

    URL Parameters

    PUT https://api.staylive.tv/livestreams/sources/<ID>

    Parameter Description
    ID The ID of the live source to update

    Get the default values

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made with a header json { "message": [ { "id": 5, "vod": 0, "ads": 1, "private": 0, "price": 69, "chat": 0, "channel": 2, "created_at": "2018-05-31T08:00:41.000Z", "updated_at": "2018-05-31T08:00:41.000Z", "campaign": 1 } ], "statuscode": 200, "success": true }

    Returns

    When the request gets a response the response includes all of the information about the specified live source.

    This endpoint retrieves all data about a live source.

    HTTP Request

    GET https://api.staylive.tv/default/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to retrieve information from

    Livestream tag

    Create a livestream tag on a channel

    A livestream can have multiple tags, and a tag can have multiple livestreams.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the tag String Yes
    Parent The parent categories ID Number No

    The tags are made in a way to decrease the amount of articles in the database. A tag is not owned by one channel, when a channel creates a tag, everyone can tag their own livestreams and come up in those tag searches. If a channel deletes a livestream that is the last referenced object to a specific tag, the tag is deleted. Because of this logic, there is no way to edit an already created tag, if you want to change the tag, you will have to delete it and create a new one. A tag in the database also references both the livestream and livestream version of the media. E.g if a livestream is uploaded with the tag "Fotbollskuppen", and is then made into a VOD, video on demand, the video keeps the "Fotbollskuppen"-tag, unless explicitly told not to.

    The expected format of data looks like this:

      const tag = {name: 'Bandy final'}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": {
            "id": 1,
            "name": "Edsbyn vs Villa",
            "description": "0",
            "streamid": "0",
            "channel": 2,
            "price": 100,
            "start": null,
            "end": null,
            "dvr": 0,
            "private": 0,
            "stats": 0,
            "vod": 0,
            "server": "0",
            "ads": 0,
            "campaign": 0,
            "requires_login": 1,
            "created_by": "Christoffer Owner",
            "chat": 0,
            "created_at": "2018-05-30T05:50:05.000Z",
            "updated_at": "2018-05-30T05:50:05.000Z",
            "stream_sources": 0,
            "channelName": "Stockholms Bandyklubb",
            "viewers": 120,
            "tags": [
                {
                    "name": "Bandy final"
                }
            ],
            "categories": [
                {
                    "name": "Bandy Category"
                }
            ],
            "errorMessage": ""
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the livestreams route.

    This endpoint creates a tag on the supplied livestream.

    HTTP Request

    POST https://api.staylive.tv/livestreams/tags/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to post the category on

    Get a livestream tag

    A tag can contain livestreams from several channels. The tag also contains videos, to see how to access videos please see the videos tag header. If you want to find out how to get a mix of livestreams and videos, please see the Mixed tags header.

    Role required

    This route requires no special access to get data back.

    Response to a request made with no header

    {
        "message": [
            {
                "name": "New original livestream"
            },
            {
                "name": "Old original livestream"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes the livestreams that are tagged with the requested tag.

    This endpoint retrieves a tag and all livestreams with the tag.

    HTTP Request

    GET https://api.staylive.tv/livestreams/tags/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tag to retrieve livestreams.

    Delete a livestream tag from a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel and with a tag that only has 1 video/livestream left connected to it

    {
        "message": "Tag with name Fotbollskuppen, has been deleted",
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel and with a tag that has several videos/livestreams connected to it

    {
        "message": "Relation with tag Fotbollskuppen has been removed",
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel and with a tag that has several videos/livestreams connected to it and the source livestream is still connected

    {
        "message": "Tag relation has been removed",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the livestream has been deleted from the livestream. The responses may vary depending on how much was deleted.

    This endpoint deletes a tag.

    HTTP Request

    POST https://api.staylive.tv/livestreams/tag/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the tag to delete

    Livestream Chapter

    Create a chapter on a livestream

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String Yes
    Time The time stamp for the start of the chapter String Yes

    The timestamp needs to be formatted correctly to work. There are two ways to format it. Either 11:01:01, or 1:01:01 is accepted.

    The expected format of data looks like this:

      const chapter = {name: 'Highlights för Hammarby vs AIK', time: '11:11:11'}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 2,
                "livestream": 2,
                "time": "21:21:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Goal"
            },
            {
                "id": 3,
                "livestream": 2,
                "time": "21:26:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Self-goal"
            },
            {
                "id": 6,
                "livestream": 2,
                "time": "11:11:11",
                "created_at": "2018-05-30T10:49:47.000Z",
                "name": "Highlights för Hammarby vs AIK"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint creates a chapter to the supplied livestream.

    HTTP Request

    POST https://api.staylive.tv/livestreams/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to post the chapter on

    Update chapter data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the chapter String No
    Time The time stamp for the start of the chapter String No

    The timestamp needs to be formatted correctly to work. There are two ways to format it. Either 11:01:01, or 1:01:01 is accepted.

    The expected format of data looks like this:

      const chapter = {name: 'Highlights'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 3,
                "livestream": 2,
                "time": "21:26:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "Self-goal"
            },
            {
                "id": 4,
                "livestream": 2,
                "time": "21:31:11",
                "created_at": "2018-05-30T05:50:05.000Z",
                "name": "header-goal"
            },
            {
                "id": 6,
                "livestream": 2,
                "time": "11:11:11",
                "created_at": "2018-05-30T10:49:47.000Z",
                "name": "Highlights "
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint updates an existing chapter.

    HTTP Request

    PUT https://api.staylive.tv/livestreams/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the chapter to update

    Get all chapters from a livestream

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    Response to a request made with no header

    {
        "message": [
            {
                "id": 1,
                "livestream": 2,
                "time": "11:11:11",
                "date": null,
                "name": "Epic chapter"
            },
            {
                "id": 6,
                "livestream": 2,
                "time": "1:01:12",
                "date": null,
                "name": "A new chapter"
            },
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes all the chapters that has been linked to the selected livestream.

    This endpoint retrieves all chapters from a livestream.

    HTTP Request

    GET https://api.staylive.tv/livestreams/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to retrieve chapters from

    Delete a chapter from a livestream

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "The chapter 'New cool chapter', with ID 6 has been deleted from the livestream 'paid livestream'",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the chapter has been deleted from the livestream

    This endpoint delete a chapter from the supplied livestream.

    HTTP Request

    DELETE https://api.staylive.tv/livestreams/chapters/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the chapter to delete

    Livestream feed

    Get all livestreams from a channel

    The user can supply IDs in two ways, if the user only wants one channels full feed they can go via the route /livestreams/feed/1. If the user wants several channels feeds, they can send in a header with the name "X-STAYLIVE-CHANNELS" with the ID's of the channels they want to access. They will get more information from the videos connected to the channels they own.

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, statistics, company and statistics

    As an owner you get access to the viewers of every stream that is included in the feed, that is owned by owner.

    Response to a request made with no header and a channel in params

    {
        "message": [
            {
                "id": 4,
                "name": "Edsbyn vs Bollnäs",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "id": 8,
                "name": "Edsbyn VERSUS Villa",
                "price": 0,
                "description": "A game featuring Edsbyn vs Villa",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Stockholms Bandyklubb"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 2
        }
    }
    

    Response to a request made by a user with owner status on the channel with channel in params

    {
        "message": [
            {
                "viewers": 0,
                "id": 9,
                "name": "Edsbyn VERSUS Villa",
                "description": "A game featuring Edsbyn vs Villa",
                "streamid": "spb9s9yx",
                "channel": 2,
                "price": 0,
                "start": null,
                "end": null,
                "dvr": 0,
                "private": 0,
                "stats": 0,
                "vod": 0,
                "server": "0",
                "ads": 0,
                "campaign": 0,
                "requires_login": 0,
                "created_by": "Christoffer Developer",
                "chat": 0,
                "created_at": "2018-05-30T13:09:39.000Z",
                "updated_at": "2018-05-30T13:09:39.000Z",
                "stream_sources": 0,
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "viewers": 270,
                "id": 4,
                "name": "Edsbyn vs Bollnäs",
                "description": "0",
                "streamid": "0",
                "channel": 2,
                "price": 0,
                "start": null,
                "end": null,
                "dvr": 0,
                "private": 0,
                "stats": 0,
                "vod": 0,
                "server": "0",
                "ads": 0,
                "campaign": 0,
                "requires_login": 0,
                "created_by": "Christoffer Developer",
                "chat": 0,
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "stream_sources": 0,
                "channelName": "Stockholms Bandyklubb"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 2
        }
    }
    

    Response to a request made with a header that contains 2 channels

    {
        "message": [
            {
                "id": 8,
                "name": "Edsbyn VERSUS Villa",
                "price": 0,
                "description": "A game featuring Edsbyn vs Villa",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "id": 3,
                "name": "Sigtuna vs Haninge",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Västerhaninge boys"
            },
            {
                "id": 4,
                "name": "Edsbyn vs Bollnäs",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Stockholms Bandyklubb"
            },
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 3
        }
    }
    

    Response to a request made by a user with owner status on the channel with a header including several channels, some not owned by the user

      {
        "message": [
            {
                "id": 2,
                "name": "Sigtuna vs Haninge",
                "price": 0,
                "description": "0",
                "campaign": 0,
                "start": null,
                "end": null,
                "channelName": "Västerhaninge boys"
            },
            {
                "viewers": 270,
                "id": 4,
                "name": "Edsbyn vs Bollnäs",
                "description": "0",
                "streamid": "0",
                "channel": 2,
                "price": 0,
                "start": null,
                "end": null,
                "dvr": 0,
                "private": 0,
                "stats": 0,
                "vod": 0,
                "server": "0",
                "ads": 0,
                "campaign": 0,
                "requires_login": 0,
                "created_by": "Christoffer Owner",
                "chat": 0,
                "currency": "SEK",
                "draft": 1,
                "created_at": "2018-05-30T05:50:05.000Z",
                "updated_at": "2018-05-30T05:50:05.000Z",
                "stream_sources": 0,
                "channelName": "Stockholms Bandyklubb"
            },
            {
                "viewers": 0,
                "id": 9,
                "name": "Edsbyn VERSUS Villa",
                "description": "A game featuring Edsbyn vs Villa",
                "streamid": "spb9s9yx",
                "channel": 2,
                "price": 0,
                "start": null,
                "end": null,
                "dvr": 0,
                "private": 0,
                "stats": 0,
                "vod": 0,
                "server": "0",
                "ads": 0,
                "campaign": 0,
                "requires_login": 0,
                "currency": "SEK",
                "draft": 0,
                "created_by": "Christoffer Owner",
                "chat": 0,
                "created_at": "2018-05-30T13:09:39.000Z",
                "updated_at": "2018-05-30T13:09:39.000Z",
                "stream_sources": 0,
                "channelName": "Stockholms Bandyklubb"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 3
        }
      }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the requested channel. This endpoint retrieves a livestream feed from a channel.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    HTTP Request

    GET https://api.staylive.tv/livestreams/feed/<ID>?draft=1&archive=true&limit=20&page=3

    URL Parameters

    Parameter Description
    ID The ID of the channel to retrieve the livestream feed from
    Draft If the user has higher level access to a selected channel, they may see drafts that are otherwise hidden by default. This is not a required query, but can be reached by setting draft as '1'.
    Archive If the channels has no planned livestreams, the result will be empty unless you specify that archived livestreams are also of interest by setting archive=true in the parameters. Archive takes a boolean value (true/false) and will return all livestreams from the channels, ended or upcoming.
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 10, which results in 10 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-10 as a response, but want to access 11-20, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 11-20.

    Create a livestream heartbeat

    A heartbeat can be created both as a user and a non-user. A user gets more information saved, like user ID.

    This route is used to create statistics over the amount of current viewers, total unique viewers and total viewers overall on the livestream.

    Role required

    No special role is required to access this route and no extra data can be gained by accessing the route with a high level role.

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": "Heartbeat added to livestream!",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data confirms there's been an added heartbeat to the livestream.

    This endpoint creates a heartbeat to the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/livestreams/heartbeat/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream to add a heartbeat to

    Video based

    Create a VOD from a livestream

    This route creates values for a livestream that will turn into a video after the livestream is over. The tags used on the livestream, will be put on the video when it is published, unless that option is turned off.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the video String Yes
    Price The price of the video Integer No
    Description The description of the video String No

    The expected format of data looks like this:

      const video = {name: 'VOD Hammarby vs AIK', description: 'A classic matchup in football', price: 200}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 1,
                "name": "VOD Hammarby vs AIK",
                "description": "A classic matchup in football",
                "price": 200,
                "ads": 0,
                "campaign": 0,
                "private": 0,
                "created_at": "2018-05-31T13:45:10.000Z",
                "updated_at": "2018-05-31T13:45:10.000Z",
                "stream": 1
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the replay route.

    This endpoint inserts values for a replay of the given livestream.

    HTTP Request

    POST https://api.staylive.tv/livestream/replay/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the livestream that the video will be made from

    Get a specific replay

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 1,
                "name": "free video",
                "description": "0",
                "price": 0,
                "ads": 0,
                "campaign": 0,
                "private": 0,
                "created_at": "2019-05-15T10:03:16.000Z",
                "updated_at": null,
                "stream": 1,
                "category": null
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data given is the VOD from an already livestreamed livestream. The data returned is basic data from the video.

    This endpoint retrieves a VOD.

    HTTP Request

    GET https://api.staylive.tv/livestream/replay/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the VOD to retrieve

    Update VOD info

    This route updates values for a livestream that will turn into a video after the livestream is over. The tags used on the livestream, will be put on the video when it is published, unless that option is turned off.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the video String No
    Price The price of the video Integer No
    Description The description of the video String No

    The expected format of data looks like this:

      const video = {name: 'VOD Hammarby vs AIK', description: 'A classic matchup in football', price: 200}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 1,
                "name": "VOD Hammarby vs AIK",
                "description": "A classic matchup in football",
                "price": 200,
                "ads": 0,
                "campaign": 0,
                "private": 0,
                "created_at": "2018-05-31T13:45:10.000Z",
                "updated_at": "2018-05-31T13:45:10.000Z",
                "stream": 1
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the replay route.

    This endpoint inserts values for a replay of the given livestream.

    HTTP Request

    URL Parameters

    PUT https://api.staylive.tv/livestream/replay/<ID>

    Parameter Description
    ID The ID of the VOD to be updated with new data

    Packages

    Create a package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The videos and livestreams are separated by commas. If you do not have heightened access to a livestream or video, they will not be connected to the package and the package will still be created.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the video.

    For videos that may have an international audience, you have the option to include translations and special prices. Translations change the name and description of the video for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the package String Yes
    Livestreams ID of livestreams, separated by commas String No
    Videos ID of videos, separated by commas String No
    Description The description of the package String No
    Price Price of the package Integer No
    Currency What currency the package will be set as, see accepted currencies under #Currency String No
    special_prices An array with objects in it for prices in different countries Array No
    translations An array with objects in it for translations in different countries Array No

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The expected format of data looks like this:

      const package = { name: 'Test package', description: 'Packages for bandy', price: 20, currency: 'SEK'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "channel": 2,
            "ID": 5,
            "deleted": 0,
            "selling": 0,
            "price": 0,
            "created_by": "admin vanilla admin",
            "name": "test package",
            "description": "0",
            "created_at": "2019-08-21T11:01:57.000Z",
            "updated_at": null,
            "currency": "SEK",
            "translations": [
                {
                    "name": "new package",
                    "description": "New description",
                    "event": 5,
                    "language": "EN",
                    "created_by": 106
                },
                {
                    "name": "Nytt paket",
                    "description": "En beskrivning på svenska",
                    "event": 5,
                    "language": "swe",
                    "created_by": 106
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the channels package route.

    This endpoint creates a package

    HTTP Request

    POST https://api.staylive.tv/packages/channel/ID

    URL Parameters

    Parameter Description
    ID The ID of channel to post the package to

    Update a package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The videos and livestreams are separated by commas. If you do not have heightened access to a livestream or video, they will not be connected to the package and the package will still be created.

    For videos that may have an international audience, you have the option to include translations and special prices. Translations change the name and description of the video for users that have that language selected. Language is decided by the header "Content-Language" and the header looks like this: "EN/US", where the first shorthand is the language and the second one is the country of origin.

    You can create multiple translations and special prices at once, supply the key with an array of objects with translations and special prices and those will be created and tied to the video.

    To reset the translations and special prices, you submit their respective keys as empty arrays. Works the same way as tag removal, where you need to include all of the translations and special prices in order for it to included for the video.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the package String No
    Livestreams ID of livestreams, separated by commas String No
    Videos ID of videos, separated by commas String No
    Description The description of the package String No
    Price Price of the package Integer No
    Currency What currency the package will be set as, see accepted currencies under #Currency String No
    special_prices An array with objects in it for prices in different countries Array No
    translations An array with objects in it for translations in different countries Array No

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    Name The translation of the name String Yes Translations
    Description The translation of the description String Yes Translations

    These are the accepted keys for special_prices:

    Attributes Description Type Required Parent
    Country Country to show the specified price for String Yes special_prices
    Currency Currency to show the specified price for String Yes special_prices
    Price Price to show the specified price for Integer Yes special_prices

    The expected format of data looks like this:

      const package = {
        "name": "new package",
        "translations": []
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "channel": 2,
            "ID": 5,
            "deleted": 0,
            "selling": 0,
            "price": 0,
            "created_by": "admin vanilla admin",
            "name": "new package",
            "description": "0",
            "created_at": "2019-08-21T11:01:57.000Z",
            "updated_at": null,
            "currency": "SEK"
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the channels package route.

    This endpoint updates a package

    HTTP Request

    PUT https://api.staylive.tv/packages/ID

    URL Parameters

    Parameter Description
    ID The ID of the package to update

    Get a Specific package

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, company and statistics, company

    This route returns a package in its entirety with all of the connected livestreams and videos.

    Response to a request made by a user with owner status on the channel

    {
      "message": {
        "channel": 2,
        "ID": 1,
        "deleted": 0,
        "selling": 1,
        "price": 103,
        "created_by": "Christoffer Developer",
        "name": "Stockholms bandy",
        "description": "One of the best",
        "created_at": "2018-05-30T05:50:06.000Z",
        "updated_at": "2018-05-30T05:50:06.000Z",
        "currency": "SEK",
        "videos": [
          {
            "id": 2,
            "name": "Hammarby vs AIK VOD"
          }
        ],
        "streams": [
          {
            "id": 1,
            "name": "Hammarby vs AIK"
          }
        ]
      },
      "statuscode": 200,
      "success": true
    }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the channel that owns the requested package.

    This endpoint retrieves a package and the included livestreams and videos.

    HTTP Request

    GET https://api.staylive.tv/packages/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the package to retrieve

    Get all packages from a channel

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.
    To access extra information you need the role of: Owner, admin, company and statistics, company

    This route returns all packages tied to the channel.

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "channel": 2,
                "ID": 1,
                "deleted": 0,
                "selling": 1,
                "price": 103,
                "created_by": "Christoffer Developer",
                "name": "Stockholms Bandy",
                "description": "One of the best",
                "created_at": "2018-05-30T05:50:06.000Z",
                "updated_at": "2018-05-30T05:50:06.000Z",
                "currency": "SEK"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is an overview of all packages tied to the specified channel. This endpoint retrieves all packages from a channel.

    HTTP Request

    GET https://api.staylive.tv/packages/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to get all packages from.

    Connect a video to a package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The video and package the video gets connected to, is supplied via the URL in params. Example of this can be found below in URL parameters.

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "channel": 2,
            "ID": 1,
            "deleted": 0,
            "selling": 1,
            "price": 103,
            "created_by": "null",
            "name": "Sommarens bandy",
            "description": "Årets sommarbandy!",
            "created_at": "2018-05-30T05:50:06.000Z",
            "updated_at": "2018-05-30T05:50:06.000Z",
            "currency": "SEK",
            "videos": [
                {
                    "id": 1,
                    "name": "Första bandy matchen för säsongen"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the package route.

    This endpoint connects a video to an existing package

    HTTP Request

    POST https://api.staylive.tv/packages/<PACKAGE>/connect/video/<VIDEO>

    URL Parameters

    Parameter Description
    Package The ID of the package to connect the video to
    video The ID of the video to connect to the package

    Connect a livestream to a package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The livestream and package the livestream gets connected to, is supplied via the URL in params. Example of this can be found below in URL parameters.

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "channel": 2,
            "ID": 1,
            "deleted": 0,
            "selling": 1,
            "price": 103,
            "created_by": "null",
            "name": "Sommarens bandy",
            "description": "Årets sommar bandy!",
            "created_at": "2018-05-30T05:50:06.000Z",
            "updated_at": "2018-05-30T05:50:06.000Z",
            "currency": "SEK",
            "streams": [
                {
                    "id": 1,
                    "name": "Första bandy matchen för säsongen"
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the package route.

    This endpoint connects a livestream to an existing package

    HTTP Request

    POST https://api.staylive.tv/packages/<PACKAGE>/connect/livestream/<STREAM>

    URL Parameters

    Parameter Description
    Package The ID of the package to connect the stream to
    Stream The ID of the stream to connect to the package

    Delete a Livestream connection to package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The Livestream and package the Livestream gets connected to, is supplied via the URL in params. Example of this can be found below in URL parameters.

    Response to a request made by a user with owner status on the channel

    {
        "message": "Livestream has been removed from package",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is confirmation regarding deletion.

    This endpoint deletes a package connection from a Livestream.

    HTTP Request

    DELETE https://api.staylive.tv/packages/<PACKAGE>/connect/Livestream/<LIVESTREAM>

    URL Parameters

    Parameter Description
    Package The ID of the package to delete the connection from
    Livestream The ID of the Livestream that has the connection

    Delete a video connection to package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The video and package the video gets connected to, is supplied via the URL in params. Example of this can be found below in URL parameters.

    Response to a request made by a user with owner status on the channel

    {
        "message": "Video has been removed from package",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is confirmation regarding deletion.

    This endpoint deletes a package connection from a video.

    HTTP Request

    DELETE https://api.staylive.tv/packages/<PACKAGE>/connect/video/<VIDEO>

    URL Parameters

    Parameter Description
    Package The ID of the package to delete the connection from
    video The ID of the video that has the connection

    Update a package

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    The videos and livestreams are separated by commas. If you do not have heightened access to a livestream or video, they will not be connected to the package and the package will still be created.

    Payload

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the package String No
    Livestreams ID of livestreams, separated by commas String No
    Videos ID of videos, separated by commas String No
    Description The description of the package String No
    Price Price of the package Integer No
    Currency What currency the package will be set as, see accepted currencies under #Currency String No

    The expected format of data looks like this:

      const package = { name: 'Updated package', currency: 'EUR'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "channel": 2,
                "ID": 1,
                "deleted": 0,
                "selling": 1,
                "price": 103,
                "created_by": "null",
                "name": "Best package",
                "description": "One of the best",
                "created_at": "2019-01-09T12:58:59.000Z",
                "updated_at": null,
                "currency": "SEK"
            },
            {
                "channel": 2,
                "ID": 9,
                "deleted": 0,
                "selling": 0,
                "price": 20,
                "created_by": "Christoffer Tester",
                "name": "Updated package",
                "description": "Packages for bandy",
                "created_at": "2019-01-15T08:06:19.000Z",
                "updated_at": null,
                "currency": "EUR"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the channels package route.

    This endpoint updates a package

    HTTP Request

    PUT https://api.staylive.tv/packages/ID

    URL Parameters

    Parameter Description
    ID The ID of the package to update

    Channel based

    Get a Specific channel

    Role required

    This route requires no special access to get data back. But if the user does have heightened access, you get more data back compared to someone with a normal user role.

    To access extra information you need the role of: Owner, admin.

    Response to a request made with no header

    {
        "message": [
            {
                "name": "Årsta pojkarna",
                "id": 2
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 2,
                "name": "Årsta pojkarna",
                "tickets": 0,
                "storage": 0,
                "ticket_cost": 0,
                "storage_cost": "0",
                "transaction_fee": 0,
                "taxes": "0",
                "allow_ads": 0,
                "button_color": "0",
                "primay_color": "0",
                "text_color": "0",
                "hide_profile_image": 0,
                "google_analytics": "0",
                "expose": 0,
                "published": 0,
                "focus": 0,
                "genre": 0,
                "path": "arsta",
                "about": "0",
                "website": "0",
                "revenue": 0,
                "deleted": 0,
                "created_at": "2018-05-30T05:50:05.000Z"
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes varying levels of information depending on the access level the user has. The examples given are from the lowest level, a user that is not logged in, and the highest, a user with ownership status over the channel that is requested.

    This endpoint retrieves channel info.

    HTTP Request

    GET https://api.staylive.tv/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to retrieve

    Update channel data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required Keys
    Name The name of the channel String No None
    Path The path of the channel, is used in url String No None
    Button color Color of the channels button Hexadecimal No
    Primary color Primary color of the channels route Hexadecimal No None
    Text color Text color of the channels route Hexadecimal No None
    Translations An array with objects in it for translations in different countries Array No [{ language, about }]
    Hide profile image Boolean value that hides the profile image of the channel Boolean No None
    Expose Show the channels content in feeds relevant to the channels genre Boolean No None
    Published Gives public access to the channel Boolean No None
    Genre The ID of a genre Integer No None
    Website The channels personal website String No None
    About An about section for the channel String No None

    The payload may include some keys that require objects:

    These are the accepted keys for Translations:

    Attributes Description Type Required Parent
    Language Language the translation is based in String Yes Translations
    About The translation of the about-section String Yes Translations

    The expected format of data looks like this:

      const channel = {
        name: 'Stockholms bandyklubb',
        translations: [{ language: 'en', about: 'new about section in english' }]
      }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "id": 2,
                "name": "Stockholms bandyklubb",
                "tickets": 0,
                "storage": 0,
                "ticket_cost": 0,
                "storage_cost": "0",
                "transaction_fee": 0,
                "taxes": "0",
                "allow_ads": 0,
                "button_color": "0",
                "primary_color": "0",
                "text_color": "0",
                "hide_profile_image": 0,
                "google_analytics": "0",
                "expose": 0,
                "published": 0,
                "focus": "0",
                "path": "arsta",
                "about": "0",
                "website": "0",
                "revenue": 0,
                "deleted": 0,
                "verified": 0,
                "created_at": "2019-08-21T06:44:27.000Z",
                "translations": [
                    {
                        "about": "new about section in english",
                        "language": "en",
                        "created_by": 106
                    }
                ]
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the channel route.

    This endpoint updates channel data

    HTTP Request

    PUT https://api.staylive.tv/channel/<ID/PATH>

    URL Parameters

    Parameter Description
    ID The ID or the PATH of the channel to update
    Path The PATH of the channel to update

    Delete a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin.

    Response to a request made by a user with owner status on the channel

    {
        "message": "Channel has been deleted",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the channel has been deleted This endpoint deletes a channel.

    HTTP Request

    POST https://api.staylive.tv/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to delete

    Activate coupon

    Video and livestream coupons

    Role required

    You can only access this route with a valid login. To access this route you need the access of: user.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Coupon The coupon code you have received String Yes

    Some coupons are only eligible to be used on certain channels content. For example if your coupon is restricted to only being used on Edsbyn IF's channel, you can only use it to view one of Edsbyn IF's videos or livestreams.

    The URL to accessing coupons tells the API if you want to use your coupon on a video or livestream, and then the ID of the object you want to use the coupon on. So https://api.staylive.tv/coupons/livestream/2 tells the API you want to use the coupon you have sent in on the livestream with ID 2.

    The expected format of data looks like this:

      const coupon = {
        coupon: 'KLAJSDAKSLJ34561234',
      }
    

    Response to a request made by a user

    {
        "message": "Coupon is valid and has been used.",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to be a confirmation about the validity of the coupon, or reply that the coupon is invalid.

    This endpoint activates coupons for users

    HTTP Request

    POST https://api.staylive.tv/coupons/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    Type The type of object you want to use your coupon on, can be livestream or video.
    ID The ID of the exact object you want to use your coupon on.

    Campaign

    Post a campaign to a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the campaign String Yes

    The expected format of data looks like this:

      const campaign = {name: 'Elitbandy reklam' }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "campaigns": [
                {
                    "id": 3,
                    "name": "Elitbandy reklam",
                    "channel": 2,
                    "inserted_at": "2018-05-29T10:20:50.000Z"
                }
            ],
            "videos": "No videos found"
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the single campaign route.

    This endpoint posts a campaign to the supplied channel.

    HTTP Request

    POST https://api.staylive.tv/campaign/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the campaign to

    Get a specific campaign

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "campaigns": [
            {
                "id": 3,
                "name": "Local grocery chain",
                "channel": 2,
                "inserted_at": "2018-03-27T06:46:21.000Z"
            }
        ],
        "videos": [
            {
                "id": 1,
                "name": "Hilarious advertisement",
                "length": "00:30",
                "converted": 1,
                "size": 100,
                "inserted_at": "2018-03-27T07:25:18.000Z"
            },
            {
                "id": 2,
                "name": "Witty commercial",
                "length": "00:45",
                "converted": 1,
                "size": 320,
                "inserted_at": "2018-03-27T07:25:18.000Z"
            }
        ]
    }
    

    Returns

    The response includes all the information about the requested campaign and the videos included in the campaign.

    This endpoint retrieves a campaign and all of its videos.

    HTTP Request

    GET https://api.staylive.tv/campaign/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the campaign to retrieve

    Update campaign video data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    Attributes Description Type Required
    Name The name of the video String No

    The expected format of data looks like this:

      const campaign = {name: 'Elitbandys sommarkampanj'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "campaigns": [
                {
                    "id": 3,
                    "name": "Elitbandys sommarkampanj",
                    "channel": 2,
                    "inserted_at": "2018-05-29T10:24:24.000Z"
                }
            ],
            "videos": "No videos found"
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the single campaign route.

    This endpoint updates a campaign.

    HTTP Request

    PUT https://api.staylive.tv/campaign/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the campaign to update

    Delete a campaign to a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "Commercial has been deleted along with 2 video links",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is a confirmation about the deletion and the amount of video campaign links that got removed.

    This endpoint deletes a campaign and all the video link ties to the campaign. It does not delete the uploaded videos on the supplied channel.

    HTTP Request

    DELETE https://api.staylive.tv/campaign/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to post the campaign to

    Campaign video

    Post a video to a campaign

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the video String Yes
    Video A file upload, required to be in a video format. File Yes

    The expected format of data looks like this:

      const video = {name: 'Lokalmarknadsreklam', video: a video file}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "name": "Lokalmarknadsreklam",
                "channel": 2,
                "length": "0",
                "size": 0,
                "inserted_at": "2018-05-29T10:36:43.000Z",
                "id": 5
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the campaign-video route.

    This endpoint posts a video to the supplied campaign.

    HTTP Request

    POST https://api.staylive.tv/campaign/video/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the campaign to post the video on

    Get a specific campaign video

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "name": "New advertisement",
                "channel": 4,
                "length": "00:30",
                "size": 100,
                "inserted_at": "2018-03-27T10:40:29.000Z",
                "id": 1
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes full information about the requested campaign video.

    This endpoint retrieves a campaign video.

    HTTP Request

    GET https://api.staylive.tv/campaign/video/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to retrieve

    Update campaign data

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the video String No
    Video A file upload, required to be in a video format. File No
    Channel A channels ID Integer No

    The expected format of data looks like this:

      const video = {name: 'Lokal marknadens reklam'}
    

    Response to a request made by a user with owner status on the channel and not changing channel

    {
        "message": [
            {
                "name": "Lokal marknadens reklam",
                "channel": 2,
                "length": "0",
                "size": 0,
                "inserted_at": "2018-05-29T10:39:48.000Z",
                "id": 2
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Response to a request made by a user with owner status on the channel and changing the channel

      const video = {name: 'Lokal marknadens reklam', channel: 3}
    
    {
        "message": [
            {
                "name": "Lokal marknadens reklam",
                "channel": 3,
                "length": "0",
                "size": 0,
                "inserted_at": "2018-05-29T10:40:23.000Z",
                "id": 2
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the single campaign route.

    This endpoint update a video to the supplied campaign.

    HTTP Request

    POST https://api.staylive.tv/campaign/video/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the campaign to post the video on

    This route makes it possible to add multiple videos to a campaign, or to empty all videos from a campaign. If you send in '1, 2, 3, 4, 5', but you only own the rights to video 4 and 5, only videos 4 and 5 will be added. If you, however, send in an empty string, the campaign will remove all videos. Whenever an update is made to the campaign video links, the server empties the campaigns videos and adds the new ones instead. If its an empty string, no videos will be added and the current videos will be removed from being linked.

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Videos ID's of videos the channel owns String separated with commas Yes

    The expected format of data looks like this:

    const videos = {videos: '1, 2, 3, 4, 5'}
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "campaign": {
                "id": 2,
                "name": "Årsta pojkarna kampanj",
                "channel": 2,
                "inserted_at": null
            },
            "videos": [
                {
                    "id": 4,
                    "name": "Årsta pojkarna kampanj 1",
                    "length": "0",
                    "converted": 0,
                    "size": 0,
                    "inserted_at": null,
                    "order_by": 0
                },
                {
                    "id": 5,
                    "name": "Årsta pojkarna kampanj 2",
                    "length": "0",
                    "converted": 0,
                    "size": 0,
                    "inserted_at": null,
                    "order_by": 1
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the single campaign route.

    This endpoint updates a campaign video links.

    HTTP Request

    PUT https://api.staylive.tv/campaign/link/video/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the campaign to update with new videos

    Delete a specific campaign video

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company

    Response to a request made by a user with owner status on the channel

    {
        "message": "Video has been deleted!",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The response will be a confirmation regarding the deletion of the video.

    This endpoint deletes a campaign video and all the links to campaigns.

    HTTP Request

    GET https://api.staylive.tv/campaign/video/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the video to delete

    Search

    Search for multiple types of objects

    This route has no filter restrictions, you search in all available types of content.

    Response to a request made by a user

    {
        "message": {
            "videos": [],
            "livestreams": [
                {
                    "name": "test stream",
                    "price": 100,
                    "description": "0",
                    "start": "2018-06-25T11:21:19.000Z",
                    "end": null,
                    "channel": 2,
                    "id": 1
                },
                {
                    "name": "test",
                    "price": 0,
                    "description": "0",
                    "start": "2018-02-25T12:21:19.000Z",
                    "end": null,
                    "channel": 2,
                    "id": 5
                },
                {
                    "name": "test",
                    "price": 0,
                    "description": "0",
                    "start": "2018-02-25T12:21:19.000Z",
                    "end": null,
                    "channel": 2,
                    "id": 6
                }
            ],
            "livestream_categories": [
                {
                    "name": "test Category",
                    "channel": 1,
                    "created_at": null,
                    "id": 1
                },
                {
                    "name": "test category",
                    "channel": 2,
                    "created_at": null,
                    "id": 233
                },
                {
                    "name": "test category",
                    "channel": 2,
                    "created_at": null,
                    "id": 234
                }
            ],
            "video_categories": [
                {
                    "name": "test Category",
                    "channel": 1,
                    "created_at": null,
                    "id": 1
                },
                {
                    "name": "test category",
                    "channel": 2,
                    "created_at": null,
                    "id": 233
                },
                {
                    "name": "test category",
                    "channel": 2,
                    "created_at": null,
                    "id": 234
                }
            ],
            "tags": [],
            "channels": []
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to return search data from multiple types of content.

    This endpoint makes general searches.

    HTTP Request

    GET https://api.staylive.tv/search_all?query=<TERM>&start=<DATE>&stop=<DATE>&limit=30&page=2

    URL Parameters

    Parameter Description
    Term Is the term to search for. No restrictions. If multiple words is to be searched, the correct way of doing it is having a + sign in between the words, '/search_all?query=test+stream'. It will be accepted as a space between the words.
    Start This parameter is not required. This parameter sets a start date from where the searches are made, if the dates are in any way relevant to the search. Examples of searches being affected are: video upload dates and livestream start dates. Example of a date is: 2017-11-21.
    Stop This parameter is not required. This parameter sets a stop date from where the searches are made, if the dates are in any way relevant to the search. Examples of searches being affected are: video upload dates and livestream start dates. Can be used in conjunction with the start parameter, to create a time range to be searched in. Example of a date is: 2017-11-21.
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 10, which results in 10 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-10 as a response, but want to access 11-20, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 11-20.

    Search for specific type of objects

    This route only allows you to search with a filter. The filter will filter out anything that isn't what you've specified, for example you can chose to only search for livestreams.

    Filters

    A query can be sent in to search with a name to find a close match in terms of name.

    The following filters can only be used for livestreams and videos.

    There are multiple filters that can be used to search for specific data.

    Start and stop allows you to search for livestreams and videos that were published during a certain period, or starting from a specific date. Both can be used individually or as a combo.

    To search for specific livestreams or videos that are tagged in a similar fashion, use the tags parameter with the tags separated by commas, and if there's a space in the tag name, use a plus sign (+). Example: https://api.staylive.tv/search/tags?tags=new+tag, this will search through all of the tagged material, livestreams AND videos and return all of them that have one or more of the tags. You don't need to use a query to search, but you can use a query to filter the search down further.

    To make a search for all livestreams that has one or more of the selected tags, the URL is: https://api.staylive.tv/search/videos?tags=new+tag, where you can change videos to streams if you want to search for livestreams instead. This brings out all the livestreams OR videos with one or more tags that was searched on.

    To search for a specific video or livestream that fit a specific tag-criteria, e.g it has all the following tags: new tag, old tag and best tag, there's the filter "alltagsrequired", which takes a boolean value and requires all tags to be tagged onto the livestream or video. So if the URL looks like this: https://api.staylive.tv/search/tags?tags=new+tag,old+tag&alltagsrequired=true, livestreams AND videos that are connected to old tag and new tag will be returned, but only if they have a connection to all of the tags.

    To only get Livestreams OR only videos, change the table to videos or streams, depending on what you want to search on. E.g: https://api.staylive.tv/search/videos?tags=new+tag&alltagsrequired=true

    Any number of filters can be combined to filter the results even further.

    Search Params

    The following objects can be searched for:

    Parameter Description
    Livestreams Searches within livestreams
    Videos Searches within Videos
    Video_categories Searches within video categories
    Livestream_categories Searches within livestream categories
    Channels Searches within channels
    Tags Searches within Tags

    https://api.staylive.tv/search/PARAMETER

    Replace parameter with the area you want to search.

    Response to a request made by a user

    {
        "message": [
            {
                "name": "test stream",
                "price": 100,
                "description": "0",
                "start": "2018-06-25T11:21:19.000Z",
                "end": null,
                "channel": 2,
                "id": 1,
                "thumbnail": "https://image.staylive.se/thumbnails/streams/1.jpg"
            },
            {
                "name": "test",
                "price": 0,
                "description": "0",
                "start": "2018-02-25T12:21:19.000Z",
                "end": null,
                "channel": 2,
                "id": 5,
                "thumbnail": "https://image.staylive.se/thumbnails/streams/5.jpg"
            },
            {
                "name": "test",
                "price": 0,
                "description": "0",
                "start": "2018-02-25T12:21:19.000Z",
                "end": null,
                "channel": 2,
                "id": 6,
                "thumbnail": "https://image.staylive.se/thumbnails/streams/6.jpg"
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 3
        }
    }
    

    Returns

    The return data is going to be filtered search results fitting the search term.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    This endpoint makes searches in specific types of content.

    HTTP Request

    GET https://api.staylive.tv/search/<TYPE>?query=<TERM>&start=<DATE>&stop=<DATE>&limit=20&page=2&tags=new+tag,old+tag,test+tag

    URL Parameters

    Parameter Description
    Type The type of content to make the search in. Searches are made available in: 'streams', 'videos', 'video_categories', 'stream_categories', 'channels', 'tags'. These are the accepted ways of writing the types. Required
    Query Is the term to search for. No restrictions. If multiple words is to be searched, the correct way of doing it is having a + sign in between the words. It will be accepted as a space between the words. Required, unless searching with tags. Can be used alongside with tags.
    Start Requires a date. This parameter sets a start date from where the searches are made, if the dates are in any way relevant to the search. Examples of searches being affected are: video upload dates and livestream start dates.
    Stop Requires a date. This parameter sets a stop date from where the searches are made, if the dates are in any way relevant to the search. Examples of searches being affected are: video upload dates and livestream start dates. Can be used in conjunction with the start parameter, to create a time range to be searched in.
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 10, which results in 10 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-10 as a response, but want to access 11-20, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 11-20.
    Tags Requires tags separated by commas and if the tag has a space in it, a plus sign to signify the space.
    Alltagsrequired A parameter query that is not required. Takes a boolean value of true/false, requires tags to be sent along as a parameter.

    Statistics

    Statistics for subscriptions

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    Subscribers are the amount of subscribers that the requested subscription has in total.

    Ended_subscriptions is the amount of subscriptions that has been cancelled and is no longer running.

    ongoing_but_ended is the amount of subscribers that still have access to the subscription, but has cancelled it.

    Response to a request made by a user

    {
        "message": {
            "subscribers": 1,
            "ended_subscriptions": 0,
            "ongoing_but_ended": 0
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to return subscription data.

    This endpoint gets subscription stats.

    HTTP Request

    GET https://api.staylive.tv/stats/subscription/ID

    URL Parameters

    Parameter Description
    ID The ID of the subscription

    Livestream feed statistics

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    The user can supply IDs in two ways, if the user only wants one channels full feed they can supply an ID at the end of the route. example: https://api.staylive.tv/livestreams/feed/stats/1. If the user wants several channels feeds, they can send in a header with the name "X-STAYLIVE-CHANNELS" with the ID's of the channels they want to access. They will ONLY get data back from the channels they have high enough access to.

    Buyers is the total amount of buyers the specific livestream has. This counts packages sold, PPV sold and subscriptions sold. viewer_peak is the peak viewers the livestream had during its airing. viewers is the total amount of viewers. viewMinutes is the total amount of time spent watching the livestream, if one viewer watches the livestream for 30 minutes and another viewer watches it for 5 minutes, the total viewMinutes are 35 minutes. ppv is pay per view, and shows the amount of people who has bought the specific livestream. subscription is the amount of people who has access to the livestream through subscriptions packages is the amount of people who has access to the livestream through package deals. View sources gives you an idea of where people have had access to the livestream. There may be 30 people with access to the livestream through subscriptions, but only 5 people watched the livestream with access through the subscription. This collected data tells you where the viewers got the access from, be it PPV, a subscription or a package deal. The total data at the end shows the unique viewers that has watched all of the livestreams, total amount of time spent watching the livestreams and total buyers. Also shows how the viewers got access to the livestreams.

    There are multiple queries that can be used to pinpoint data better. The queries will be described in depth in the following paragraphs.

    The start query is a date used to create a custom set range of dates to check livestreams that had their end date within the time range. If no start date is given, the default value is set to be 1 month before todays date. Example: https://api.staylive.tv/livestreams/feed/stats/1?start=2010-01-01, this will give you a feed of data from the channel with ID 1. The included livestreams will have end dates ranging from 2010-01-01 to todays date. If a stop date is not supplied, the stop date will be set as todays date.

    The stop query is a date used to create a custom set range of dates to check livestreams that had their end date within the time range. If no stop date is given, the default value is todays date. Example: https://api.staylive.tv/livestreams/feed/stats/1?stop=2010-01-01, this will give you a feed of data from the channel with ID 1. The included livestreams will have end dates ranging from 2010-01-01 to todays date. If a start date is not supplied, the start date will be set as 30 days before the given date.

    Limit is the limit of livestreams returned. Example of it used: https://api.staylive.tv/livestreams/feed/stats/1?limit=12, will bring out 12 livestreams (if enough data exists, otherwise it will just return the amount of livestreams that exist).

    Page is an indicator of the page that the livestreams are on. https://api.staylive.tv/livestreams/feed/stats/1?page=2. The default limit, if no limit is provided, is 10. So if you have 20 livestreams, you will by default get the 10 first livestreams in return. If you want livestreams 11 through 20, you'll have to set the page as 2, to get the next page.

    Query Description Required
    Start A start date for livestreams No
    Stop A stop date for livestreams No
    Limit A limit on the amount of livestreams returned No
    Page The page to show No

    Response to a request made by a user

    {
        "message": [
            {
                "livestreams": [
                    {
                        "channelName": "Årsta pojkarna",
                        "firstname": "Complete",
                        "lastname": "Company",
                        "price": 0,
                        "channelid": 2,
                        "name": "drafted owned stream",
                        "description": "0",
                        "start": "2018-11-25T12:21:19.000Z",
                        "end": "2018-08-25T11:21:19.000Z",
                        "id": 11,
                        "buyers": 0,
                        "viewer_peak": 0,
                        "viewers": 0,
                        "viewMinutes": 0,
                        "ppv": 0,
                        "subscription": 0,
                        "packages": 0,
                        "thumbnail": "https://image.staylive.se/thumbnails/streams/11.jpg",
                        "channelImage": "https://image.staylive.se/profiles/2/profile.png",
                        "viewersSources": [
                            {
                                "source": "PPV",
                                "amount": 0,
                                "id": 1
                            },
                            {
                                "source": "Subscriber",
                                "amount": 0,
                                "id": 2
                            },
                            {
                                "source": "Packages",
                                "amount": 0,
                                "id": 3
                            }
                        ]
                    },
                    {
                        "channelName": "Årsta pojkarna",
                        "firstname": "Christoffer",
                        "lastname": "Owner",
                        "price": 100,
                        "channelid": 2,
                        "name": "test stream",
                        "description": "0",
                        "start": "2018-10-25T11:21:19.000Z",
                        "end": "2018-01-25T22:21:19.000Z",
                        "id": 1,
                        "buyers": 2,
                        "viewer_peak": 398,
                        "viewers": 0,
                        "viewMinutes": 0,
                        "ppv": 0,
                        "subscription": 0,
                        "packages": 0,
                        "thumbnail": "https://image.staylive.se/thumbnails/streams/1.jpg",
                        "channelImage": "https://image.staylive.se/profiles/2/profile.png",
                        "viewersSources": [
                            {
                                "source": "PPV",
                                "amount": 0,
                                "id": 1
                            },
                            {
                                "source": "Subscriber",
                                "amount": 0,
                                "id": 2
                            },
                            {
                                "source": "Packages",
                                "amount": 0,
                                "id": 3
                            }
                        ]
                    },
                ],
                "totals": {
                    "unique_viewers": 0,
                    "viewMinutes": 0,
                    "buyers": 2,
                    "viewersSources": [
                        {
                            "source": "PPV",
                            "amount": null,
                            "id": 1
                        },
                        {
                            "source": "Subscriber",
                            "amount": null,
                            "id": 2
                        },
                        {
                            "source": "Packages",
                            "amount": null,
                            "id": 3
                        }
                    ]
                }
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 1
        }
    }
    

    Returns

    The return data is going to return livestream data from one or several channels.

    This endpoint gets multiple channels livestream data.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    The data that is limited is the amount of livestreams returned.

    HTTP Request

    GET https://api.staylive.tv/livestreams/feed/stats/<?ID>?limit=20&page=1

    URL Parameters

    Parameter Description
    ID The ID of the channel, not mandatory as a header called "X-STAYLIVE-CHANNELS" can be sent instead, giving you access to several channels worth of data.
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 15, which results in 15 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-15 as a response, but want to access 16-30, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 16-30.

    Interval statistics for specific livestreams

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    created_at is when the livestream was created.

    Response to a request made by a user with the role admin

    [
        {
            "created_at": "2019-01-09T12:58:58.000Z",
            "newPurchases": 2,
            "purchases": 2
        }
    ]
    

    Returns

    The return data is going to return livestream statistics data.

    This endpoint gets livestream stats.

    HTTP Request

    GET https://api.staylive.tv/livestreams/stats/ID

    URL Parameters

    Parameter Description
    ID The ID of the livestream

    Statistics for specific livestreams

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    timeWatched is the total time watched by all of the viewers. viewers is the total amount of unique viewers. maxFps is the highest amount of frames per seconds the livestream had. minFps is the minimum amount of frames per seconds the livestream had averageFPS is the average amount of frames per seconds the livestream had. maxBitrate is the highest amount of bitrate the livestream had. minBitrate is the minimum amount of bitrate the livestream had. averageBitrate is the average amount of bitrate the livestream had average is the average view time per viewer platforms is the device the viewers used. Example: windows, mac or android. browser is the browser the viewers use. Example: chrome, safari or Edge.

    Response to a request made by a user

    {
        "message": {
            "total": {
                "timeWatched": 1230,
                "viewers": 0,
                "maxFps": 471,
                "minFps": 47,
                "maxBitrate": 1293.6,
                "minBitrate": 123.6,
                "averageBitrate": 666.9333333333333,
                "averageFPS": 246,
                "average": null,
                "platforms": [],
                "browser": []
            },
            "dataPoints": [],
            "viewPoints": [
                {
                    "date": "2018-05-14T18:19:23.000Z",
                    "viewers": 55
                },
                {
                    "date": "2018-05-14T08:04:07.000Z",
                    "viewers": 393
                },
                {
                    "date": "2018-05-14T00:17:18.000Z",
                    "viewers": 33
                },
                {
                    "date": "2018-05-15T14:50:35.000Z",
                    "viewers": 212
                },
                {
                    "date": "2018-05-15T22:23:17.000Z",
                    "viewers": 9
                },
                {
                    "date": "2018-05-15T04:16:56.000Z",
                    "viewers": 355
                },
                {
                    "date": "2018-05-16T09:48:56.000Z",
                    "viewers": 313
                },
                {
                    "date": "2018-05-15T19:06:29.000Z",
                    "viewers": 377
                },
                {
                    "date": "2018-05-14T22:00:21.000Z",
                    "viewers": 305
                },
                {
                    "date": "2018-05-14T14:13:15.000Z",
                    "viewers": 268
                },
                {
                    "date": "2018-05-14T15:52:38.000Z",
                    "viewers": 398
                },
                {
                    "date": "2018-05-15T13:33:01.000Z",
                    "viewers": 251
                },
                {
                    "date": "2018-05-15T13:08:25.000Z",
                    "viewers": 303
                },
                {
                    "date": "2018-05-15T13:22:29.000Z",
                    "viewers": 18
                },
                {
                    "date": "2018-05-15T18:17:58.000Z",
                    "viewers": 123
                },
                {
                    "date": "2018-05-14T19:23:18.000Z",
                    "viewers": 292
                },
                {
                    "date": "2018-05-14T16:42:09.000Z",
                    "viewers": 139
                },
                {
                    "date": "2018-05-14T21:59:28.000Z",
                    "viewers": 96
                },
                {
                    "date": "2018-05-14T09:57:11.000Z",
                    "viewers": 339
                },
                {
                    "date": "2018-05-14T17:14:34.000Z",
                    "viewers": 306
                },
                {
                    "date": "2018-05-15T12:15:16.000Z",
                    "viewers": 375
                },
                {
                    "date": "2018-05-15T21:49:02.000Z",
                    "viewers": 79
                },
                {
                    "date": "2018-05-15T19:46:07.000Z",
                    "viewers": 349
                },
                {
                    "date": "2018-05-14T00:20:02.000Z",
                    "viewers": 125
                },
                {
                    "date": "2018-05-15T08:43:08.000Z",
                    "viewers": 397
                },
                {
                    "date": "2018-05-14T05:58:18.000Z",
                    "viewers": 318
                },
                {
                    "date": "2018-05-14T15:51:51.000Z",
                    "viewers": 271
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to return livestream statistics data.

    This endpoint gets livestream stats.

    HTTP Request

    GET https://api.staylive.tv/livestreams/stats/ID

    URL Parameters

    Parameter Description
    ID The ID of the livestream

    Video feed statistics

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    The user can supply IDs in two ways, if the user only wants one channels full feed they can supply an ID at the end of the route. example: https://api.staylive.tv/videos/feed/stats/1. If the user wants several channels feeds, they can send in a header with the name "X-STAYLIVE-CHANNELS" with the ID's of the channels they want to access. They will ONLY get data back from the channels they have high enough access to.

    Buyers is the total amount of buyers the specific video has. This counts packages sold, PPV sold and subscriptions sold. viewer_peak is the peak viewers the video had during its airing. viewers is the total amount of viewers. viewMinutes is the total amount of time spent watching the video, if one viewer watches the video for 30 minutes and another viewer watches it for 5 minutes, the total viewMinutes are 35 minutes. ppv is pay per view, and shows the amount of people who has bought the specific video. subscription is the amount of people who has access to the video through subscriptions packages is the amount of people who has access to the video through package deals. engagement is the amount of the video watched, in percent. So if a person views 30 seconds of a 1 minute long video, its 50% engagement. View sources gives you an idea of where people have had access to the video. There may be 30 people with access to the video through subscriptions, but only 5 people watched the video with access through the subscription. This collected data tells you where the viewers got the access from, be it PPV, a subscription or a package deal. The total data at the end shows the unique viewers that has watched all of the videos, total amount of time spent watching the videos and total buyers. Also shows how the viewers got access to the videos.

    There are multiple queries that can be used to pinpoint data better. The queries will be described in depth in the following paragraphs.

    The start query is a date used to create a custom set range of dates to check videos that had their publish date within the time range. If no start date is given, the default value is set to be 1 month before todays date. Example: https://api.staylive.tv/videos/feed/stats/1?start=2010-01-01, this will give you a feed of data from the channel with ID 1. The included videos will have publish dates ranging from 2010-01-01 to todays date. If a stop date is not supplied, the stop date will be set as todays date.

    The stop query is a date used to create a custom set range of dates to check videos that had their publish date within the time range. If no stop date is given, the default value is todays date. Example: https://api.staylive.tv/videos/feed/stats/1?stop=2010-01-01, this will give you a feed of data from the channel with ID 1. The included videos will have publish dates ranging from 2010-01-01 to todays date. If a start date is not supplied, the start date will be set as 30 days before the given date.

    Limit is the limit of videos returned. Example of it used: https://api.staylive.tv/videos/feed/stats/1?limit=12, will bring out 12 videos (if enough data exists, otherwise it will just return the amount of videos that exist).

    Page is an indicator of the page that the videos are on. https://api.staylive.tv/videos/feed/stats/1?page=2. The default limit, if no limit is provided, is 10. So if you have 20 videos, you will by default get the 10 first videos in return. If you want videos 11 through 20, you'll have to set the page as 2, to get the next page.

    Query Description Required
    Start A start date for videos No
    Stop A stop date for videos No
    Limit A limit on the amount of videos returned No
    Page The page to show No

    Response to a request made by a user

    {
        "message": [
            {
              "videos": [
                  {
                      "channelName": "Årsta pojkarna",
                      "size": 0,
                      "duration": "0",
                      "firstname": "Christoffer",
                      "lastname": "Owner",
                      "price": 0,
                      "channelid": 2,
                      "name": "really@fakeEmailThatDontExist.com",
                      "description": "0",
                      "created_at": "2019-01-09T14:42:40.000Z",
                      "id": 11,
                      "viewers": 0,
                      "viewMinutes": 0,
                      "buyers": 0,
                      "average_viewer_engagement": 0,
                      "thumbnail": "https://image.staylive.se/thumbnails/videos/11.jpg",
                      "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                  },
                  {
                      "channelName": "Årsta pojkarna",
                      "size": 0,
                      "duration": "0",
                      "firstname": "Christoffer",
                      "lastname": "Owner",
                      "price": 98,
                      "channelid": 2,
                      "name": "drafted owned vid",
                      "description": "0",
                      "created_at": "2019-01-09T12:58:58.000Z",
                      "id": 8,
                      "viewers": 0,
                      "viewMinutes": 0,
                      "buyers": 0,
                      "average_viewer_engagement": 0,
                      "thumbnail": "https://image.staylive.se/thumbnails/videos/8.jpg",
                      "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                  },
                  {
                      "channelName": "Årsta pojkarna",
                      "size": 0,
                      "duration": "0",
                      "firstname": "Christoffer",
                      "lastname": "Owner",
                      "price": 0,
                      "channelid": 2,
                      "name": "cool video",
                      "description": "0",
                      "created_at": "2019-01-09T12:58:58.000Z",
                      "id": 4,
                      "viewers": 91,
                      "viewMinutes": 2589,
                      "buyers": 0,
                      "average_viewer_engagement": 0,
                      "thumbnail": "https://image.staylive.se/thumbnails/videos/4.jpg",
                      "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                  },
                  {
                      "channelName": "Årsta pojkarna",
                      "size": 0,
                      "duration": "0",
                      "firstname": "Christoffer",
                      "lastname": "Owner",
                      "price": 0,
                      "channelid": 2,
                      "name": "new video",
                      "description": "0",
                      "created_at": "2019-01-09T12:58:58.000Z",
                      "id": 3,
                      "viewers": 92,
                      "viewMinutes": 2422,
                      "buyers": 1,
                      "average_viewer_engagement": 0,
                      "thumbnail": "https://image.staylive.se/thumbnails/videos/3.jpg",
                      "channelImage": "https://image.staylive.se/profiles/2/profile.png"
                  },
                ],
                "totals": {
                    "buyers": 3,
                    "unique_viewers": 274,
                    "videos": 5,
                    "viewMinutes": 7510,
                    "size": 0,
                    "engagement": "0.00%"
                }
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
          "totalPages": 1,
          "objects": 4
        }
    
    }
    

    Returns

    The return data is going to return video data from one or several channels.

    This endpoint gets multiple channels video data.

    HTTP Request

    GET https://api.staylive.tv/videos/feed/stats/<?ID>?limit=20&page=2

    URL Parameters

    Parameter Description
    ID The ID of the channel, not mandatory as a header called "X-STAYLIVE-CHANNELS" can be sent instead, giving you access to several channels worth of data.

    Interval statistics for specific videos

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    created_at is when the video was created.

    Response to a request made by a user

    [
        {
            "created_at": "2019-01-09T12:58:58.000Z",
            "newPurchases": 2,
            "purchases": 2
        }
    ]
    

    Returns

    The return data is going to return video statistics data.

    This endpoint gets video stats.

    HTTP Request

    GET https://api.staylive.tv/videos/stats/ID

    URL Parameters

    Parameter Description
    ID The ID of the video

    Statistics for specific videos

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    timeWatched is the total time watched by all of the viewers. viewers is the total amount of unique viewers. average is the average view time per viewer platforms is the device the viewers used. Example: windows, mac or android. browser is the browser the viewers use. Example: chrome, safari or Edge. engagement is the amount of the video that the viewer watched. average_engagement is the average amount of the video watched.

    Response to a request made by a user

    {
        "message": {
            "timeWatched": 2499,
            "viewers": 91,
            "average": 27.46153846153846,
            "platforms": [
                {
                    "platform": null,
                    "users": 1
                },
                {
                    "platform": "Android",
                    "users": 89
                },
                {
                    "platform": "Chromebook",
                    "users": 88
                },
                {
                    "platform": "iPhone",
                    "users": 88
                },
                {
                    "platform": "Linux",
                    "users": 90
                },
                {
                    "platform": "Mac",
                    "users": 88
                },
                {
                    "platform": "Windows",
                    "users": 90
                }
            ],
            "browser": [
                {
                    "browser": null,
                    "users": 1
                },
                {
                    "browser": "Chrome",
                    "users": 87
                },
                {
                    "browser": "Edge",
                    "users": 88
                },
                {
                    "browser": "Firefox",
                    "users": 90
                },
                {
                    "browser": "Internet Explorer",
                    "users": 89
                },
                {
                    "browser": "Opera",
                    "users": 89
                },
                {
                    "browser": "Safari",
                    "users": 86
                },
                {
                    "browser": "Tor",
                    "users": 88
                }
            ],
            "average_engagement": "0%",
            "engagement": [],
            "dataPoints": [
                {
                    "date": "2018-05-07T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-09T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-10T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-11T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-12T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-13T06:08:49.000Z",
                    "viewers": 1
                },
                {
                    "date": "2018-05-14T16:44:51.000Z",
                    "viewers": 90
                },
                {
                    "date": "2018-05-15T19:16:42.000Z",
                    "viewers": 91
                },
                {
                    "date": "2018-05-15T22:49:31.000Z",
                    "viewers": 73
                },
                {
                    "date": "2018-05-16T22:05:16.000Z",
                    "viewers": 5
                }
            ]
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is going to return video statistics data.

    This endpoint gets video stats.

    HTTP Request

    GET https://api.staylive.tv/videos/stats/ID

    URL Parameters

    Parameter Description
    ID The ID of the videos

    Event statistics for a channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    created_at is when the package was created.

    Response to a request made by a user

    {
        "message": [
            {
                "events": [
                    {
                        "name": "Best package",
                        "description": "One of the best",
                        "id": 1,
                        "selling": 1,
                        "price": 103,
                        "currency": "SEK",
                        "created_at": "2019-04-09T10:31:35.000Z",
                        "updated_at": null,
                        "channelName": "Årsta pojkarna",
                        "channel": 2,
                        "buyers": 0
                    }
                ],
                "total": {
                    "buyers": 0,
                    "events": 1
                }
            }
        ],
        "statuscode": 200,
        "success": true,
        "data": {
            "totalPages": 1,
            "objects": 1
        }
    }
    

    Returns

    The return data is going to return package statistics data.

    The data object returns the amount of objects that could be returned, totalPages tells you the amount of pages you have to go through before you get to the end, with the current set limit. For example, if the search yields 200 results, you have a limit of 20, you will see 20 results on page 1, and you would have a total of 10 pages (20 objects per page * 10 pages = 200 objects)

    This endpoint gets package stats.

    HTTP Request

    GET https://api.staylive.tv/events/feed/stats/<ID>?limit=20&page=1

    URL Parameters

    Parameter Description
    ID The ID of the package
    Limit When you get a very large chunk of data from feeds or searches, the result is split into chunks. These chunks are default 10, which results in 10 results being returned. But as a parameter query in the URL, you can either increase or decrease this number to whatever size you want. Any number larger than 0 can be used.
    Page To get more of the same result, in the same chunk-size, you will want to increase the page number. If you make a request and get 1-10 as a response, but want to access 11-20, you will need to add pages in the parameter. page=2 will take you to page 2 of the chunk, which will return the results ranging from 11-20.

    Interval statistics for specific packages

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, statistics, company and statistics

    Explanation of data

    created_at is when the package was created.

    Response to a request made by a user

    [
        {
            "created_at": "2019-01-09T12:58:58.000Z",
            "newPurchases": 2,
            "purchases": 2
        }
    ]
    

    Returns

    The return data is going to return package statistics data.

    This endpoint gets package stats.

    HTTP Request

    GET https://api.staylive.tv/events/stats/ID

    URL Parameters

    Parameter Description
    ID The ID of the package

    Geo restrictions

    Create a list for geo restrictions

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company in a Collection/platform.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the list String Yes
    country_codes The countries to include in the list String No
    restriction_type If the list should be a blacklist, whitelist or none. String No

    The expected format of data looks like this:

      const editorsPick = { "name": "Ligans whitelist", "country_codes": "swe, uk, fin", "restriction_type": "whitelist" }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "name": "Ligans whitelist",
            "country_codes": [
                "swe",
                "uk",
                "fin"
            ],
            "restriction_type": "whitelist",
            "channel": 2,
            "inserted_at": "2019-08-21T11:35:37.000Z",
            "id": 7
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the geo restriction list route.

    This endpoint creates geo restriction lists for channels.

    HTTP Request

    POST https://api.staylive.tv/geo/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel that the geo restriction list will be tied to.

    Get a Geo restriction list

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company in a Collection/platform.

    Response to a request made with no header

    {
        "message": {
            "name": "Ligans whitelist",
            "country_codes": [],
            "restriction_type": "whitelist",
            "channel": 2,
            "inserted_at": "2019-08-21T11:38:13.000Z",
            "id": 10
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data includes information about the geo restriction list.

    This endpoint retrieves a geo restriction lists countries and if its whitelist, none or blacklist.

    HTTP Request

    GET https://api.staylive.tv/geo/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the geo restriction list to retrieve

    Update a list for geo restrictions

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company in a Collection/platform.

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Name The name of the list String No
    country_codes The countries to include in the list String No
    restriction_type If the list should be a blacklist, whitelist or none. String No

    To empty a geo restriction list from countries, you only need to PUT with an empty country_codes key.

    The expected format of data looks like this:

      const editorsPick = { "name": "Ligans whitelist", "country_codes": '', "restriction_type": "whitelist" }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": {
            "name": "Ligans whitelist",
            "country_codes": [],
            "restriction_type": "whitelist",
            "channel": 2,
            "inserted_at": "2019-08-21T11:35:37.000Z",
            "id": 7
        },
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the geo restriction list route.

    This endpoint creates geo restriction lists for channels.

    HTTP Request

    PUT https://api.staylive.tv/geo/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the geo restriction list to update

    Delete a geo restriction list

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company in a Collection/platform.

    Response to a request made by a user with owner status on the channel

    {
        "message": "The GEO restriction list <ID> has been deleted",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the geo restriction list has been deleted from the channel

    This endpoint deletes a geo restriction list.

    HTTP Request

    POST https://api.staylive.tv/geo/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the geo restriction list to delete

    Get all Geo restriction list from channel

    Role required

    You can only access this route with a valid login and if the login is tied to a channel with the right levels of access. To verify your login the request needs to supply a header with the data you received when you logged in. To access this route you need the role of: Owner, admin, production company, company and statistics, restricted production company in a Collection/platform.

    Response to a request made with no header

    {
        "message": [
            {
                "name": "Ligans whitelist",
                "country_codes": [
                    "swe",
                    "uk",
                    "fin"
                ],
                "restriction_type": "whitelist",
                "channel": 2,
                "inserted_at": "2019-08-21T11:32:41.000Z",
                "id": 1
            },
            {
                "name": "Seasonal blacklist",
                "country_codes": [
                    "rus",
                    "no",
                    "us"
                ],
                "restriction_type": "whitelist",
                "channel": 2,
                "inserted_at": "2019-08-21T11:33:59.000Z",
                "id": 2
            },
        ],
        "statuscode": 200,
        "success": true
    }
    
    

    Returns

    The return data includes information about all of the geo restriction lists a channel owns.

    This endpoint retrieves all geo restriction lists from a channel.

    HTTP Request

    GET https://api.staylive.tv/geo/channel/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the channel to get all geo restriction list from

    Admin for channels and collections

    Give a user new access

    Role required

    To access this route you need the role of: Owner, admin

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Email A valid email address String Yes
    Level A number corresponding to a role, see glossary for valid numbers Number Yes
    Active True or false Boolean No

    The expected format of data looks like this:

      const chapter = {email: 'test@email.se', level: 1, active: 1}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "firstname": "Christoffer",
                "lastname": "Owner",
                "id": 1,
                "user": 103,
                "collection": 1,
                "account_level": "0",
                "active": 1,
                "inserted_at": "2018-08-06T22:00:00.000Z"
            },
            {
                "firstname": "Complete",
                "lastname": "Company",
                "id": 3,
                "user": 104,
                "collection": 1,
                "account_level": "1",
                "active": 1,
                "inserted_at": null
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint gives more access to channel or collection to a specified user.

    HTTP Request

    POST https://api.staylive.tv/admin/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    TYPE Can either be channel or collection.
    ID The ID of the video to retrieve chapters from

    Updates an existing user with access to new access or limited access

    Role required

    To access this route you need the role of: Owner, admin

    Payload data

    The accepted payload are as follows:

    Attributes Description Type Required
    Email A valid email address String Yes
    Level A number corresponding to a role, see glossary for valid numbers Number Yes
    Active True or false Boolean No

    The expected format of data looks like this:

      const chapter = {level: 2, active: 1}
    

    The above command returns JSON structured like this: Response to a request made by a user with owner status on the channel

    {
        "message": [
            {
                "firstname": "Christoffer",
                "lastname": "Owner",
                "id": 1,
                "user": 103,
                "collection": 1,
                "account_level": "0",
                "active": 1,
                "inserted_at": "2018-08-06T22:00:00.000Z"
            },
            {
                "firstname": "Complete",
                "lastname": "Company",
                "id": 3,
                "user": 104,
                "collection": 1,
                "account_level": "2",
                "active": 1,
                "inserted_at": null
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    The return data is exactly the same as you'd see it in a GET response to the chapter route.

    This endpoint gives more access to channel or collection to a specified user or limits already given access.

    HTTP Request

    PUT https://api.staylive.tv/admin/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    TYPE Can either be channel or collection.
    ID The ID of the video to retrieve chapters from

    Get users with access to the channel

    Role required

    To access this route you need the role of: Owner, admin

    Response to a request made with admin access

    {
        "message": [
            {
                "firstname": "Christoffer",
                "lastname": "Owner",
                "id": 1,
                "user": 103,
                "collection": 1,
                "account_level": "0",
                "active": 1,
                "inserted_at": null
            }
        ],
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes all the users with access to the channel or collection given in the request.

    This endpoint retrieves all users with access to a given channel or collection.

    HTTP Request

    GET https://api.staylive.tv/admin/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    TYPE Can either be channel or collection.
    ID The ID of the video to retrieve chapters from

    Delete a user's access from a channel or collection

    Role required

    To access this route you need the role of: Owner, admin

    The expected format of data looks like this:

      const user = { user: 104 }
    

    Response to a request made by a user with owner status on the channel

    {
        "message": "The user with ID 104 has been deleted from the collection with ID '1'",
        "statuscode": 200,
        "success": true
    }
    

    Returns

    When the request gets a response the response includes confirmation that the users access has been deleted from the channel or client

    This endpoint deletes a users access from a channel or collection.

    HTTP Request

    DELETE https://api.staylive.tv/admin/<TYPE>/<ID>

    URL Parameters

    Parameter Description
    TYPE Can either be channel or collection.
    ID The ID of the item to delete

    Errors

    The StayLive API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your token is invalid or wrong.
    403 Forbidden -- The route requested is for a higher level user than you are.
    404 Not Found -- The route or object requested could not be found.
    422 Validation error -- If the payload does not pass the validation you'll get 422.
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

    Currencies

    The StayLive API uses the following currencies:

    Use Currency
    SEK Swedish krona
    EUR Euro
    USD American Dollar
    NOK Norwegian krona
    GBP Great Britain Pound

    Glossary

    Terms

    Different terms used in the documentation

    Word Explanation
    Livestream A livestream is something that is recorded, broadcasted and watched live as it happens.
    Video Videos can be created in multiple ways. A video can be a pre-recorded match or it can be a livestream that was set to be uploaded as a video after airing.
    VOD VOD means video on demand, and is the same as a video
    Stream Stream is shorthand for livestream
    Subscription A subscription is a monthly fee users pay to access a certain channel or specific videos from a channel. There can be multiple subscriptions per channel, with only specific videos and livestreams accessible through the subscription
    Packages A package is a deal that will give you access to specific livestreams and videos for a cheaper price than buying them separately.
    Account level To give different access to different users, we're using account levels. Some levels can access everything, while others can only access things such as statistics or uploading things.

    Account levels

    There are currently 6 different roles, with varying levels of access. Higher numbers do NOT correspond higher access. The roles are lined up in terms of access.

    You can be several different roles on one channel, but only the highest level will be used, and you can also have several different roles on multiple channels at once. E.g the "owner"-role on one channel, and an admin role on a different channel.

    Role Level Access
    Owner 0 An owner has access to everything on the channel
    Admin 6 An admin has access to almost everything on the channel.
    company and statisticians 7 A combined role that gives access to statistics and uploading content
    Company 1 A company role is given to a production company to give them access to a majority of content creating and changing content.
    Restricted company 10 A company role with restricted access to certain routes. They can only edit certain attributes for videos/livestreams.
    Statistics 2 A statistician has access to everything related to statistics for.
    Watch and download 9 A special user that has download/view-access to all of the material posted by a collection or channel.
    Paid User 3 A normal user without any special access, except for things that have been bought
    User 4 A normal user without any special access.

    Payment methods

    There are currently two ways to buy things from StayLive, Stripe and Swish.

    Stripe allows for most card purchases to be made and subscriptions.

    Swish allows for one time purchases like videos, packages and livestreams and is a Swedish payment method where you use your phone.

    Purchasing options

    There are three different ways you can purchase items from StayLive.

    You can buy the item directly while logged in, called PPV ('Pay per view'), and therefore tie it to your account and have easy access to it. This includes packages, videos and livestreams.

    You can subscribe while being logged in, which means you have access to specific videos and livestreams during a months time, there are different tiers of subscriptions that allow you to access more depending on what tier you subscribe to. This gives you access to videos and livestreams.

    You can make purchases while NOT logged in, with a technique StayLive calls Express checkout. This means you make a purchase on a video or livestream with Stripe or Swish, where you also give your email. Upon a successful purchase, the user will get an email with a code that can be used to access the livestream or video without having to create an account or log in. If they at a later date want to join StayLive with an account, they can add the code to their account and it will work as a normal video/livestream.

    Geo-data

    We supply a few different tools to help you reach an international stage with your livestreams and videos. You may have several translations for a livestream or videos name and description, in multiple languages. If you want the price to be different in certain countries, you can set special prices for as many countries you want. The ability to block or whitelist certain countries is also a possibility.

    Translations

    Translations are sent out the users that have a certain header called "Content-Language" and looks like this "EN/US", which is language and country. If a translation does not exist for the users language, the default values are returned to the user. You can create translations for: Videos, Livestreams, Channels, Collections, Packages and Subscriptions.

    Special Prices

    Special prices are based on where the user is from. If a livestream has multiple prices and currencies, it will only return the one that corresponds with the users country of origin. If a price does not exist for the country or livestream, the user will get the default price of the livestream. You can create special prices for: Videos, Livestreams, Packages and Subscriptions.

    Geo restrictions

    Geo restrictions block certain countries from accessing specific livestreams or videos, depending on the setting. You can create a list of countries to blacklist, or a list of countries to whitelist. If the user's country is blacklisted, they can not access the livestream/video. You can create these lists for: Videos and Livestreams.