Liveblogs (Games)

This API does not support features of the new Editor V2 and is mainly supported for sports use cases and as an augmentation of missing V6 APIs

Overview:

Create Liveblog

Request: POST /api/v5/write/ticker/create.json

Query Parameters: (none)

Post Document:

{
  // (string) Owner Organization ID
  "organization_id": "",

  // (string) (Sportstype or Custom Template ID)
  "template_id": "",

  // Tik::Model::BasicGameMetaInfo
  "meta_info": "",

  // Tik::Model::BasicGameOptions
  "options": "",

  // (array[String])
  "tags": "",
  
  // (string) will be used to build local_id (<org_id>_<external_id>)
  "external_id": "",

  // (array[Tik::Model::SharedPermission]) array of additional permissions for other organizations or users.
  // The provided organization_id is set as owner by default.
  "permissions": []
}

Examples

Post Document (news):

{  
   "template_id": "news",
   "_type": "Tik::Model::Game",
   "organization_id": "YOURID",
   "meta_info": {  
      "_type": "Tik::Model::GameMetaInfo::TitleGameMetaInfo",
      "editorial_publishing": false,
      "allow_comments": false,
      "starts_at": 1531985104,
      "title": "news title"
   }
}

Post Document (soccer):

{  
  "template_id": "soccer",
  "_type": "Tik::Model::Game",
  "organization_id": "YOUR_ORGANIZATION_ID",
  "options": {  
    "_type": "Tik::Model::Options::TimedGameOptions",
    "timing_type": "aui",
    "overtime_phase_length": 15,
    "regular_phase_length": 45,
    "num_regular_phases": 2
  },
  "meta_info": {  
    "_type": "Tik::Model::GameMetaInfo::TeamGameMetaInfo",
    "away_team": {  
       "_type": "Tik::Model::Team",
       "name": "Team Name"
    },
    "home_team": {  
       "_type": "Tik::Model::Team",
       "_id": "SOME_EXISTING_TEAM_ID"
    },
    "tournament": {  
       "_type": "Tik::Model::Tournament",
       "_id": "SOME_EXISTING_TOURNAMENT_ID"
    },
    "editorial_publishing": false,
    "allow_comments": true,
    "starts_at": 1531985104
  }
}

Success Response: Tik::Model::Game Object

You can create teams, tournaments and players "on the fly". Provide a proper object with a "name" attribute. We will perform a find or creat by the "name" attribute. (Only possible if your organization don't use the strict data mode. Can be configured in Settings > Defaults)

Modify Liveblog

Send one or more modifications to update a liveblog.

Return value: Tik::Model::Game (decorated)

Request: POST /api/v5/write/ticker/post_modifications.json

Query Parameters: (none)

Post Document:

{ 
  // local_id of the liveblog
  "local_id": "",

  // ticker_id of the liveblog (alternative to local_id)
  "ticker_id": "",

  // (array[Tik::Model::Modification::UserModification])
  "modifications": [],    
}

Success Response: Tik::Model::Game (decorated) Object

Allowed Modifications:

  • UpdateGameMetaInfoModification
  • UpdateGameMarketplaceInfoModification
  • UpdateGameStateModification
  • UpdateGameScoreInfoModification
  • DeleteGameModification
  • UpsertPermissionModification
  • DeletePermissionModification
The modifications are only used to edit the main attributes of the liveblog. There are additional API's to manage the events of the liveblog.

Examples

Post Document (UpdateGameMetaInfoModification with TitleGameMetaInfo):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::UpdateGameMetaInfoModification",
          "sportstype": "news",
          "meta_info": {  
              "_type": "Tik::Model::GameMetaInfo::TitleGameMetaInfo",
              "title": "Some new title",
              "editorial_publishing": false,
              "allow_comments": true,
              "starts_at": 1531985104
          }
      }
  ]
}

