API Integration - Events and Clubs

API Integration - Events and Clubs

About Pixellot

Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, Pixellot’s AI technology solution streamlines production workflow by deploying an unmanned multicamera system in a fixed location, with additional angles as required, to cover the entire field, offering a stitched panoramic image. Advanced algorithms enable automatic coverage of the flow of play and generate highlights. Pixellot systems are deployed by broadcasters, production companies, clubs, federations, universities, high schools, sports portals, and coaching solution providers around the globe.

For more information visit: www.pixellot.tv


Legal Notice

This document contains proprietary and confidential material of Pixellot Ltd. Any unauthorized reproduction, use, or disclosure of this material, or any part thereof, is strictly prohibited. This document is solely for the use of Pixellot employees and authorized Pixellot customers.

The material furnished in this document is believed to be accurate and reliable. However, no responsibility is assumed by Pixellot Ltd. for the use of this document or any material included herein. Pixellot Ltd. reserves the right to make changes to this document or any material included herein at any time and without notice. 

For more information visit: www.pixellot.tv 

Copyright © 2024 Pixellot Ltd.

All Rights Reserved.


Pixellot API

Pixellot provides its partners with a dedicated Partner API for creating new entities, updating and retrieving them. In addition, a partner can subscribe to Pixellot webhooks to get notification about different significant occurrences.

The idea is that a partner can, for instance, ask for a list of events on startup. When the partner subscribes to the webhooks service, it will get notifications about every significant change (including creation and deletion) and will update its own database. This will omit the need to repeatedly ask for the full list of events to get new events and updates to existing events. The updates can, in this way, be done passively in a push method instead of pull.


RestAPI documentation

Explore Partner API through our official documentation. This resource provides essential information for integrating our services seamlessly into your applications. Find detailed API endpoints, request methods, authentication guides, and error handling instructions.

For more information, visit our REST API documentation at https://app.swaggerhub.com/apis/Pixellot/partner_api/


How to use the API?

Pixellot API is a RESTful HTTP API. All requests, except the login, require an access token. If no access token will be provided in the API request, 401 Unauthorized will be returned to the client.


Environments

Pixellot supports 2 environments for 3rd party companies: staging and production. Initially, 3rd party company integrates with the staging environment to verify that the integration is correct. Once E2E staging works correctly, the integration moves to production.

Available environments:

[Base URL] = api.pixellot.tv/v1 (PROD) - production workloads
[Base URL] = api.stage.pixellot.tv/v1 (STAGE) - tests and integration


Authorization

All API requests, except for login, require the “Authorization” header to be present. Authorization is based on the JWT method. JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties.

To obtain authorization data, use the POST /login endpoint - https://app.swaggerhub.com/apis/Pixellot/partner_api/1.28.18#/default/login

Typical authenticated request would be having the following look:

  1. curl https://api.stage.pixellot.tv/v1/venues -H "Authorization: eyJ0eX..."


Clubs


1. Setup


The preferred way to start working with events is to have a club set up from CMS. List of available clubs can be received via GET /clubs API - Build, Collaborate & Integrate APIs | SwaggerHub


  1. [
  2.     {
  3.         "_id":"62b17b905a48d30cb795dc3f",
  4.         "name":"-club user",
  5.         "venues":[
  6.             {
  7.                 "_id":"62015f17942fa2549baf9759",
  8.                 "name":"Fake Venue 22998"
  9.             }
  10.         ],
  11.         "admins":[
  12.             {
  13.                 "id":"636ac42f0da28303628af05d",
  14.                 "fullName":"Test Admin"
  15.             }
  16.         ],
  17.         "prerolls":[]
  18.     }
  19. ]

Club, venue, and admin IDs correspond to the CMS values.

Later, more clubs and be added from CMS by a user with “Account Admin” role, or using POST /clubs API - Build, Collaborate & Integrate APIs | SwaggerHub. Example payload:


  1. {
  2.   "name": "Second Club",
  3.   "admins": [
  4.     "ecAF28d5C34A5De02A50b067"
  5.   ],
  6.   "venues": [
  7.     "AfE8Da1e3eE771da0Bb5fCB6"
  8.   ]
  9. }

