API questions about events and updates thereof

24 views
Skip to first unread message

Johannes Hass

unread,
Feb 13, 2022, 2:50:15 PM2/13/22
to Opencast Users
Hei.

I may come across a bit frustrated but the API documentation is SEVERELY lacking and amounts to banging your head against a brick wall at several points.

I'm a bit confused as to why a video entry is labelled an "event" but nevermind that. I've chalked it up to some weird idiosyncracy.

Now, what I want to do is to simply update an event's description.

When I try to do so via POST /{eventId} and then simply give it a form parameter of "description=foo" the server will tell me that it was not able to parse the ACL.

Now, I'm confused: I don't want to update the ACL and, as I'm testing this with admin rights, the ACL should not matter. The API also makes no mention of what parameters are required and which are not.

It also does not tell me which form those ACL parameter should take, just that "it's a collection of roles". What does that mean? JSON? CSV? XML? In which format exactly?

Well, it's not JSON because if I get the ACL through GET /{eventId}/acl and directly plonk that into the request I get an error. Well done!

I also tried using PUT /{eventId}/metadata but somehow no one ever explains in the docs what this is supposed to mean:

"For a metadata catalog there is the flavor such as 'dublincore/episode' and this is the unique type."

I just want to change the description...

Greg Logan

unread,
Feb 14, 2022, 11:31:22 AM2/14/22
to Opencast Users
Hi Johannes,

I understand your frustration, the API has its quirks.  A brief explanation of why we refer to everything as an event: Because some adopters ingest audio-only recordings :)

In our API POST is generally used to *create* things, where PUT is used to *modify*.  In creating an event, you do have to specify things like the ACL, otherwise the event would not have one.  In general, Opencast as a whole uses the same format[1] for ACL related things, so you're likely to be able to copy and paste things like this easily.  Opencast keeps track of the flavour of files so that it knows what to do with the various input files it gets.  The dublincore/episode file is the metadata[2] for your event - this is also what the admin UI is showing you if you've opened the metadata tab.  To modify that data via the API, the easiest is probably to use GET /{eventId}/metadata?{type}, with type=dublincore/episode.  This will give you a JSON representation of the dublincore metadata.  Modify that, then feed it to PUT /{eventId}/metadata, with type=dublincore/episode as well.  That should get things working.

G




--
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.
Reply all
Reply to author
Forward
0 new messages