steamhead 10 Posted August 21, 2020 Author Posted August 21, 2020 And according to swagger, neither is /emby/users/{UserId}/items/{ItemId}, which is why I've had so much trouble trying to find a way to get a full record so far. But I assume from your recommendation you've got that working, so it's all very confusing for a new API user Even more confusing is the you have a GET /Items to find the item and a POST /Items/{ItemID} to update the item, but there is really little point if you can't get the record to update without resorting to the user method of authentication. I'm going to continue this over on the API forum now, as my experience so far has generated more questions in different directions, so I'll post a few separate threads to keep things in context. Thanks for all the help so far, see you on the other side.
PenkethBoy 2068 Posted August 21, 2020 Posted August 21, 2020 GET and POST are standard rest api stuff nothing specific to emby Dont assume that either tha API (swagger) or the wiki are correct as things can change very quickly Ive told you how to do it and which endpoints to use - dont overthink it - its sometime just trial and error and yes what i have told you works fine has done for years have numerous scripts using that method with no issues. The easiest way is usually to do what you want to do in the web GUI - then look through in detail the emby log for that time period and you will see what emby is doing and then you can try and repeat it in swagger - then you have a working method to code into you script etc
Luke 42078 Posted August 22, 2020 Posted August 22, 2020 Swagger will always be correct as it is automatically generated by the endpoints of the server you are running.
PenkethBoy 2068 Posted August 23, 2020 Posted August 23, 2020 (edited) why are some endpoints missing from swagger then? Edited August 23, 2020 by PenkethBoy
Luke 42078 Posted August 23, 2020 Posted August 23, 2020 15 hours ago, PenkethBoy said: why are some endpoints missing from swagger then? Depends, we'd have to look at an example. Some are deliberately hidden in order to direct you to newer endpoints.
PenkethBoy 2068 Posted August 24, 2020 Posted August 24, 2020 see our discussion above /emby/users/{UserId}/items/{ItemId}
steamhead 10 Posted August 24, 2020 Author Posted August 24, 2020 @Luke as a new user to Emby API, only in my 2nd week of trying to gain understanding of the topic, at least one endpoint appears to be missing entirely from Swagger, and two others you would expect to be endpoints appear to not exist. It's around are the ones needed to fetch a whole record for an item in the database, and put it back, either by User or Api-Key authentication. The documentation in the Wiki definitely implies there are two alternate versions of authentication, but so far I haven't been able to find the Query, Fetch and Update sequence of events in one single model. For by user we have GET /Users/{userId}/Items/{itemId} which is not in Swagger, but it does exist and works. There is GET /Users/{userId}/Items in Swagger to get multiple items based on a query which only retrieves partial records, and has no mention of how to get the full record. Because of this, for by API_Key you would then suspect GET /Items/{itemId} would exist as the API_key equivalent, but in this case it appears to be a non-existent endpoint, not only that, there doesn't seem to be a way to get a whole record via API_Key, which is odd when you consider Swagger shows POST /Items/{itemID} to update a record via API_Key, which you can't do without a whole record - which rather limits the usefulness of the by API_Key authentication method as far as I can see,. This makes me suspect there should be an endpoint to do this, but I can't see it in Swagger. Then we would expect POST /Users/{userID}/Items/{itemID} presumably to update a record in the By User method, but early attempts look like it isn't there, the only one is the POST /Items/{itemId} method. In summary it looks like I can query with both methods, get the whole record with a byUser method that isn't in Swagger, and then update the record only with the api_Key method. Are we supposed to be able to do the whole job in either ByUser or API_Key method, or has that approach been abandoned and you have to use a hybrid method?
Luke 42078 Posted August 24, 2020 Posted August 24, 2020 2 hours ago, PenkethBoy said: see our discussion above /emby/users/{UserId}/items/{ItemId} This method is in swagger, under UserLibraryService.
steamhead 10 Posted August 25, 2020 Author Posted August 25, 2020 With great thanks to @PenkethBoy I've finally managed to get some basic scripts in place to get Media Monkey to drive Emby with extra data to see if I can get Audio Dramas into shape under the Audio Books library type. Whilst I can now possibly script my way out of some of the issues I'm facing, not everyone can (or would want to), so assuming I get things in a workable state, when I've lived with it for a while I'll come back and give feedback on what I've found, what workarounds I've automated, and where some possibly simple changes might go a long way. Audio Dramas are my last part of my media collection to get into shape, I've almost had it working with Books and Mixed folders, before being broken by a software changes in both instances, so Audiobooks is going to be my last attempt at this, if I can't make this workable this time I'll have to look for another product. Alternatively of course if I can, it'll be time to sign up for Emby Premiere
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now