Note: if the venue units are not defined during club creation, the “venues” field can be left empty, and later updated by POST /clubs/:id/venues API - Build, Collaborate & Integrate APIs | SwaggerHub .

2. Club options


When creating an event, some of the options become available as they are enabled on CMS. Contact your account manager to enable or disabled them.

Following is the mapping of the fields present in the event creation schema vs the corresponding CMS club option:

  1. streamTargets → Allow Stream Forwarding
  2. prerolls → Allow pre-rolls
  3. multiStreamPaths → Betting mode - Low latency
  4. type
  1. type: betting → Betting mode - Low latency
  2. type: tournament → Tournament mode
  1. integrations: {genius :{}} → Genius Integration
  2. vas → Allow working with VAS providers

Additional options are based on the tenant-level configuration:
  1. categories → available for a tenant with OTT usage
  2. disableLivePano → available always, but taken from tenant configuration is not provided in the request body


Events


1. Endpoints

Events are scheduled in a club context. Use POST /clubs/:id/events   to schedule events.
Full details about the endpoint can be found here - Build, Collaborate & Integrate APIs | SwaggerHub 

2. CMS synchronization

Events created by API will appear in CMS in a few seconds at most. There, API events will be marked with a “lock” icon:



You still have full control over the event data via API, the “lock” icon simply means that some of the fields are not editable in CMS. 

If you decide to make an edit, API will return the updated data. Use the “copy” button in the “ID” table column to copy event’s ID to clipboard.

Note: CMS uses a separate event identification database, meaning that the event’s ID in API will be different than in the address bar:




3. Going live


As described in the “Best Practices” section of Onboarding and Best practices Document, several minutes before event’s start date an automatic process for the live stream begins - aka “automation”. After this moment, some of the event edit operations become unavailable and will be rejected with a similar error to:

  1. {"jse_shortmsg":"","jse_info":{},"message":"cant change startDate once the automation had been started","body":{"code":"InvalidContent","message":"cant change startDate once the automation had been started"}}

Live updates can be received via webhooks - see the Section 3.6 of the Events Monitoring and Hooks document about “EventChanges” hook.

4. Ending an event

As described in the “Best Practices” section of Onboarding and Best practices Document, to finish the event before the original scheduled time, you should change the end$date to now+1 minute via the PUT /events/:id API - https://app.swaggerhub.com/apis/Pixellot/partner_api/1.28.11#/default/updateEvent

Example:

  1. {"end$date": "2024-04-24T02:00:00Z"}

You can stop an event about 2-3 minutes before it should've ended by itself.  For example, if the current time is 15:33, and you want to modify an event which is supposed to end at 15:35, the request can fail.


5. Game types

As of API v1.28.11, you can create events with the following game types:

  • “game” - 2 teams

  • “training” - 1 team

  • “other” - no teams

To specify the type, use the “gameType” field.

Example payload - training event:

  1. {
        "eventName": "Practice Event",
        "start$date": "{{start_date}}",
        "end$date": "{{end_date}}",
        "venue": {"_id": "{{venue_id}}"},
        "scoreboardData": {"homeTeam": "Home", "enable": true},
        "permission": "club",
        "productionType": "soccer",
        "gameType": "training"
    }
Example payload - "other" event:
  1. {
        "eventName": "Generic event without teams",
        "start$date": "{{start_date}}",
        "end$date": "{{end_date}}",
        "venue": {"_id": "{{venue_id}}"},
        "scoreboardData": {"enable": false},
        "permission": "club",
        "productionType": "soccer",
        "gameType": "other"
    }

6. Stream forwarding


6.1  Prerequisites

To start forwarding HD stream, the following club options should be ON:

  1. “Allow Stream Forwarding” - for native forwarding
  2. “Betting mode - Low latency” - for low-latency forwarding

“Betting mode - Low latency” option should be used along with the “Allow Stream Forwarding” permission. Contact your account manager to enable these settings for needed clubs.


6.2  Regular

Following stream forwarding types are supported as of API v1.28.11:

  1. rtmps
  2. rtmp
  3. rtmp-limelight
  4. srt-push
  5. srt-pull

Stream forwarding can be specified during event creation inside the “streamTargets" field, or once the event is live via POST /events/:id/streamTargets API

