GraphQL API Reference

Welcome to our GraphQL API reference!

API Endpoints
https://api.millicast.com/graphql

Feed

feedFindOne

Response

Returns a feeds

Arguments
Name Description
skip - Int

Example

Query
query FeedFindOne($skip: Int) {
  feedFindOne(skip: $skip) {
    accountId
    started
    active
    ended
    name
    streamId
  }
}
Variables
{"skip": 987}
Response
{
  "data": {
    "feedFindOne": {
      "accountId": "abc123",
      "started": "2007-12-03",
      "active": true,
      "ended": "2007-12-03",
      "name": "xyz789",
      "streamId": "abc123"
    }
  }
}

feedFindMany

Response

Returns [feeds!]!

Arguments
Name Description
skip - Int
limit - Int Default = 100

Example

Query
query FeedFindMany(
  $skip: Int,
  $limit: Int
) {
  feedFindMany(
    skip: $skip,
    limit: $limit
  ) {
    accountId
    started
    active
    ended
    name
    streamId
  }
}
Variables
{"skip": 123, "limit": 100}
Response
{
  "data": {
    "feedFindMany": [
      {
        "accountId": "xyz789",
        "started": "2007-12-03",
        "active": true,
        "ended": "2007-12-03",
        "name": "abc123",
        "streamId": "abc123"
      }
    ]
  }
}

feedCount

Response

Returns an Int

Example

Query
query FeedCount {
  feedCount
}
Response
{"data": {"feedCount": 123}}

feedConnection

Response

Returns a feedsConnection

Arguments
Name Description
first - Int Forward pagination argument for returning at most first edges
after - String Forward pagination argument for returning at most first edges
last - Int Backward pagination argument for returning at most last edges
before - String Backward pagination argument for returning at most last edges

Example

Query
query FeedConnection(
  $first: Int,
  $after: String,
  $last: Int,
  $before: String
) {
  feedConnection(
    first: $first,
    after: $after,
    last: $last,
    before: $before
  ) {
    count
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        accountId
        started
        active
        ended
        name
        streamId
      }
      cursor
    }
  }
}
Variables
{
  "first": 123,
  "after": "abc123",
  "last": 987,
  "before": "abc123"
}
Response
{
  "data": {
    "feedConnection": {
      "count": 987,
      "pageInfo": PageInfo,
      "edges": [feedsEdge]
    }
  }
}

feedPagination

Response

Returns a feedsPagination

Arguments
Name Description
page - Int Page number for displaying
perPage - Int Default = 20

Example

Query
query FeedPagination(
  $page: Int,
  $perPage: Int
) {
  feedPagination(
    page: $page,
    perPage: $perPage
  ) {
    count
    items {
      accountId
      started
      active
      ended
      name
      streamId
    }
    pageInfo {
      currentPage
      perPage
      pageCount
      itemCount
      hasNextPage
      hasPreviousPage
    }
  }
}
Variables
{"page": 987, "perPage": 20}
Response
{
  "data": {
    "feedPagination": {
      "count": 987,
      "items": [feeds],
      "pageInfo": PaginationInfo
    }
  }
}

feeds

Description

Each feed is a webrtc or rtmp publication to a stream

Fields
Field Name Description
accountId - String Account id
started - Date Date when feed was started
active - Boolean flag indicating if the feed is currently active
ended - Date Date when feed was ended, null if currently active
name - String Stream name
streamId - String Stream id
Example
{
  "accountId": "xyz789",
  "started": "2007-12-03",
  "active": true,
  "ended": "2007-12-03",
  "name": "xyz789",
  "streamId": "xyz789"
}

feedsConnection

Description

A connection to a list of items.

Fields
Field Name Description
count - Int! Total object count.
pageInfo - PageInfo! Information to aid in pagination.
edges - [feedsEdge!]! Information to aid in pagination.
Example
{
  "count": 987,
  "pageInfo": PageInfo,
  "edges": [feedsEdge]
}

feedsEdge

Description

An edge in a connection.

Fields
Field Name Description
node - feeds! The item at the end of the edge
cursor - String! A cursor for use in pagination
Example
{
  "node": feeds,
  "cursor": "abc123"
}

feedsPagination

Description

List of items with pagination.