Post Document (UpdateGameMetaInfoModification with TeamGameMetaInfo):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::UpdateGameMetaInfoModification",
          "sportstype": "soccer",
          "meta_info": {  
              "_type": "Tik::Model::GameMetaInfo::TeamGameMetaInfo",
              "away_team": {  
                  "_type": "Tik::Model::Team",
                  "name": "Team Name"
              },
              "home_team": {  
                  "_type": "Tik::Model::Team",
                  "_id": "SOME_EXISTING_TEAM_ID"
              },
              "tournament": {  
                  "_type": "Tik::Model::Tournament",
                  "_id": "SOME_EXISTING_TOURNAMENT_ID"
              },
              "editorial_publishing": false,
              "allow_comments": true,
              "starts_at": 1531985104,
              "location": {  
                  "_type": "Tik::Model::Location",
                  "_id": "SOME_EXISTING_LOCATION_ID"
              }
          }
      }
  ]
}

Post Document (DeleteGameModification):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::DeleteGameModification",
          "local_status": "100"
      }
  ]
}

Post Document (UpsertPermissionModification):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::UpsertPermissionModification",
          "permission": {
            "permission": "w",
            "reftype": "Organization",
            "refid": "5e3944cf88cb463364cfd7ce"
          }
      }
  ]
}

Post Document (DeletePermissionModification):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::DeletePermissionModification",
          "refid": "5e3944cf88cb463364cfd7ce"
      }
  ]
}

Post Document (UpdateGameMarketplaceInfoModification):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
      {  
          "_type": "Tik::Model::Modification::UpdateGameMarketplaceInfoModification",
          "marketplace_info": {
            "_type": "Tik::Model::MarketplaceInfo::BasicMarketplaceInfo",
            "pricing": {
              "_type": "Tik::Model::Pricing",
              "_id": "SOME_EXISTING_PRICING_ID"
            },
            "detail": "Liveblog Marketplace description"
          }
      }
  ]
}

Post Document (UpdateGameStateModification with TimeBasedGameStateInfo):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
    {
      "_type": "Tik::Model::Modification::UpdateGameStateModification",
      "state_info": {
        "_type": "Tik::Model::GameStateInfo::TimeBasedGameStateInfo",
        "check_time": 1578994053, // timestamp event occured
        "check_seconds": 10, // seconds from beginning of current phase
        "is_break": true,
        "minute": 0, // DEPRECATED
        "recurrence": 1,
        "gamestate": 1
      }
    },
  ]
}

Post Document (UpdateGameScoreInfoModification):

{  
  "local_id": "YOUR_GAME_LOCAL_ID",
  "modifications": [  
    {
      "_type": "Tik::Model::Modification::UpdateGameScoreInfoModification",
      "score_info": {
        "_type": "Tik::Model::ScoreInfo::TeamGameScoreInfo",
        "away_score": 1,
        "home_score": 0
      }
    }
  ]
}

Show Liveblog

Request: GET /api/v5/write/ticker/show.json

Query Parameters:

  • local_id: The local_id of the liveblog

or

  • ticker_id: The ticker_id of the liveblog

  • compact: Returns a compact version of the liveblog (default: false)

Success Response: Tik::Model::Game (decorated) Object

List/Filter Liveblog

Request: GET /api/v5/write/ticker/search.json

Query Parameters:

  • owner_id: The ID of the owning user/organization
  • q: Query
  • template_id: Custom template or Sportstype
  • team_id: Team to filter by
  • tag: Tag to filter by
  • timeframe: Time period to filter by. Allowed values [‘today’, ‘tomorrow’, ‘thisweek’, ‘nextweek’, ‘thismonth’, ‘nextmonth’, ‘upcoming’, ‘current’, ‘future’, ‘monday’, ‘tuesday’, ‘wednesday’, ‘ thursday’, ‘friday’, ‘saturday’, ‘sunday’, ‘all’, ‘past’]
  • limit: Limit results per page
  • more: Page number

Success Response: Tik::Model::Collection[Tik::Model::Game] (decorated) Object

Create Event

Request: POST /api/v5/write/event/create.json

Query Parameters:

  • ticker_local_id: The local_id of the liveblog

Post Document:

