Replace media in Media Library API

Hey everyone,

We have a layout with a website showing on it, that shows 6 pictures every 3 minutes.
The pictures are about 170kb, so: (170kb * 6) * 20 (an hour) * 24 hours a day *31 days = like 15 gigs.

These pictures are from another source and are updated every 15 minutes, so caching isn’t really an option.

What i thinking of doing, and not sure if its possible, but run a script that downloads the pictures every half hour and puts in the media library, then is stored on the players cache. And then repeats again in 30 minutes, removing the old file and replacing it with the new one.

I don’t know much about API yet, but i downloaded Postman and i’m using a test api.
I got “Library Upload” to work, but it generates a new ID every time the new picture is uploaded, which is fine because the API also updates any layout that was using the old picture to use the new ID.

So that works, but how do i run this API automatically every half hour? Can i schedule an API? Do i need to create a webpage that has the script in it and run that page as a layout every half hour in the Xibo schedule? If so, how do export the script from postman? Is it Javascript or PHP?

Thanks guys!

Probably easiest to write the script with API calls you need (access_token, get media and media replace at least I’d imagine), in whatever language suits you best, then create a task in the system to run that script every 30 min.