Quick start

Control your first Singular graphic with the REST API

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 lower thirds 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 here.

1. Get a template

In this step, you'll use the Singular Dashboard to get a control app template.

  1. Select Templates to open the template library.

  2. In the template library, search for UNO Lowers | Momentum.

  3. Double click on the template photo to open a preview.

  4. Select Use this template to download it. UNO Lowers | Momentum will be listed under Apps in the Dashboard.

2. See the output in a web browser

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.

  1. Select UNO Lowers | Momentum under Apps to highlight it.

  2. Click the i button at the top right of the page to open the Dashboard Inspector, which shows details about the app.

  3. Under App URLs and Token, locate and copy the Output URL.

  4. 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.

3. Send your first Singular API request and see the payload

In this step, you'll use the Singular API to return JSON data about the UNO Lowers | Momentum overlay.

This quick start makes API calls using Postman and cURL, but you can also use other languages and API platforms.

  1. Open the Singular API v2 Postman collection and press Run in Postman.

  2. In the Singular Dashboard, open the Dashboard inspector and copy the Shared APP Token for the UNO Lowers | Momentum control app.

  3. Back in Postman, navigate to Collections > Singular REST API > Singular API v2 > App Instance API (Token) > Get Control App Details > Get Control App Control.

  4. Replace :appToken in the URL with the actual app token from step 3.2.

  5. Click Save and Send to return a payload for the UNO Lowers | Momentum control app.

  6. 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:

{
        "subCompositionId": "57d57254-f15b-42ca-b68e-75b69875f5ea",
        "subCompositionName": "Lower - Header",
        "mainComposition": false,
        "state": "In",
        "payload": {
            "Header": "HEADER",
            "Main Text": "MAIN LINE OF TEXT"
        }
    }

4. Use the API to change an overlay's text

In this step, you'll change the text in the one of UNO Lowers | Momentum's overlays.

  1. Navigate to Collections > Singular REST API > Singular API v2 > App Instance API (Token) > Send Data to Control App >Update Control App Content.

  2. Update :appToken in the URL as you did in step 3.4.

  3. Select the Body tab and replace the JSON date with the code snippet from step 3.6 between the square brackets.

  4. In the JSON payload, change the text for "HEADER" and "MAIN LINE OF TEXT" to something else.

  5. Click Save.

  6. With the output URL window from step two visible, press Send and watch the text change in the web browser.

5. Use the API to trigger an overlay in and out

In this step, you'll animate the same overlay in and out.

  1. Navigate to the Update Control App Animation State request and select the Body tab.

  2. Update :appToken in the URL as you did in step 3.4 and 4.2.

  3. 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.

  4. With the output URL window from step two visible, press Save and Send and then watch the overlay change its animation state.

Next steps

Now that you've successfully used Singular, check out Singular Basics to see how Singular works and learn some key concepts. Or jump right into the REST APIs.

Last updated