I am still getting the following message in Postman :
{“files”:[{“name”:“1492523640-7615”,“size”:1316610,“type”:“multipart/form-data; boundary=--------------------------449316675376425057078541”,“error”:“Filetype not allowed”}]}
As I see, it’s incorrect parameter name
you have file, while it should be files
It’s correct in my guide, but indeed is wrong in the API documentation - fixed in my local branch and will be updated probably in the next release when we merge it.
The only problem is how am i going to get it work in python?
Gr Jan
Van: Peter Mis [mailto:noreply@xibo.org.uk]
Verzonden: dinsdag 18 april 2017 16:40
Aan: jan@jdt-services.nl
Onderwerp: [Xibo Community] [Support] API tempel 1.8 Upload Media items
As I see, it’s incorrect parameter name
you have file, while it should be files
It’s correct in my guide, but indeed is wrong in the API documentation - fixed in my local branch and will be updated probably in the next release when we merge it.
The owner of the file uploaded via API will be set to the owner of the application.
ie for example for postman, if you’ve added that application from your account to the CMS then you’re the owner of it, then if you upload new media via postman, you will be the owner of that media as well.
If you call GET media for that media file then you will see owner in response as well.
Yes, I believe that would be the way to go if it’s required.
So as long as you change the ‘name’ parameter passed with the upload file call, it will be uploaded to the CMS:
For example, I’ve uploaded the same sceenshot 3 times as API Upload 1 API Upload 2 and API Upload 3
the /library?file=witcher3_2016_09_17_21_44_13_762.png is the original fileName
on upload it receives a mediaId and is stored as <mediaId>.png
the /library?file=API%20UPLOAD%203 is the name of the media file specified in the upload API call ie API Upload 3 as %20 is encoded space character ' '
It is possible, although assigning media files directly to a display (or display group for that matter) is not really recommended, in most cases you want to have all required medias on the layout and schedule that layout to the player.
Anyway, each display has it’s own unique displayGroupId (display specific), which you can see by using the following call
GET {{url}}/api/display?embed=displaygroups
You can also add a display name as a filter like
GET {{url}}/api/display?display=DISPLAYNAME&embed=displaygroups
Once you will have the display specific displayGroupId you can use the call you mentioned to assign media to it.