Skip to content

Attach an import candidate

POST/v2/themes/{themeId}/rive-graphics/candidates/{candidateId}/graphics

POST
/v2/themes/{themeId}/rive-graphics/candidates/{candidateId}/graphics
curl --request POST \
--url https://api.ligr.live/rest/v2/themes/1/rive-graphics/candidates/example/graphics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "selection": { "artboardIndex": 1, "stateMachineIndex": 1 }, "configuration": { "bindings": [ { "id": "example", "expression": "example", "defaultValue": true, "sourceArrayPath": "example", "exposed": { "name": "example", "expression": "example", "required": true, "entityType": "player", "width": 1, "height": 1 }, "imageTransform": { "outWidth": 1, "outHeight": 1, "fit": "cover", "scaleX": 1, "scaleY": 1, "rotateDeg": 1, "skewXDeg": 1, "skewYDeg": 1, "translateX": 1, "translateY": 1, "padding": { "top": 1, "right": 1, "bottom": 1, "left": 1 }, "background": { "r": 1, "g": 1, "b": 1, "a": 1 }, "anchor": "center" } } ], "inputs": [ { "id": "example", "expression": "example" } ], "assets": [ { "id": "example", "expression": "example", "exposed": { "name": "example", "defaultFileId": 1, "required": true, "expression": "example", "entityType": "player" } } ], "controlVariables": [ { "id": "example", "name": "example", "type": "string", "defaultValue": true, "description": "example", "options": [ "example" ], "exitMode": "immediate" } ], "userExpressions": [ { "id": "example", "name": "example", "expression": "example", "description": "example" } ], "renderer": "webgl2", "deferInitialShow": true, "scale": 1, "x": 1, "y": 1 }, "lockToken": "example" }'

Beta. This operation can change between minor versions. See Beta status.

Create, fill, or replace a working Rive graphic from a ready candidate. Send the x-ligr-edit-session header while an edit session is open.

themeId
required
number format: double
candidateId
required
string
Media typeapplication/json
object
name
required
string
selection
required
object
artboardIndex
required
integer format: int32
stateMachineIndex
required
integer format: int32
configuration

On replacement, submit only bindings, inputs, assets and controlVariables. A submitted control variable updates the control variable with the same name and keeps its id. User expressions and layout are edited through the operation routes.

object
bindings
Array<object>
object
id
required
string
expression
string
defaultValue
Any of:
boolean
sourceArrayPath
string
exposed
object
name
required
string
expression
required
string
required
required
boolean
entityType
required
string
Allowed values: player team competition ad
width
number format: double
height
number format: double
imageTransform
object
outWidth
number format: double
outHeight
number format: double
fit
string
Allowed values: cover contain stretch
scaleX
number format: double
scaleY
number format: double
rotateDeg
number format: double
skewXDeg
number format: double
skewYDeg
number format: double
translateX
number format: double
translateY
number format: double
padding
object
top
number format: double
right
number format: double
bottom
number format: double
left
number format: double
background
object
r
number format: double
g
number format: double
b
number format: double
a
number format: double
anchor
string
Allowed values: center top-left top top-right left right bottom-left bottom bottom-right
inputs
Array<object>
object
id
required
string
expression
string
assets
Array<object>
object
id
required
string
expression
string
exposed
object
name
required
string
defaultFileId
integer format: int32
>= 1
required
required
boolean
expression
string
entityType
required
string
Allowed values: player team competition ad
controlVariables
Array<object>
object
id
required
string
name
required
string
type
required

An entity type (team, player, fact, …) gets its reference data shape (dataSchema) from the server.

string
Allowed values: string number boolean enum team player match fact teamStat set round court stat period
defaultValue
Any of:
boolean
description
string
options
Array<string>
exitMode
string
Allowed values: immediate deferred
userExpressions
Array<object>
object
id
required
string
name
required
string
expression
required
string
description
string
renderer
string
Allowed values: webgl2 canvas
deferInitialShow
boolean
scale
number format: double
x
number format: double
y
number format: double
lockToken
string

Created

Media typeapplication/json
object
candidateId
required
string
themeId
required
integer format: int32
graphicId
required
string
assetId
required
string
droppedBindings

A replace only: the ids of the draft’s bindings that the new file does not have. The replace removed them with their expressions. A repeated attach answers the same list.

Array<string>
enumMismatches

Set when an enum binding of the draft reads a theme variable that has options the Rive enum does not list.

Array<object>

A warning, not an error: the write succeeded. The binding expression reads one enum theme variable, and some options of that variable are not values of the Rive enum. Rive ignores such a value, so on air the property keeps its last value. Make the options and the enum values the same, or change the expression.

object
bindingId
required

The data binding id, for example Main.Typeface.

string
themeVariable
required

The theme variable that the expression reads, for example Typeface for $t.Typeface.

string
optionsNotInEnum
required

Options of the theme variable that the Rive enum does not list.

Array<string>
enumValuesNotInOptions
required

Values of the Rive enum that no option of the theme variable sets.

Array<string>
Examplegenerated
{
"candidateId": "example",
"themeId": 1,
"graphicId": "example",
"assetId": "example",
"droppedBindings": [
"example"
],
"enumMismatches": [
{
"bindingId": "example",
"themeVariable": "example",
"optionsNotInEnum": [
"example"
],
"enumValuesNotInOptions": [
"example"
]
}
]
}

Invalid Rive request

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Theme, import, graphic, version, or file not found

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Rive import or graphic state conflict

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Rive candidate or source is no longer available

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Rive file or configuration cannot be used

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Rive source imports are unavailable

Media typeapplication/json
object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}