{
  "_type": "Tik::Model::Event",

  // optional, if blank current time will be used
  "created_at": 1578993674,

  // optional, if blank current time will be used
  "updated_at": 1578993674,

  // Milestone Headline (only used for milestones)
  "headline": "milestone headline", 

  "highlight": "", // sticky | inplace | milestone

  "is_sticky": false,

  // [Tik::Model::Media]
  "media": [],

  // Tik::Model::GameStateInfo::TimeBasedGameStateInfo | Tik::Model::GameStateInfo::BasicGameStateInfo | Tik::Model::GameStateInfo::BaseballGameStateInfo | Tik::Model::GameStateInfo::RankedGameStateInfo | Tik::Model::GameStateInfo::TennisGameStateInfo
  "state_info": {}, 

  // Tik::Model::EventInfo::BasicEventInfo
  "event_info": {}
}

Success Response: Tik::Model::Event Object

Examples

POST /api/v5/write/event/create.json?ticker_local_id=YOUR_TICKER_LOCAL_ID

Simple Event with text:

{
  "_type": "Tik::Model::Event",
  "event_info": {
    "_type": "Tik::Model::EventInfo::BasicEventInfo",
    "title": "some event text",
  }
}

Event with text and media:

{
  "_type": "Tik::Model::Event",
  "event_info": {
    "_type": "Tik::Model::EventInfo::BasicEventInfo",
    "title": "some event text",
  },
  "media": [
    {
      "_type": "Tik::Model::Media",
      "subtype": "i",
      "title": "Some image title",
      "credit": "Some image credit",
      "url": "https://your.image.url/123",
    }
  ]
}

Soccer Goal Event with Assist:

{
  "_type": "Tik::Model::Event",
  "event_info": {
    "_type": "Tik::Model::EventInfo::BasicEventInfo",
    "event_reason": 276,
    "event_type": 100,
    "is_home_team": false,
    "other_player": {
      "_id": "5e2055a312eb81bb4a4d717f",
      "_type": "Tik::Model::Player",
    },
    "player": {
      "_id": "5e1f1e4a12eb818e0f62d385",
      "_type": "Tik::Model::Player",
    },
    "title": "Goal! Goal! Goal!"
  },
  "state_info": {
    "_type": "Tik::Model::GameStateInfo::TimeBasedGameStateInfo",
    "check_seconds": 275,
    "check_time": 1579185510,
    "gamestate": 1,
    "is_break": false,
    "minute": 4,
    "recurrence": 1
  }
}

Modify Event

Request: POST /api/v5/write/event/update.json

Query Parameters:

  • event_local_id: The local_id of the Liveblog

Post Document:

{
  "_type": "Tik::Model::Event",

  // optional, if blank previous created_at will be used
  "created_at": 1578993674,

  // optional, if blank current time will be used
  "updated_at": 1578993674,

  // Milestone Headline (only used for milestones)
  "headline": "milestone headline", 

  "highlight": "", // sticky | inplace | milestone

  "is_sticky": false,

  // [Tik::Model::Media]
  "media": [],

  // Tik::Model::GameStateInfo::TimeBasedGameStateInfo | Tik::Model::GameStateInfo::BasicGameStateInfo | Tik::Model::GameStateInfo::BaseballGameStateInfo | Tik::Model::GameStateInfo::RankedGameStateInfo | Tik::Model::GameStateInfo::TennisGameStateInfo
  "state_info": {}, 

  // Tik::Model::EventInfo::BasicEventInfo
  "event_info": {}
}

Success Response: Tik::Model::Event Object

Examples

POST /api/v5/write/event/update.json?event_local_id=YOUR_EVENT_LOCAL_ID

Simple Event with text:

{
  "_type": "Tik::Model::Event",
  "event_info": {
    "_type": "Tik::Model::EventInfo::BasicEventInfo",
    "title": "some updated event text",
  }
}

Delete Event

Request: POST /api/v5/write/event/delete.json

Query Parameters:

  • event_local_id: The local_id of the liveblog

Success Response: {} Object (200)

Examples

POST /api/v5/write/event/delete.json?event_local_id=YOUR_EVENT_LOCAL_ID