Using Python for scheduling API


#1

Hello everyone!

I’m a bit stuck how to implement the schedule API to schedule now a specific piece of media to a specific display. The idea is that a python script will generate a result and that result will trigger the schedule API and schedule now a specific media item.

Has anyone done this before?


#2

Are you working in 1.7 or 1.8 CMS?


#3

I’m using the 1.8 CMS. I’m also using the latest Android Client.


#4

Obviously I do not know what you have in your script and how will it generate the ‘result’, but whatever it does it can they fire up a changeLayout API call or schedule add call to add a new layout to the display.

API calls are documented here - https://xibo.org.uk/manual/api/#/displayGroup/displayGroupActionChangeLayout

Alternatively if it should change some media on a layout that already exists then you can do that too via API.

With that changeLayout call, there are several topics on this very site about it, but I’ll say it again.
Each display has it’s own unique display specific displaygroupId which you can use in that call to changeLayout on a single specific display.


#5

Ah! I couldn’t find that list of api calls. Thanks Peter!


#6

I’m having an issue with connecting to the CMS via the api on swagger. It keeps coming up with a 404 error when I try to authorise it. The CMS was installed with Docker.

It got me thinking, since the script will be running on the ec2 instance that’s hosting the CMS, is there a way to control the CMS on the host computer without having to connect via the API - something like a command line interface?


#7

I’d suggest looking at my API introduction guide, use that as a base and then write scripts if required.

The CMS and items in it can be changed either via webUI or API, technically you can also change things directly in the db by command line, but that’s not recommended.


#8

I’ve gone through the documents but I haven’t seen anything that could solve this error when it tries to connect: {"error":404,"message":"Unknown Route","property":null,"help":null}


#9

Usually means that the route you have in your call does not match any existing defined routes, could you tell us what call did you use please?
If you have that in Postman then screenshot of that would be sufficient.