Fields
Field Name Description
count - Int Total object count.
items - [feeds!] Array of objects.
pageInfo - PaginationInfo! Information to aid in pagination.
Example
{
  "count": 123,
  "items": [feeds],
  "pageInfo": PaginationInfo
}

StreamView

streamViewFindOne

Response

Returns a streamviews

Arguments
Name Description
skip - Int

Example

Query
query StreamViewFindOne($skip: Int) {
  streamViewFindOne(skip: $skip) {
    accountId
    name
    streamId
    streamViewId
    started
    ended
    active
    client {
      userAgent
      trackingId
      geo {
        city
        continent
        country
        location
        sub
      }
    }
  }
}
Variables
{"skip": 987}
Response
{
  "data": {
    "streamViewFindOne": {
      "accountId": "xyz789",
      "name": "xyz789",
      "streamId": "xyz789",
      "streamViewId": 123.45,
      "started": "2007-12-03",
      "ended": "2007-12-03",
      "active": false,
      "client": streamviewsClient
    }
  }
}

streamViewFindMany

Response

Returns [streamviews!]!

Arguments
Name Description
skip - Int
limit - Int Default = 100

Example

Query
query StreamViewFindMany(
  $skip: Int,
  $limit: Int
) {
  streamViewFindMany(
    skip: $skip,
    limit: $limit
  ) {
    accountId
    name
    streamId
    streamViewId
    started
    ended
    active
    client {
      userAgent
      trackingId
      geo {
        city
        continent
        country
        location
        sub
      }
    }
  }
}
Variables
{"skip": 123, "limit": 100}
Response
{
  "data": {
    "streamViewFindMany": [
      {
        "accountId": "abc123",
        "name": "xyz789",
        "streamId": "abc123",
        "streamViewId": 123.45,
        "started": "2007-12-03",
        "ended": "2007-12-03",
        "active": true,
        "client": streamviewsClient
      }
    ]
  }
}

streamViewCount

Response

Returns an Int

Example

Query
query StreamViewCount {
  streamViewCount
}
Response
{"data": {"streamViewCount": 123}}

streamViewConnection

Response

Returns a streamviewsConnection

Arguments
Name Description
first - Int Forward pagination argument for returning at most first edges
after - String Forward pagination argument for returning at most first edges
last - Int Backward pagination argument for returning at most last edges
before - String Backward pagination argument for returning at most last edges

Example

Query
query StreamViewConnection(
  $first: Int,
  $after: String,
  $last: Int,
  $before: String
) {
  streamViewConnection(
    first: $first,
    after: $after,
    last: $last,
    before: $before
  ) {
    count
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        accountId
        name
        streamId
        streamViewId
        started
        ended
        active
        client {
          userAgent
          trackingId
          geo {
            city
            continent
            country
            location
            sub
          }
        }
      }
      cursor
    }
  }
}
Variables
{
  "first": 987,
  "after": "xyz789",
  "last": 987,
  "before": "abc123"
}
Response
{
  "data": {
    "streamViewConnection": {
      "count": 123,
      "pageInfo": PageInfo,
      "edges": [streamviewsEdge]
    }
  }
}

streamViewPagination

Response

Returns a streamviewsPagination

Arguments
Name Description
page - Int Page number for displaying
perPage - Int Default = 20

Example

Query
query StreamViewPagination(
  $page: Int,
  $perPage: Int
) {
  streamViewPagination(
    page: $page,
    perPage: $perPage
  ) {
    count
    items {
      accountId
      name
      streamId
      streamViewId
      started
      ended
      active
      client {
        userAgent
        trackingId
        geo {
          city
          continent
          country
          location
          sub
        }
      }
    }
    pageInfo {
      currentPage
      perPage
      pageCount
      itemCount
      hasNextPage
      hasPreviousPage
    }
  }
}
Variables
{"page": 123, "perPage": 20}
Response
{
  "data": {
    "streamViewPagination": {
      "count": 123,
      "items": [streamviews],
      "pageInfo": PaginationInfo
    }
  }
}

streamviews

Description

Information for each view of a stream

