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,

  // optional, 0 => published (default), 60 => hidden (draft)
  "local_status": 0,

  // optional, only with "local_status": 60
  // publishes the event automatically at this time (unix timestamp, in the future)
  "publish_at": 1578993674,

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

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

  // [Tik::Model::Content::RichTextContentBlock|Tik::Model::Content::MultiMediaContentBlock|
  //  Tik::Model::Content::WebEmbedContentBlock|Tik::Model::Content::QuoteContentBlock|
  //  Tik::Model::Content::EmojiContentBlock|Tik::Model::Content::PlayerCardContentBlock|
  //  Tik::Model::Content::SportEventContentBlock|Tik::Model::Content::ScoreboardContentBlock|
  //  Tik::Model::Content::PollContentBlock|Tik::Model::Content::QuizContentBlock|
  //  Tik::Model::Content::LinkedEventsContentBlock|Tik::Model::Content::AnimatedImageContentBlock]
  // LinkedEventsContentBlock: headline and items[].text are plain text, stored as sent;
  // escape them before inserting into HTML (see Event Content)
  "contents": [],

  // Optional: Tik::Model::Content::SportEventContentBlock
  // Only for sport events like soccer goal
  "sport_event": {}
}

Further Information:

Success Response: Tik::Model::Event Object

Hidden (Draft) and Scheduled Events

An event created with "local_status": 60 is hidden: readers do not see it, and editors see it in the Liveblog Editor, where they can publish it. To publish it via the API, update the event with "local_status": 0.

To publish a hidden event automatically, also set publish_at to a future unix timestamp. Set created_at to the same time, so the event shows the time it goes live. The event is published within about a minute of publish_at.

The liveblog’s editorial_publishing setting does not apply to events created via this API. They are published immediately unless you send "local_status": 60.

Examples

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

Simple Event with text:

{
  "_type": "Tik::Model::Event",
  "contents": [
    {
      "_type": "Tik::Model::Content::RichTextContentBlock",
      "text": "some event text"
    }
  ] 
}

Hidden (draft) Event with text:

{
  "_type": "Tik::Model::Event",
  "local_status": 60,
  "contents": [
    {
      "_type": "Tik::Model::Content::RichTextContentBlock",
      "text": "some event text"
    }
  ]
}

Scheduled Event, published automatically at publish_at:

{
  "_type": "Tik::Model::Event",
  "local_status": 60,
  "publish_at": 1893456000,
  "created_at": 1893456000,
  "contents": [
    {
      "_type": "Tik::Model::Content::RichTextContentBlock",
      "text": "some event text"
    }
  ]
}

Event with text, web embed, quote and media (video and image):

{
  "_type": "Tik::Model::Event",
  "contents": [
    {
      "_type": "Tik::Model::Content::RichTextContentBlock",
      "text": "some event text"
    },
    {
      "_type": "Tik::Model::Content::WebEmbedContentBlock",
      "url": "https://www.heise.de"
    },
    {
      "_type": "Tik::Model::Content::QuoteContentBlock",
      "text": "quote text",
      "author": "me",
      "source": "you"
    },
    {
      "_type": "Tik::Model::Content::MultiMediaContentBlock",
      "items": [
        {
          "_type": "Tik::Model::Content::VideoMediaContent",
          "source_url": "https://your.to/our/video.mp4"
        },
        {
          "_type": "Tik::Model::Content::ImageMediaContent",
          "source_url": "https://your.to/our/image.jpg"
        }
      ]
    }
  ]
}

Chapter Event:

{
  "_type": "Tik::Model::Event",
  "highlight": "milestone",
  "headline": "Title of chapter"
}

Soccer Goal Event with existing team and player

{
  "_type": "Tik::Model::Event",
  "sport_event": {
    "_type": "Tik::Model::Content::SportEventContentBlock",
    "local_id": "bm7ukAEqAA7q6896HwCJ",
    "sportstype": "soccer",
    "time_of_play": "23.",
    "event_type": "soccer.goal",
    "title": "Goal",
    "team": {
        "_id": "5d14b2fab781df0299486e55",
        "_type": "Tik::Model::Team",
    },
    "players": [
        {
            "_type": "Tik::Model::Content::SportEventPlayer",
            "event_player_type": "scorer",
            "event_player_title": "Scorer",
            "player": {
                "_id": "63e0e4d0439d70f10f748ab1",
                "_type": "Tik::Model::Player",
            }
        }
    ]
  },
  "contents": [
    {
      "_type": "Tik::Model::Content::RichTextContentBlock",
      "text": "What a beatiful goal!"
    }
  ] 
}