API Examples
This page provides a small set of practical examples for the most common integration workflows.
Login
mutation Login($input: LoginInput!) {
login(input: $input) {
user {
id
username
role
}
sessionToken
}
}
Example variables:
{
"input": {
"username": "operator1",
"password": "example-password"
}
}
After login, send the returned sessionToken in the Authorization header.
Authenticated Query
query GetUser($id: Int!) {
user(id: $id) {
id
username
role
}
}
Example curl:
curl "http://localhost:7376/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_SESSION_TOKEN" \
--data '{
"query": "query GetUser($id: Int!) { user(id: $id) { id username role } }",
"variables": { "id": 1 }
}'
List Query With Pagination
query ListUsers(
$where: UsersWhereInput
$offset: Int
$limit: Int
$sort: SortInput
) {
users(where: $where, offset: $offset, limit: $limit, sort: $sort) {
items {
id
username
}
count
}
}
Example variables:
{
"offset": 0,
"limit": 20,
"where": {
"firstName": {
"contains": "Nat"
}
}
}
Asset Upload
Use a multipart GraphQL request against createAsset or updateAsset.
Mutation shape:
mutation CreateAsset($input: CreateAssetInput!) {
createAsset(input: $input) {
id
name
fileName
duration
}
}
Example variables shape:
{
"input": {
"projectId": 1,
"name": "Lobby Reel 01",
"duration": 15,
"file": null
}
}
The binary file is supplied through multipart mapping rather than inline JSON.
Schedule Preview
query GetSchedulePreview(
$screenId: Int!
$time: BigInt!
$showUnpublished: Boolean
) {
schedulePreview(
screenId: $screenId
time: $time
showUnpublished: $showUnpublished
) {
screen {
id
name
}
order {
id
type
}
}
}
Example variables:
{
"screenId": 1,
"time": 1718042400000,
"showUnpublished": false
}
Enable Quick Play
mutation EnableQuickPlay($input: EnableQuickPlayInput!) {
enableQuickPlay(input: $input) {
id
quickPlayEnabled
quickPlayId
}
}
Example variables using an event:
{
"input": {
"projectId": 1,
"eventId": 123
}
}
Disable Quick Play
mutation DisableQuickPlay($input: DisableQuickPlayInput!) {
disableQuickPlay(input: $input) {
id
quickPlayEnabled
}
}
Example variables:
{
"input": {
"projectId": 1
}
}
Logs Query
query ListLogs(
$screenId: Int
$playerId: Int
$startTime: BigInt
$endTime: BigInt
$limit: Int
$offset: Int
) {
logs(
screenId: $screenId
playerId: $playerId
startTime: $startTime
endTime: $endTime
limit: $limit
offset: $offset
) {
id
assetId
screenId
playerId
time
duration
}
}
License Activation
mutation ActivateLicense($input: ActivateLicenseInput!) {
activateLicense(input: $input) {
id
status
expiresAt
active
}
}
Stub screenshot: API client captures next to the most important integration examples on this page. Save final image at packages/docs/screenshots/api-examples-client.png.