Xibo API - Access Denied

Hi All,

Im in the process of creating a digital signage system using Xibo for a local primary school, so far everything is good, I found an introduction to using the API to auto upload images to Xibo which id really like to get working.

So far I have ironed out alot of the bugs but now when it attempts the upload I get access denied which it attempts 3 times with the same access denied result and I cant see any reason why this would happen. The tour i`m following is below

Thanks

Access denied would imply that you haven’t granted permission for the upload to happen in the CMS for the application, or that whatever user you’ve granted that as isn’t able to upload the file type that you’re trying to use.

When you grant the application access to upload, it will do so as the user you grant it as, so all future calls from the application will appear to be from that user. Check that the user you granted the application access with has access to do whatever operations you need within the CMS directly.

Thanks for the info, as this is a test i`m using the admin user to authorise the application and as far as I know it should use the admin user to upload.

so surely as its admin I will have permission to upload, I have checked the application is authorised under the admin user

Can you upload a file to the CMS as your admin user via the web interface?

yes I can, with no issues at all

What is logged CMS side? Also you say “you’ve ironed out the bugs”

The guide works as written. So what have you changed?

code wise the only thing I have touched is LayoutID, RegionID, File to upload, and mediaName.

and of course I have entered the key and secret key into defaults.cfg

OK so I just downloaded the files, and ran them against a 1.7.5 CMS and it uploaded and replaced the files as expected:

alex@pc1500:~/Desktop/api$ python ReplaceVideo.py
Removing old media with ID 622
Adding new media with ID 4036
Video Uploaded and Layout Modified Successfully
alex@pc1500:~/Desktop/api$

Go back through and check the keys are correct, and that the layout and region ID are correct too.

Still having issues with this, I have tried a different layout and region, the only thing which I might have wrong is the mediaName, I assume this is the region name which you can add in the options on the media menu.

I may be wrong though

The region id is the ID from the raw XLF file for the layout. It’s automatically generated when the region is generated and cannot be configured. The example code shows you how to enumerate the regions of a layout and get their IDs.

The media name is the name of the media as it would appear in the library.

Is that the name of the media it is replacing in the library, I think iv got it wrong I thought it was the name of the region

It makes no difference what you call the media name. It will delete the existing media item and then create a new media item with the name you specify. You should make sure whatever name you specify isn’t currently in the library.