The easiest way to get started with the development is to use the provided web-based GraphQL IDE. You can access it from here.
https://graphql-gateway.optisigns.com/graphql
You also will need API key to provide authorization to your account. You can learn how to get your API key from here.
Query and Mutation
GraphQL provides two ways than you can interact with your data. Query is used to read or fetch data from the server. Mutation is used to modify or post data to the server.
Fetch the devices
This query will list all the devices available in your account. You can specify what fields you are interested and get it returned from the result.
query{
devices (query : {}) {
page{
edges{
cursor,
node{
_id,
deviceName,
UUID,
pairingCode,
currentType,
currentAssetId,
currentPlaylistId,
localAppVersion,
}
}
}
}
}
Fetch a specific asset
If you want to fetch the data following a condition, you can do so by supply an argument. This query will get the asset named "Houston Weather Test" in your account.
query{
assets (query : {originalFileName:"Houston Weather Test"}) {
page{
edges{
cursor,
node{
_id,
appType,
fileType,
name,
filename
}
}
}
}
}