Facility Control

 View Only
  • 1.  API from Rundwon Creator

    Posted 10-25-2017 10:42
    I was wondering if it is possible to get information from rundown creator through API into dashboard and if it possible how? I have no experience with coding/programing. And when i get the information i can set up some logics to trigger actions like CG(xpression) and lightcues on our ma dot2.

    Big thanks for any help on this topic

    Info on the API
    https://rundowncreator.com/api/

    I got the APIkey, Token and URL but i dont know how to get the information into dashboard.


  • 2.  RE: API from Rundwon Creator

    Posted 10-25-2017 13:50

    This appears to be a fairly simple restful API.

    What you would do is create a function to process the content once it has been downloaded and then use ogscript.asyncPost to request the information from the server.

    function handleResults(resultData)
    {
       if (resultData == null)
       {
           ogscript.debug("NO DATA");
       }
       else
       {
            var resultsAsObject = JSON.parse(resultData);
            //WORK WITH THE JSON OBJECT HERE
       }
    }
    ogscript.asyncPost('PUT_YOUR_URL_HERE', null, handleResults);

    #DashBoard


  • 3.  RE: API from Rundwon Creator

    Posted 10-30-2017 12:05
    Okay, Thanks! I'm new to coding and have no experience. Where should I input the commands I want to request from Rundowncreator to get the information i want. Like the command "getRundown". Could you give me an example of how this is solved?

    Information:

    URL: https://rundowncreator.com/luc/API.php

    ?APIKey=Even
    &APIToken=o0YLzKCLkKmb2egv1Ti5HYv9oQbISI
    &Action=getRundowns
    #DashBoard


  • 4.  RE: API from Rundwon Creator

    Posted 10-30-2017 13:06
    In that scenario, your URL would be:
    https://rundowncreator.com/luc/API.php?APIKey=Even&APIToken=o0YLzKCLkKmb2egv1Ti5HYv9oQbISI&Action=getRundowns

    It is hard to tell you where you should put it without knowing what exactly you're trying to do. Generally, we would recommend creating a function to fetch the rundown and putting it into an tag at the top of your panel... but without knowing what you're looking to do with the results of fetching the rundown, it's a bit difficult to advise beyond that.

    James
    #DashBoard


  • 5.  RE: API from Rundwon Creator

    Posted 11-02-2017 20:41
    I understand!

    I'm just testing if i can build my own rundown and getting all the info from rundowncreator.

    Yes, it will be some coding/scripting but i think it will help me get a better understanding and get experience.
    #DashBoard


  • 6.  RE: API from Rundwon Creator

    Posted 11-03-2017 13:37

    In that case, I would recommend putting your "handleResults" function in an tag near the top of your file.
    You can then have a button or an that calls the functions in your .

    Your handler can run through the returned JSON object for the rundown and put them in parameters you can see on screen.

    Here is a fairly simple example of how you would interact with the JSON object:

    <abs contexttype="opengear">
       <meta>
          <params>
             <param access="1" constrainttype="INT_NULL" name="Rundown ID" oid="params.RundownID" precision="0" stateless="true" type="INT16_ARRAY" value="-1" widget="default"/>
             <param access="1" maxlength="0" name="Title" oid="params.Title" precision="0" stateless="true" type="STRING_ARRAY" value=" " widget="default">
                <value> </value>
             </param>
             <param access="1" constrainttype="STRING_CHOICE" name="Table" oid="params.table" precision="0" stateless="true" type="INT16" value="-1" widget="table">
                <constraint>params.RundownID</constraint>
                <constraint>params.Title</constraint>
             </param>
          </params>
       </meta>
       <meta>
          <api immediate="true">function handleResults(resultData)
    {
       if (resultData == null)
       {
           ogscript.debug("NO DATA");
       }
       else
       {
            var resultsAsObject = JSON.parse(resultData);
            var ids = [];
            var titles = [];
            for (var i = 0; i &lt; resultsAsObject.length; i++)
            {
                ids.push(resultsAsObject[i]["RundownID"]);
                titles.push(resultsAsObject[i]["Title"]);
            }
    
            //We need to make sure we always have at least one element in a parameter
            if (ids.length == 0)
            {
                ids.push("");
                titles.push("");
            }
    
            params.setAllValues('params.RundownID', ids);
            params.setAllValues('params.Title', titles);
       }
    }
    
    function fetchRundown()
    {
       ogscript.asyncPost('https://rundowncreator.com/luc/API.php?APIKey=Even&amp;APIToken=o0YLzKCLkKmb2egv1Ti5HYv9oQbISI&amp;Action=getRundowns', null, handleResults);
    }
    </api>
          <ogscript handles="onload">
    
    
    /*! block id=1000 !*/
    fetchRundown()
    /*!!
     &lt;block id="1000" type="function_fetchRundown" x="10" y="100" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;97f7d234533212934b6c5e069b1d31b0&lt;/checksum&gt;!!*/</ogscript>
       </meta>
       <button buttontype="push" height="81" left="15" name="Refresh" top="17" width="172">
          <task tasktype="ogscript">
    
    
    /*! block id=1001 !*/
    fetchRundown()
    /*!!
     &lt;block id="1001" type="function_fetchRundown" x="10" y="100" w="243" /&gt;
    !!*/
    /*!!&lt;checksum&gt;2cd1be6cfe34db06a453cd5214acd084&lt;/checksum&gt;!!*/</task>
       </button>
       <param expand="true" height="209" left="17" oid="params.table" showlabel="false" top="117" width="488"/>
    </abs>

    #DashBoard


  • 7.  RE: API from Rundwon Creator

    Posted 10-10-2019 02:13

    Hey!  Addison from Rundown Creator here.  This thread is a little old, but I thought I'd chime in to let you know we just launched some new XPression integration that you might be interested in.  You can learn more about it here, but basically what it allows you and your team to do is insert information for lower-thirds, fullscreen graphics, over-the-shoulder boxes, and more into Rundown Creator, then play them out with a single key press from the XPression sequencer. It's all real-time, so any changes made in Rundown Creator show up instantly in XPression.  It works with all versions of XPression and doesn't require any special options.  Happy to answer any questions you might have!


    #DashBoard