European Council - Freecaster API documentation (0.11.0)

Download OpenAPI specification:Download

Setup / Support

Quickstart Guide

Our API is based on the JSON:API 1.0 specifications. So you MUST include the Content-Type: application/vnd.api+json and the Accept: application/vnd.api+json HTTP header in all your API calls.

Most calls require a valid authentication with a bearer access token. We use OAuth 2.0 for the authentication process (via the /login endpoint).

Here's a small example of a successful authentication to our API:

  1. First, get an authorization token:

    POST /api/login HTTP/1.0
    Host: gsc-api-prp.fcst.tv
    Content-Type: application/vnd.api+json
    
    {
     "username": "johndoe@example.com",
     "password": "123456"
    }
    
    HTTP/1.0 200 OK
    Content-Type: application/vnd.api+json
    
    {
     "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImZhYzE5ZWU5YWZjZTE0NTE5ZjYxYzlmM2U4YTg1MmY3ZGY5ZjNkMjllMmYzNDVkZmNhYThmNjc5NGVkNWU5NDgzNWE1MDQwYTYzYzJkYjJmIn0",
     "data": {
       "type": "user",
       "id": "8f902e00-f427-4405-903b-e06c62cd46cc",
       "attributes": {
         "name": "John Doe",
         "email": "johndoe@example.com",
         "firstname": "John",
         "lastname": "Doe"
       }
     }
    }

    You must use the access_token in upcoming calls (in the Authorization HTTP header).

Authentication

Bearer

Security scheme type: HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

User

User login

post /login

Pre-production server

https://gsc-api-prp.fcst.tv/api/login
Request Body schema: application/json
username
required
string

This field can be either your username or your email address.

password
required
string

Responses

200

Return an acces token and the logged user data.

Response Schema: application/vnd.api+json
access_token
string
data
object
401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "user",
  • "password": "password"
}

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{
  • "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImZhYzE5ZWU5YWZjZTE0NTE5ZjYxYzlmM2U4YTg1MmY3ZGY5ZjNkMjllMmYzNDVkZmNhYThmNjc5NGVkNWU5NDgzNWE1MDQwYTYzYzJkYjJmIn0",
  • "data":
    {
    • "type": "user",
    • "id": "8f902e00-f427-4405-903b-e06c62cd46cc",
    • "attributes":
      {
      • "name": "John Doe",
      • "email": "johndoe@example.com",
      • "firstname": "John",
      • "lastname": "Doe"
      }
    }
}

User logout

post /logout

Pre-production server

https://gsc-api-prp.fcst.tv/api/logout
Authorizations:

Responses

204

No Content

401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{
  • "errors":
    [
    • {
      • "message": "Unauthenticated"
      }
    ]
}

Get the authenticated user

get /me

Pre-production server

https://gsc-api-prp.fcst.tv/api/me
Authorizations:

Responses

200

Return the authenticated user data.

Response Schema: application/vnd.api+json
data
Array of objects
401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{}

Get all users

get /users

Pre-production server

https://gsc-api-prp.fcst.tv/api/users
Authorizations:
header Parameters
Accept-Language
string

Specify the local language you want to get.

E.g.:

  • en-GB
  • fr-FR

Responses

200

Return an array of users data.

Response Schema: application/vnd.api+json
data
Array of objects
links
object
meta
object
401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{}

Create a user

post /users

Pre-production server

https://gsc-api-prp.fcst.tv/api/users
Authorizations:
Request Body schema: application/json

A JSON object with user information.

data
required
object
password_confirmation
required
string

Responses

201

The new user has been created.

Response Schema: application/vnd.api+json
data
Array of objects
links
object
202

Accepted

204

No Content

401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
403

Forbidden

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects
409

Conflict

Response Schema: application/vnd.api+json
errors
Array of objects

Request samples

Content type
application/json
Copy
Expand all Collapse all
{}

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{}

Get a user

get /users/{uuid}

Pre-production server

https://gsc-api-prp.fcst.tv/api/users/{uuid}
Authorizations:
path Parameters
uuid
required
string

The content UUID

Responses

200

Return the requested user data.

Response Schema: application/vnd.api+json
data
Array of objects
links
object
401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{}

Update a user

patch /users/{uuid}

Pre-production server

https://gsc-api-prp.fcst.tv/api/users/{uuid}
Authorizations:
path Parameters
uuid
required
string

The content UUID

Request Body schema: application/json

A JSON object with user information.

data
required
object
password_confirmation
required
string

