Quick start
Control your first Singular graphic with the REST API
Last updated
Control your first Singular graphic with the REST API
Last updated
In this guide, you’ll create an overlay, see its output in a web browser, and control it with Singular's REST API.
This quick start uses a template, but the process is the same for other templates and even overlays you create from scratch.
You’ll need a Singular account to follow this quick start. Get your free account .
In this step, you'll use the Singular Dashboard to get a control app template.
Open the.
Select Templates to open the template library.
In the template library, search for UNO Lowers | Momentum.
Double click on the template photo to open a preview.
Select Use this template to download it. UNO Lowers | Momentum will be listed under Apps in the Dashboard.
In this step, you'll get the output URL of the UNO Lowers | Momentum control app and paste it into a web browser to see one of the control app's overlays.
Select UNO Lowers | Momentum under Apps to highlight it.
Paste the Output URL into your internet browser.
The webpage should look like the image below. Keep this tab open for steps three and four to see how the APIs change the overlay.
In this step, you'll use the Singular API to return JSON data about the UNO Lowers | Momentum overlay.
In the Singular Dashboard, open the Dashboard inspector and copy the Shared APP Token for the UNO Lowers | Momentum control app.
Back in Postman, navigate to Collections > Singular REST API > Singular API v2 > App Instance API (Token) > Get Control App Details > Get Control App Control.
Replace :appToken
in the URL with the actual app token from step 3.2.
Click Save and Send to return a payload for the UNO Lowers | Momentum control app.
Inspect the payload and notice that this control app is set up so the API can access its color, text, and In/Out state. In particular, we'll use this snippet from in the next step:
In this step, you'll change the text in the one of UNO Lowers | Momentum's overlays.
Navigate to Collections > Singular REST API > Singular API v2 > App Instance API (Token) > Send Data to Control App >Update Control App Content.
Select the Body tab and replace the JSON date with the code snippet from step 3.6 between the square brackets.
In the JSON payload, change the text for "HEADER"
and "MAIN LINE OF TEXT"
to something else.
Click Save.
In this step, you'll animate the same overlay in and out.
Navigate to the Update Control App Animation State request and select the Body tab.
Change the value of subCompositionId
to "57d57254-f15b-42ca-b68e-75b69875f5ea"
, from the previous request, and value of "state"
to "In"
or "Out"
to animate this overlay in or out respectively.
Click the i button at the top right of the page to open the , which shows details about the app.
Under App URLs and Token, locate and copy the .
This quick start makes API calls using and cURL, but you can also use other languages and API platforms.
Open the and press Run in Postman.
Update :appToken
in the URL as you did in .
With the output URL window from visible, press Send and watch the text change in the web browser.
In the payload from the GET
Control App Control request in , this is the sub-composition that you'll update:
2. Replace :appToken
with the actual Shared App Token you got in .
4. With the output URL window from visible, copy your updated PATCH
request and past it into the command line and press enter. Then, watch the text update in the web browser.
Update :appToken
in the URL as you did in and 4.2.
With the output URL window from visible, press Save and Send and then watch the overlay change its animation state.
In the payload from the GET
Control App Control request in , this is the sub-composition that you'll update to trigger an overlay in and out.
2. Replace :appToken
with the actual Shared App Token you got in .
4. With the output URL window from visible, copy your updated PATCH
request, paste it into the command line, and press enter. Then, watch the overlay go to its Out state.
6. With the output URL window from visible, copy your updated PATCH
request, paste it into the command line, and press enter. Then, watch the overlay go to its Out state.
Now that you've successfully used Singular, check out to see how Singular works and learn some key concepts. Or jump right into the .