Xibo-API automated Upload Script

Hello there,

i followed your manual to upload media with the API but now i need to know how i can automate it so that it updates the picture or any media type in the widget by itself. Like a script or something.
I am using Postman and 1.8rc02

Does it still work with this?: http://xibo.org.uk/2014/02/19/scripting-xibo-content-management-a-brief-tour-of-the-api/ or is there any solution for postman?

For now iam can update Text boxes with: {{url}}/api/playlist/widget/5
and pictures with: {{url}}/api/library

How does it work with xml files?

Hope you can help me :slight_smile:

The article you’ve pointed to is for the beta API in 1.7, which has been abandoned in favour of the better 1.8 API.

You can indeed write something to automatically update a image widget in a layout - it is actually very similar to uploading a file, except you pass in the old mediaId (of the existing image).

Postman is just a tool to easily generate requests in a GUI - you would need a full programming language to do what you want. Unfortunately we do not have an article for that at present.

The logic would be something like:

  • Get the Layout were interested in and parse it for the mediaId of the image we want to replace.
  • Call library/add with a new file and the mediaId obtained above

We have a PHP library that handles oAuth and provides some common objects: https://github.com/xibosignage/oauth2-xibo-cms

You could use any language you are familiar with though.