Add a trigger
POST/v2/game-plans/{gamePlanId}/triggers
const url = 'https://api.ligr.live/rest/v2/game-plans/1/triggers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"playlistId":1,"type":"live","group":"pregame","code":"example","period":1,"overtimeIndex":1,"triggerSeconds":1,"triggerConditions":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v2/game-plans/1/triggers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "playlistId": 1, "type": "live", "group": "pregame", "code": "example", "period": 1, "overtimeIndex": 1, "triggerSeconds": 1, "triggerConditions": "example" }'Beta. This operation can change between minor versions. See Beta status.
Adds a trigger that runs a playlist of this game plan. A live trigger fires on a fact code,
for example GOAL, and runs a live playlist. A break trigger fires on a break code, for
example aboutToStart, and runs a break playlist.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
Request Bodyrequired
Section titled “Request Bodyrequired”playlistId names a playlist of this plan. Its scope must match type.
object
Entity identifier
A JSON object, or null.
Responses
Section titled “Responses”Created
object
Entity identifier
The playlist the trigger runs.
The event that fires the trigger. A live trigger uses a fact code such as GOAL or YELLOW_CARD.
A break trigger uses a break code such as aboutToStart, playersEntering or timeTrigger.
Extra conditions, as a JSON object. For example { "corners": { "team": 3 } }.
Example
{ "type": "live", "group": "pregame"}Request is invalid
object
object
Examplegenerated
{ "message": "example", "details": { "additionalProperty": "example" }}Missing or invalid api key
object
Examplegenerated
{ "message": "example"}Api key provides insufficient access for the request
object
Examplegenerated
{ "message": "example"}Game plan, theme, playlist or trigger not found
object
Examplegenerated
{ "message": "example"}Organization has made too many requests
object
Examplegenerated
{ "message": "example"}An unexpected error has occured. If problems persist please contact support
object
Examplegenerated
{ "message": "example"}