1.8beta API Getting MediaID when adding a new media in library

When using this API call
It seems there is no mean to get the MediaID of the newly added media.

I have looked at the PHP Controller and I’ve not found any clue to get this MediaID

We need this to assign media to users and displays with subesequent API calls

Thanks for your help

It should return media Id when you upload it via api.

Alternatively use call GET /library http://xibo.org.uk/manual-tempel/api/#!/library/librarySearch
you can filter it as well, for example by name

The response we get does not seem to include the MediaID:


Filtering the search by Name wont be good for our Use case, as the media name may not be unique (it is not an index in our system), and the MediaID is more strict.

62 is the mediaId of the file you uploaded.

Thanks for the clue, seems strange to embed an id in the file name, I assume this is to avoid duplicate file names in the library directory.
By the way, this API documentation does seem to be exhaustive (for example, does not describe the “name” parameter as input, and the details of response given such as URL usage), this can be useful to extend it.

Yes, current documentation is missing 4 parameters can be passed in this call - it will be updated with rc3.
All parameters are also listed in my api guide.

Thanks for these updates Peter, we will use rc3 soon !
Can you provide me the link to your api guide, if it is already available ?


Thanks, this guide is really useful and well done

We will return mediaId in rc3 though, right?

That’s correct.

Example response:

 "files": [{
      "name": "API UPLOAD",
      "size": 6121,
      "type": "image/png",
      "url": "/api/library?file=fileName.png&download=1",
      "mediaId": 557,
      "storedas": "557.png",
      "duration": 10,
      "retired": 0,
      "fileSize": 6121,
      "md5": "910ed53924e45ee37399a1e3a8aceb61",
      "error": ""
1 Like