In other cases, the input will be rejected with an error similar to:

  1. {"jse_shortmsg":"","jse_info":{},"message":"publicIp","body":{"code":"InvalidContent","message":"publicIp"},"restCode":"InvalidContent"}

Example payload - RTMP stream:

  1. { "streamTargets":{ "hd":[ { "name":"RTMP", // max 50 characters, unique in event scope "streamType":"rtmp", "host":"p.ep522507.i.rtmpstream.net", // where to forward to "port":"1935", "application":"EntryPoint", "destinationStream":"rtmp", "sourceStream":"hd", "userName":"368709", // optional "password":"aE9236" // optional } ] } }

Example payload - Facebook stream:

  1. { "streamTargets":{ "hd":[ { "name":"Facebook", "streamType":"rtmp", "host":"live-api-a.facebook.com", "port":"80", "application":"rtmp", "destinationStream":"test", "sourceStream":"hd" } ] } }

Example payload - SRT stream:

  1. { "streamTargets":{ "hd":[ { "name":"SRT Push", "streamType":"srt-push", "host":"134.122.79.116", "port":"4200", "application":"live", "destinationStream":"hd", "sourceStream":"hd" } ] } }

Resulting event in CMS by having 3 forwardings for the HD stream:



As of API v1.28.11, we do not support query parameters for the stream forwarding host URL. URI components can be only separated by slashed, as indicated on the screenshot above.

In case when stream forwarding has been successfully added via API, but is not visible on event event page in CMS, you should rely on the API response as the source of truth.

Forwarding of Panorama stream is not officially supported yet, but can be achieved with the following steps:

  1. { "name": "rtmp-1", "streamType": "rtmp", "host": "pxlt-source.pixellot.stream", "port": "1935", "application": "live", "destinationStream": "<streamName>", "sourceStream": "pano" }


6.3  Betting

For the low-latency stream forwarding, the “multiStreamPaths” field should be used. Resulting configuration is similar to a regular stream forwarding, but 3 available Betting forwarding types exist:


Native

Allows sending a stream without additional processing overhead to the selected URL. Resolution cannot be selected while forwarding natively, it is based on the event itself.
Example payload:
  1. "multiStreamPaths": {
        "primaryUrl": "rtmp://p.ep796290.i.akamaientrypoint.net/EntryPoint/wabvolleych22_92867_1000w@796290"
    },
    "bettingForwardingType": "Native",
    "type": "betting"
Resulting event in CMS:

           

Transcoded

Allows sending a transcoded stream with the selected resolution/bitrate to the provided URL.
Only one resolution can be selected at a time. Below is the list of allowed resolutions along with the bitrate ranges:
  1. 1080p - [3000, 6000]
  2. 720p - [1500, 3000]
  3. 480p - [750, 1500]
  4. 360p - [500, 1000]
Note that transcoding may add 1-2 seconds of additional stream delay.
Example payload:
  1. "multiStreamPaths": {
        "resolution": "360p",
        "primaryUrl": "rtmp://p.ep796290.i.akamaientrypoint.net/EntryPoint/wabvolleych22_92867_1000w@796290,
        "bitrate": 746,
        "username": "281596",
        "password": "sdkwuh7U$r"
    },
    "bettingForwardingType": "Transcoded",
    "type": "betting"

Resulting event in CMS:



None

When there is a need to have an event with reduced latency, forwarding type “None” should be used.
Can be combined with the POST /events/{id}/streamTargets API to achieve a native-like forwarding to a selected URL with lower stream delay. Meaning that the added stream forwardings will behave in the low-latency mode.
Example payload (do not the multiStreamPaths field):
  1. "bettingForwardingType": "None",
    "type": "betting"
Resulting events in CMS:



7. Streaming settings

API allows you to control the availability of HD and Panorama streams when on-air.

Based on the payload schema of the POST /clubs/:id/events/ API - https://app.swaggerhub.com/apis/Pixellot/partner_api/1.28.11#/default/addEventForClub, the following fields can be used to control which video types should be streamed or not:

  1. streamsConfig
Defines whether a specific video type should be streamed when live, or only recorded locally
  1. "streamsConfig": { "hd": stream/local, "pano": stream/local }

For example, {“hd”: “stream”, “pano”: “local”} will result in the similar event, as seen on CMS:

When both video types are set to “local”, event will be saved on the venue PC, and not published to the cloud.

  • disableLivePano
    Allows you to explicitly disable Panorama stream.

  • Note that this setting may conflict with the tenant’s streaming settings, which are still the primary source of what should happen when running an event. For example, "streamsConfig" cannot be used alongside with tenant's "disableLiveStreams" setting.

    Current streaming settings can be clarified with your account manager. Example of streaming settings:


    In this example, HD stream will exists in both Live & VOD stages of the event, while Pano will not.


    8. Graphics

    8.1  Scoreboard

    To start using the scoreboard APIs, venue needs to have a proper setup done in the VPU, for example:




    9. Event types

    There are several variations of event lifecycle that are related to how the video stream is behaving

    9.1 Betting

    Low-latency feed can be achieved by providing the following payload during event creation. To create a Betting event, add "type":"betting" to your event creation payload.

    See the Section 6.3 “Betting” in this document for more information.

    9.2 Tournament

    Tournament event type is an event that can last up to 16 hours.

    A Tournament event will stream live (to your chosen streaming service) but will not have cloud recording. In CMS, event will not stream, and you will be able to watch the event only when event is over and local recording was fully uploaded to VOD.

    Tournament events require Stream Forwarding to fully work. Stream forwarding allows you to stream events to your own streaming service. Forwarding to multiple streaming services is supported.

    To be able to create such an event, you need enable Tournament mode for your Club. If this option is not available in you club, please contact Pixellot support about adding the capability.

    To create a Tournament type of event, add "type":"tournament" to your event creation payload:.

    1. POST https://{Base-URL}/v1/clubs/:clubId/events
    1. {
        "eventName": "Tournament-event",
        "start$date": "2020-04-21T09:00:00.000Z",
        "end$date": "2020-04-21T18:00:00.000Z",
        "status": "active",
        "type":"tournament",
        "venue": {
          "_id": "56b1ed92sfd2b631ce420f4"
        },
        "scoreboardData": {
          "homeTeam": "teamA",
          "awayTeam": "teamB",
          "homeLogo": "string"
        },
        "productionType": "soccer"
        "streamTargets": {
            "hd": [{
                  "name":" forwardedStream",
                  "streamType":"rtmp",
                  "host":"13.112.216.114",
                  "port":"1915",
                  "application":" tournament_hd",
                  "destinationStream":" tournament_hd",
                  "sourceStream":"hd",
                  "userName":"",
                  "password":""
                  }]
            }
      }

    Note: StreamTargets can be added after event creation, by editing the event using the POST /events/{eventId}/streamTargets API - https://app.swaggerhub.com/apis/Pixellot/partner_api/1.28.8#/default/addAdHocStreamTarget

    9.3 External content

    This event type will be automatically assumed when creating an event for the external venue. Such venues are usually matching the following format: External-<number>-<Standard/Prime>, for example:


    Follow the regular event creation procedure, set an ID of the external venue inside “venue._id” field:

    1. { "eventName": "External Venue Test", "start$date": "{{start_date}}", "end$date": "{{end_date}}", "venue": { "_id": "{{externalVenueId}}" }, "scoreboardData": { "homeTeam": "Home", "awayTeam": "Guest", "enable": true }, "permission": "club", "productionType": "soccer" }

    The “type” indication is added automatically, you don’t need to explicitly specify it as for Betting or Tournament events.

    “externalStreamUrl” is the external content link that should be streamed to using RTMP protocol. This value can be also obtained from event’s page on CMS:


    External content events contain a few fields specific to them in the GET /events or GET /events/:id responses:

    1. "type": "externalContent", "externalStreamUrl": "rtmp://pxlt-....pixellot.stream:1935/live/0_hd_2000"

      • Related Articles

      • API Integration - Events Monitoring and Hooks

        About Pixellot Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, ...
      • API Integration - Venue Monitoring

        About Pixellot Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, ...
      • API Integration - Pixellot Marketplace

        About Pixellot Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, ...
      • API Integration - Advanced Breakdown

        About Pixellot Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, ...
      • API Integration - Categories and Teams

        About Pixellot Pixellot offers automated sports production solutions that provide affordable alternatives to traditional video capture, production, and distribution systems for professional and semi-professional sports events. Founded in 2013, ...