API Integration - Pixellot Marketplace

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, 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..."

Introduction

Pixellot Marketplace Documentation

This doc includes materials that help other companies integrate with the Pixellot ecosystem. From Pixellot’s perspective, a company that joins the marketplace becomes VAS - Value Added Service.

How to use the doc?

  1. VAS needs to decide what type of integration suits the company service, by looking at supported VAS types.
  2. After selecting the type, VAS needs to provide data described in the First steps.
  3. Now the integration should be implemented from the VAS side. The set of use-cases that needs to be covered is described in Flows section. REST API Documentation and Pixellot events subscription (see section 5) explains the technical details of the Pixellot API and integrate methodology.
Alert
This page references API calls and models described in REST API documentation and Pixellot events subscription.

VAS Types


As of now, Pixellot supports three VAS types:
A. Enhancement of real-time RTMP feed - Video Enhancer
B. Adding a pre-rendered graphics overlay - Overlay Provider
C. Upload camera raw data to cloud - Raw Data Consumer
More to come soon…

 1. Video Enhancer

  1. This type of VAS manipulates the RTMP stream during the live event.  Pixellot streaming server sends the RMTP stream to the VAS RTMP server and receives it back to another stream target. The enhanced stream is then delivered to the clients.
  2. The VAS of type videoEnhancer needs to send the PATCH event request with forwardUrl and controlUrl fields, the overlayUrl is not needed.
  3. The URLs here:
    1. forwardUrl - the RTMP URL to send the Pixellot real-time RTMP stream tcontrolUrl - the URL that opens a VAS control panel. A control panel is usually a web-based UI that allows controlling the VAS: graphics controller, commentating studio settings, etc.

Example request:
  1. curl --request PATCH 'https://api.pixellot.tv/v1/events/EVENT_ID/vas/VAS_NAME' \
    --header 'Authorization: TOKEN' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "forwardUrl": "rtmp://test.domain.com/forwardUrl",
        "controlUrl": "https://test.domain.com/controlUrl",
    }'
Response:
  1. {
        "eventName": "VAS Test",
          ...
        "vas": {
            "overlayProvider": {
                "name": "overlay-vas",
                "forwardUrl": "rtmp://test.domain.com/forwardUrl",
                "controlUrl": "https://test.domain.com/controlUrl"
            }
        }
    }

Flow:


  1. Pixellot sends the stream to the forwardUrl that VAS has sent to the PATCH /events/:id/vas/:vasName endpoint.
  2. VAS enhances the stream internally.
  3. VAS sends the stream back to the inputUrl that VAS has received in VasEventTimestamp hook subscription.

2. Overlay Provider

  1. This type of VAS asks Pixellot to render* an overlay on top of the real-time video stream.
  2. The VAS of type overlayProvider needs to send the PATCH event request with overlayUrl and controlUrl fields, the forwardUrl is not needed.

The URLs here:

overlayUrl - the URL to the web page that will be rendered on top of the Pixellot real-time stream.
controlUrl - the URL that opens a VAS control panel. A control panel is usually a web-based UI that allows controlling the VAS: graphics controller, commentating studio settings, etc.


Example request: 


Response:
  1. {
        "eventName": "Overlay Test",
      ...
        "vas": {
            "overlayProvider": {
                "name": "vas-overlay",
                "overlayUrl": "rtmp://test.domain.com/overlayUrl",
                "controlUrl": "https://test.domain.com/controlUrl"
            }
        }
    }

* Blending of the video and the overlay happens in Pixellot unit and not on the cloud.

3. Raw Data Consumer

This type of VAS allow upload of .mkv raw video to a third-party S3 bucket.

Enabling the upload raw video on the event level is achieved by using VAS. This type of VAS can be added alongside the other type of VASes.

After adding the vas to the event, the VAS will call API with the URL to be used later to get upload details (uploadDetailsCallback field).

Event data will look as follows:

  1.  "vas": {
            "rawDataConsumer": {
                "name":"provider-name", // any other provider
                "uploadDetailsCallback": "...us-east-1.amazonaws.com/alpha/getUploadDetails" // the endpoint to call to return upload details
                "uploadCompleteCallback": "...us-east-1.amazonaws.com/alpha/completeUpload"  // to notify on raw uploaded
            }
        }
Flow:


First Steps


This section describes the initial steps of the integration.

VAS Data

There are some pieces of information that need to be exchanged between Pixellot and VAS to initiate the integration.
Data to provide by the VAS owner:
  1. Description - a brief description of the service, what it provides. This text will be shown in the marketplace where tenants will decide which VAS to use.
  2. Icon URL - a link to the company icon.
  3. Website URL - a link to the company web-site.
  4. Join and leave callbacks - the POST HTTP endpoint URLs that will be called on tenant join/leave. More on this - see Tenant adds VAS in the marketplace and Tenant removes VAS in the marketplace sections of this document.
  5. [Optional] join and leave callbacks secrets. When sending the data, an HMAC hex digest is used to compute a hash from the sent payload (without whitespaces). The hash will be placed in the X-Pixellot-Signature header.