Fields
Field Name Description
accountId - String Account id
name - String Stream name
streamId - String Stream id
streamViewId - Float Stream view id
started - Date Date when stream view was started
ended - Date Date when stream view was ended, null if currently active
active - Boolean flag indicating if the feed is currently active
client - streamviewsClient
Example
{
  "accountId": "abc123",
  "name": "abc123",
  "streamId": "xyz789",
  "streamViewId": 123.45,
  "started": "2007-12-03",
  "ended": "2007-12-03",
  "active": false,
  "client": streamviewsClient
}

streamviewsClient

Fields
Field Name Description
userAgent - String User agent of the browser of client used to watch the stream
trackingId - String Tracking id used by the subscriber token
geo - streamviewsClientGeo
Example
{
  "userAgent": "xyz789",
  "trackingId": "abc123",
  "geo": streamviewsClientGeo
}

streamviewsClientGeo

Fields
Field Name Description
city - String Viewer city based on geo ip lookup
continent - String Viewer continent based on geo ip lookup
country - String Viewer country based on geo ip lookup
location - [Float] Coordingates in [lat,long,accuracy] of viewer based on geo ip lookup
sub - [String] Viewer subreginal location on geo ip lookup
Example
{
  "city": "abc123",
  "continent": "xyz789",
  "country": "abc123",
  "location": [987.65],
  "sub": ["xyz789"]
}

streamviewsConnection

Description

A connection to a list of items.

Fields
Field Name Description
count - Int! Total object count.
pageInfo - PageInfo! Information to aid in pagination.
edges - [streamviewsEdge!]! Information to aid in pagination.
Example
{
  "count": 987,
  "pageInfo": PageInfo,
  "edges": [streamviewsEdge]
}

streamviewsEdge

Description

An edge in a connection.

Fields
Field Name Description
node - streamviews! The item at the end of the edge
cursor - String! A cursor for use in pagination
Example
{
  "node": streamviews,
  "cursor": "xyz789"
}

streamviewsPagination

Description

List of items with pagination.

Fields
Field Name Description
count - Int Total object count.
items - [streamviews!] Array of objects.
pageInfo - PaginationInfo! Information to aid in pagination.
Example
{
  "count": 123,
  "items": [streamviews],
  "pageInfo": PaginationInfo
}

StreamStat

streamStatFindOne

Response

Returns a streamviewsAggregatedByStreamId

Arguments
Name Description
skip - Int

Example

Query
query StreamStatFindOne($skip: Int) {
  streamStatFindOne(skip: $skip) {
    accountId
    streamId
    from
    to
    active
    numStarted
    numEnded
  }
}
Variables
{"skip": 987}
Response
{
  "data": {
    "streamStatFindOne": {
      "accountId": "xyz789",
      "streamId": "abc123",
      "from": "2007-12-03",
      "to": "2007-12-03",
      "active": 123.45,
      "numStarted": 987.65,
      "numEnded": 123.45
    }
  }
}

streamStatFindMany

Arguments
Name Description
skip - Int
limit - Int Default = 100

Example

Query
query StreamStatFindMany(
  $skip: Int,
  $limit: Int
) {
  streamStatFindMany(
    skip: $skip,
    limit: $limit
  ) {
    accountId
    streamId
    from
    to
    active
    numStarted
    numEnded
  }
}
Variables
{"skip": 987, "limit": 100}
Response
{
  "data": {
    "streamStatFindMany": [
      {
        "accountId": "xyz789",
        "streamId": "xyz789",
        "from": "2007-12-03",
        "to": "2007-12-03",
        "active": 987.65,
        "numStarted": 987.65,
        "numEnded": 987.65
      }
    ]
  }
}

streamStatCount

Response

Returns an Int

Example

Query
query StreamStatCount {
  streamStatCount
}
Response
{"data": {"streamStatCount": 987}}

streamStatConnection

Arguments
Name Description
first - Int Forward pagination argument for returning at most first edges
after - String Forward pagination argument for returning at most first edges
last - Int Backward pagination argument for returning at most last edges
before - String Backward pagination argument for returning at most last edges

Example

Query
query StreamStatConnection(
  $first: Int,
  $after: String,
  $last: Int,
  $before: String
) {
  streamStatConnection(
    first: $first,
    after: $after,
    last: $last,
    before: $before
  ) {
    count
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        accountId
        streamId
        from
        to
        active
        numStarted
        numEnded
      }
      cursor
    }
  }
}
Variables
{
  "first": 987,
  "after": "abc123",
  "last": 123,
  "before": "abc123"
}
Response
{
  "data": {
    "streamStatConnection": {
      "count": 123,
      "pageInfo": PageInfo,
      "edges": [streamviewsAggregatedByStreamIdEdge]
    }
  }
}

