Data API - Python Script Generator

A guide on how to use RotaMaster to generate a python script that can call the Data API

While many people use our Data API (DAPI) directly, it is also possible to create a Python script via RotaMaster, which will create JSON files for you on your PC. This is useful for customers who use business intelligence tools, such as Microsoft's Power BI, and want an easy way to get data from RotaMaster into these tools.

To access the Python script generator, navigate to Utilities > Data API. If this is not visible for you, this is likely due to your organisation not being configured with a Data API licence. You can contact us to set this up.

This will launch a new dialog which will ask you to enter the API key in order to authorise your access to the API. You should enter your API access key in this field.

Once verified, the Script Generator dialog will launch.

The first thing to configure is where the JSON files should be saved when they are generated by the script. You can either choose to save them in the same location as the script, or to specify a different location form them.

Once you have picked an option, you will notice the icon next to the File Path title turns from a red cross to a green tick. This will happen on all headings in the side navigation bar. The red cross signifies an error (such as a mandatory field has not been completed) within that section and means when you come to generate the script you will be able to. A green tick signifies that everything is correct within that section. A grey circle means that the section will not be included in the script.

Some sections contain additional parameters, such as dates. These allow you to filter which information you would like to return from the API

Each section also contains a 'Try it out' button so you can check the data that will be returned - it should be noted that this section will only return a maximum of 10 records.

Once you have enabled all sections you would like to be included in the script, you can press the 'Generate' button at the bottom of the dialog. This will download the script to your PC, which you can then run to create the JSON files.