For convenience, we expect to get a JSON in the following format:



In response to this data, Pixellot will provide:
username and password that should be used in the REST API login requests to get the token
• VAS name - a unique name for the VAS. Will be used in the REST API requests related to VAS operations.

API restrictions

The VAS details should be added at least 15 minutes before the event start. All requests 15 minutes before the event start and later will be discarded.

However, it is possible to modify events with VAS type Overlay Provider to start in the nearest future, ignoring the 15-minute restriction.


Pixellot events subscription


Pixellot provides a convenient Pixellot to VAS communication approach. It is a subscription mechanism, where VAS gives a URL to Pixellot that needs to be called when an action happens. How does it work in a nutshell - VAS subscribes to a specific topic, like eventUpdate or teamUpdate, by providing an HTTP webhook URL that will be called once an action happens?
Warning
The subscriptions are for notification purposes only - the HTTP response is ignored, except for failures. If a subscription has many failures - an email about it will be sent to the email that was specified in the subscription creation body. 

1. Subscribing to event changes

This subscription should be created while handling the joinCallback (more on it Tenant adds VAS in the marketplace section). The subscription type is specified in the messageType field and should be VasEventTimestamp in this case.

Subscription request example:



After subscribing to the event changes, requests will be sent to the URL specified in the request body. Messages will be in the format of EventChangeHookMessageBody

The top-level property what of EventChangeHookMessageBody is a string that can be one of 4 possible values: created, updatedremoved, and deleted.

  1. created - when the VAS was added to the event. After this message, VAS may update the VAS details by calling the PATCH /events/:id/vas/:vasName endpoint
  2. updated - when the event had an update: name, date, team - any field. The whole updated entity is sent - not only the updates
  3. removed - when the VAS was removed from the event
  4. deleted - when the event was deleted

For the VAS of type videoEnhancer, the inputUrl, to which the stream should be forwarded after enhancement can be found by this path: 
.event.vas.videoEnhancer.inputUrl.


2. Subscribing to team changes

This subscription may also be created while handling the joinCallback. The messageType for this subscription should be VasTeamChange.

After subscribing to the event changes, requests will be sent to the URL specified in the request body. Messages will be in the format of TeamChangeHookMessageBody.

Flows

This section describes the flows that need to be covered in the integration phase.

1. Tenant adds VAS in the marketplace

This is the first interaction between the tenant and VAS. When VAS is added to the tenant, Pixellot sends a request to the VAS join callback, with the payload CallbackRequestData (action: join). VAS should create a subscription, by calling the createSubscription API.
The diagram shows that VAS should call the createSubscription API when the join callback endpoint is hit. If the subscription was successfully created, the 2XX HTTP status code is expected to be returned from the join callback call. If an error occurs during subscription creation, an error should be returned from the join callback call.

It is important to have a maximum possible uptime of a join callback endpoint - otherwise, your VAS will not be obtainable through Marketplace.





The tenant decides that he wants to remove the VAS. When this happens, Pixellot calls the leave callback with the payload CallbackRequestData (action: leave). The VAS should not call any endpoint in response to this call. If the request will be processed successfully, Pixellot expects to get a 2XX HTTP response.

Warning
The subscriptions will be deleted automatically






3. Tenant adds VAS to the event

After the tenant adds VAS, it can add VAS to the events. When the tenant adds VAS to the event, the VAS receives a notification about it (more on this in Subscribing to event changes section). The VAS backend receives the EventChangeHookMessageBody with the top-level property what set to created. In response to the create messages, the VAS may call the addVasDetails API to add the details to the event. As mentioned in the Pixellot events subscription (see section 5), the response of the notification request is ignored, so setting the event details should be a separate action.

            

4. The VASed event is updated


When the event with VAS added to it gets updated, the VAS receives a notification about it with the top-level property what set to updated. The whole event model is sent in the notification, not only the updates. The needed updates should happen on the VAS side. If the event updates affect the previously set VAS details on event (the addVasDetails API call), the VAS data can be updated on the event through the same request.

5. Tenant removes VAS from the event


When the tenant removes VAS from the event, the VAS receives a notification about it with the top-level property what set to removed. No actions are expected from VAS to Pixellot - both parties just clean up the resources created to support this VASed event.

6. Tenant deletes the event


When the event is deleted, the VAS receives a notification about it with the top-level property what being set to deleted. The same behavior takes place as if the tenant removed the VAS from the event.




    • Related Articles

    • 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 - 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 - 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, ...
    • 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, ...
    • API Integration - Troubleshooting and Q&A

      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, ...