streamStatPagination

Arguments
Name Description
page - Int Page number for displaying
perPage - Int Default = 20

Example

Query
query StreamStatPagination(
  $page: Int,
  $perPage: Int
) {
  streamStatPagination(
    page: $page,
    perPage: $perPage
  ) {
    count
    items {
      accountId
      streamId
      from
      to
      active
      numStarted
      numEnded
    }
    pageInfo {
      currentPage
      perPage
      pageCount
      itemCount
      hasNextPage
      hasPreviousPage
    }
  }
}
Variables
{"page": 123, "perPage": 20}
Response
{
  "data": {
    "streamStatPagination": {
      "count": 123,
      "items": [streamviewsAggregatedByStreamId],
      "pageInfo": PaginationInfo
    }
  }
}

streamviewsAggregatedByStreamId

Description

Per Stream stats

Fields
Field Name Description
accountId - String Account id
streamId - String Stream id
from - Date Start date of the stat period
to - Date End date of the stat period
active - Float Number of active viewers at the end of the period
numStarted - Float Number of views started during the period
numEnded - Float Number of views ended during the period
Example
{
  "accountId": "abc123",
  "streamId": "xyz789",
  "from": "2007-12-03",
  "to": "2007-12-03",
  "active": 987.65,
  "numStarted": 123.45,
  "numEnded": 987.65
}

streamviewsAggregatedByStreamIdConnection

Description

A connection to a list of items.

Fields
Field Name Description
count - Int! Total object count.
pageInfo - PageInfo! Information to aid in pagination.
edges - [streamviewsAggregatedByStreamIdEdge!]! Information to aid in pagination.
Example
{
  "count": 123,
  "pageInfo": PageInfo,
  "edges": [streamviewsAggregatedByStreamIdEdge]
}

streamviewsAggregatedByStreamIdEdge

Description

An edge in a connection.

Fields
Field Name Description
node - streamviewsAggregatedByStreamId! The item at the end of the edge
cursor - String! A cursor for use in pagination
Example
{
  "node": streamviewsAggregatedByStreamId,
  "cursor": "abc123"
}

streamviewsAggregatedByStreamIdPagination

Description

List of items with pagination.

Fields
Field Name Description
count - Int Total object count.
items - [streamviewsAggregatedByStreamId!] Array of objects.
pageInfo - PaginationInfo! Information to aid in pagination.
Example
{
  "count": 123,
  "items": [streamviewsAggregatedByStreamId],
  "pageInfo": PaginationInfo
}

AccountStat

accountStatFindOne

Arguments
Name Description
skip - Int

Example

Query
query AccountStatFindOne($skip: Int) {
  accountStatFindOne(skip: $skip) {
    accountId
    from
    to
    active
    numStarted
    numEnded
    streams
  }
}
Variables
{"skip": 987}
Response
{
  "data": {
    "accountStatFindOne": {
      "accountId": "abc123",
      "from": "2007-12-03",
      "to": "2007-12-03",
      "active": 123.45,
      "numStarted": 987.65,
      "numEnded": 987.65,
      "streams": 987.65
    }
  }
}

accountStatFindMany

Arguments
Name Description
skip - Int
limit - Int Default = 100

Example

Query
query AccountStatFindMany(
  $skip: Int,
  $limit: Int
) {
  accountStatFindMany(
    skip: $skip,
    limit: $limit
  ) {
    accountId
    from
    to
    active
    numStarted
    numEnded
    streams
  }
}
Variables
{"skip": 987, "limit": 100}
Response
{
  "data": {
    "accountStatFindMany": [
      {
        "accountId": "abc123",
        "from": "2007-12-03",
        "to": "2007-12-03",
        "active": 987.65,
        "numStarted": 123.45,
        "numEnded": 987.65,
        "streams": 987.65
      }
    ]
  }
}

accountStatCount

Response

Returns an Int

Example

Query
query AccountStatCount {
  accountStatCount
}
Response
{"data": {"accountStatCount": 123}}

accountStatConnection

