flow-docs

External API

Introduction

This is a documentation of the External API endpoint (GET) for a RESTful web service built using AWS Lambda. This endpoint allow to interact with the service to read the stored data.

API Base URL: https://api.statsperform.video/external

Authorization

We are using jwt authorization before calling the endpoint. To use jwt token for authentication is simple enough to generate only the token without any context.

Example for generating the token and calling the api with the token

import jwt from 'jsonwebtoken'
const secretKey = process.env.SECRET_FOR_TOKEN
const token = jwt.sign({}, secretKey)

fetch(`https://api.statsperform.video/external/dvr/${YOUR_FIXTURE_ID}`, {
		method: 'GET',
		headers: {
			'Content-Type': 'application/json',
			Authorization: `Bearer ${token}`
		}
	})
		.then(response => response.json())
		.then(data => console.log(data))
		.catch(error => console.error(error))

Endpoint

GET /dvr/{fixtureId}

https://api.statsperform.video/external/dvr/{fixtureId}

Description:
Fetches the db and giving back the matched data, based on fixtureId.

Path Parameters:

Responses

[
  {
    "id": "dm-7f8b78cb",
    "provider": "dataminer",
    "platform": "examino",
    "source": "https://cdn.statsperform.video/2023/05/28/dm-7f8b78cb/index.m3u8",
    "title": "Everton v AFC Bournemouth",
    "video": {
      "width": 1920,
      "height": 1080
    }
  },
  {
    "id": "xeatre-232657",
    "provider": "xeatre",
    "platform": "examino",
    "source": "https://cdn.statsperform.video/2023/05/28/xeatre-232657/index.m3u8",
    "title": "Everton vs AFC Bournemouth",
    "video": {
      "width": 1280,
      "height": 720
    }
  },
  {
    "id": "175318",
    "provider": "xeatre",
    "platform": "xeatre",
    "source": "https://storage.googleapis.com/origin-wza-07/recordings/8cxyfua16yckz5069m8j5sqhg-232659-bu1evertonvsafcbournemouth.mp4?GoogleAccessId=131293348053-compute%40developer.gserviceaccount.com&Expires=1686589205&Signature=KZu5YverUZQ6qQ4TgrTVuv95ilXEY9Qkh%2FPlyi65uQXgzdGnipuqeSQIFlHYVeb6gk9BQu5g4yZPDARvRrAKuSJ4N8iIgi5P6Z6ZA5WS59H92W%2FwcWsWHG3%2FZBn5twFF4Xm68reinRtcyfNmkEggf6GeL72fG1mdCeumVQvlSFHnvG%2B9sZHlg%2FrdfOBVBpABf6ogwlbQMA4QC%2Faf8dQ3IkpAnW9UxEe5690InFWU10j8DIcoj91AsWN5FP6cQciNz53W8yFpGLSD%2FjyC8NlslY%2BrJ7qqkj4rTcUn0oGqw3a5neD%2BT%2BKJJcoUzIjS4JekM11O78f6EdMo522DtGl6RA%3D%3D",
    "title": "BU1: Everton vs AFC Bournemouth"
  }
]

Errors

{ "message": "Could not found any data with the provided fixtureId" }
{ "message": "Could not found any data with the provided fixtureId" }
{ "error": "An error occurred while fetching URLs." }