Responses

200

The requested user has been updated.

Response Schema: application/vnd.api+json
data
Array of objects
links
object
202

Accepted

204

No Content

401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
403

Forbidden

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects
409

Conflict

Response Schema: application/vnd.api+json
errors
Array of objects

Request samples

Content type
application/json
Copy
Expand all Collapse all
{}

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{}

Delete a user

delete /users/{uuid}

Pre-production server

https://gsc-api-prp.fcst.tv/api/users/{uuid}
Authorizations:
path Parameters
uuid
required
string

The content UUID

Responses

202

Accepted

204

No Content

401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{
  • "errors":
    [
    • {
      • "message": "Unauthenticated"
      }
    ]
}

Event

Get all events

get /european-council/events

Pre-production server

https://gsc-api-prp.fcst.tv/api/european-council/events
Authorizations:
query Parameters
filter
Array of any
Items Value: "filter[...]=..."

Filter the results by one or many (separate by a comma) content attribute(s). You can also use wildcard (*,?) and prefix (<,>,<=,>=,-) on attributes.

  • /channels?filter[title]=freecaster,luna
  • /contents?filter[slug]=free*
  • /videos?filter[published_at]=>*3D20.11.05-01,<20.11.06-01
  • filter[title]=-freecaster

Additional filters:

  • "filter[depth]=...": Target a specific depth in the contents hierarchy.
  • "filter[search]=...": Make a search on all text fields.
  • "filter[tag]={uuid}": Target a specific tag id in the contents data.
sort
Array of any
Items Value: "sort[...]=..."

Sort the results by one or more attributes. By default the sort is ascending. For descending sort, pre-pend the attribute name by an hyphen. You can also combine multiple attributes for more complex sorting.

E.g.:

  • /videos?sort=-published_at

  • /contents?sort=title,-created_at

Additional sorting options:

  • "sort[weight]": Sort on the relationship weight. This is useful in the case of a playlist of videos, of which you can set the order in the back-office interface.
include
Array of any
Items Value: "include=..."

Include one or more relation into the query content results.

E.g.:

  • /videos/{uuid}?include=poster

  • /contents?include=posters,playerDisplays

page
Array of any
Items Value: "page[...]=..."

Results pagination

E.g.:

  • "page[size]=100": Set the number of results per page.
  • "page[number]=3": Return the results of page 3.
header Parameters
Accept-Language
string

Specify the local language you want to get.

E.g.:

  • en-GB
  • fr-FR

Responses

200

Return an array of events data.

Response Schema: application/vnd.api+json
data
Array of objects
links
object
401

Unauthorized

Response Schema: application/vnd.api+json
errors
Array of objects
404

Not Found

Response Schema: application/vnd.api+json
errors
Array of objects

Response samples

Content type
application/vnd.api+json
Copy
Expand all Collapse all
{
  • "data":
    [
    • {
      • "type": "event",
      • "id": "8d86c40e-c8d8-4feb-bd92-6a242979cebc",
      • "attributes":
        {
        • "created_at": "2019-04-24T09:52:24Z",
        • "updated_at": "2019-04-24T09:52:24Z",
        • "published_at": "2019-04-24T09:52:24Z",
        • "published": true,
        • "unpublished_at": null,
        • "external_url": null,
        • "live": false,
        • "duration": null,
        • "slug": "european-council",
        • "title": "European Council",
        • "description": "",
        • "type": "event",
        • "countdown_time": null,
        • "start": "1235907900000",
        • "end": "1235909699000",
        • "display":
          {},
        • "stream_channels":
          {
          • "sdi": 1,
          • "channel": 1,
          • "language": "eng"
          },
        • "available_languages":
          [
          • "fre",
          • "eng"
          ],
        • "genre": null,
        • "rating": null,
        • "short_title": null,
        • "short_description": null,
        • "production_date": null,
        • "start_date": "2020-02-03 11:20:00",
        • "end_date": "2020-02-03 12:20:00",
        • "embed":
          {
          • "script": "(function (w, d) {\\n let data = {\\\"player\\\":{\\\"name\\\":\\\"Flow\\\"...",
          • "target": "{\\\"video\\\":{\\\"src\\\":[{\\\"type\\\":\\\"application\\\\/x-mpegurl\\\",\\\"...",
          • "iframe": "<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n...",
          • "legacy": "<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n <meta charset=\\\"utf-8\\\">\\n..."
          },
        • "private": false,
        • "jobs": null
        }
      }
    ],