Arguments
Name Description
first - Int Forward pagination argument for returning at most first edges
after - String Forward pagination argument for returning at most first edges
last - Int Backward pagination argument for returning at most last edges
before - String Backward pagination argument for returning at most last edges

Example

Query
query AccountStatConnection(
  $first: Int,
  $after: String,
  $last: Int,
  $before: String
) {
  accountStatConnection(
    first: $first,
    after: $after,
    last: $last,
    before: $before
  ) {
    count
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      node {
        accountId
        from
        to
        active
        numStarted
        numEnded
        streams
      }
      cursor
    }
  }
}
Variables
{
  "first": 987,
  "after": "xyz789",
  "last": 123,
  "before": "xyz789"
}
Response
{
  "data": {
    "accountStatConnection": {
      "count": 123,
      "pageInfo": PageInfo,
      "edges": [streamviewsAggregatedByAccountIdEdge]
    }
  }
}

accountStatPagination

Arguments
Name Description
page - Int Page number for displaying
perPage - Int Default = 20

Example

Query
query AccountStatPagination(
  $page: Int,
  $perPage: Int
) {
  accountStatPagination(
    page: $page,
    perPage: $perPage
  ) {
    count
    items {
      accountId
      from
      to
      active
      numStarted
      numEnded
      streams
    }
    pageInfo {
      currentPage
      perPage
      pageCount
      itemCount
      hasNextPage
      hasPreviousPage
    }
  }
}
Variables
{"page": 123, "perPage": 20}
Response
{
  "data": {
    "accountStatPagination": {
      "count": 987,
      "items": [streamviewsAggregatedByAccountId],
      "pageInfo": PaginationInfo
    }
  }
}

streamviewsAggregatedByAccountId

Description

Per account stats

Fields
Field Name Description
accountId - String Account id
from - Date Start date of the stat period
to - Date End date of the stat period
active - Float Number of active viewers at the end of the period
numStarted - Float Number of views started during the period
numEnded - Float Number of views ended during the period
streams - Float Number of published streams at the end of the period
Example
{
  "accountId": "abc123",
  "from": "2007-12-03",
  "to": "2007-12-03",
  "active": 987.65,
  "numStarted": 987.65,
  "numEnded": 123.45,
  "streams": 123.45
}

streamviewsAggregatedByAccountIdConnection

Description

A connection to a list of items.

Fields
Field Name Description
count - Int! Total object count.
pageInfo - PageInfo! Information to aid in pagination.
edges - [streamviewsAggregatedByAccountIdEdge!]! Information to aid in pagination.
Example
{
  "count": 987,
  "pageInfo": PageInfo,
  "edges": [streamviewsAggregatedByAccountIdEdge]
}

streamviewsAggregatedByAccountIdEdge

Description

An edge in a connection.

Fields
Field Name Description
node - streamviewsAggregatedByAccountId! The item at the end of the edge
cursor - String! A cursor for use in pagination
Example
{
  "node": streamviewsAggregatedByAccountId,
  "cursor": "abc123"
}

streamviewsAggregatedByAccountIdPagination

Description

List of items with pagination.

Fields
Field Name Description
count - Int Total object count.
items - [streamviewsAggregatedByAccountId!] Array of objects.
pageInfo - PaginationInfo! Information to aid in pagination.
Example
{
  "count": 123,
  "items": [streamviewsAggregatedByAccountId],
  "pageInfo": PaginationInfo
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

Date

Example
"2007-12-03"

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

PageInfo

Description

Information about pagination in a connection.

Fields
Field Name Description
hasNextPage - Boolean! When paginating forwards, are there more items?
hasPreviousPage - Boolean! When paginating backwards, are there more items?
startCursor - String When paginating backwards, the cursor to continue.
endCursor - String When paginating forwards, the cursor to continue.
Example
{
  "hasNextPage": true,
  "hasPreviousPage": false,
  "startCursor": "xyz789",
  "endCursor": "abc123"
}

PaginationInfo

Fields
Field Name Description
currentPage - Int!
perPage - Int!
pageCount - Int
itemCount - Int
hasNextPage - Boolean
hasPreviousPage - Boolean
Example
{
  "currentPage": 123,
  "perPage": 987,
  "pageCount": 987,
  "itemCount": 987,
  "hasNextPage": false,
  "hasPreviousPage": false
}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45