Hello,
I’ve always done library scans (refresh) with get requests and according to the new API documentation it is a post. Get still works but there appears to be some errors or inconsistencies within the documentation for this.
https://developer.plex.tv/pms/#tag/Library/operation/libraryPostSectionsRefresh
For example, “https://{IP-description}.{identifier}.plex.direct:{port}/library/sections/refresh” I get 404 responses with get and post and I’ve always used /library/sections/all/refresh, which works with get and post.
I am taking the API documentation as the official spec and anything I have working may not work in the future.
Edit: When I execute a refresh from the webui, its a get request.
Some of the older endpoints did not follow best practices when it came to API design and so something like the refresh endpoint shouldn’t have been a GET but we’ve retained these methods for backwards compatibility.
For anything you’re implementing going forward just use the method described in the documentation.
Thanks for the response,
In that case the webui function to refresh a library when I debug it, is using a get request. Not sure if that needs a bug report? Or just classificed as backward compatible (until the new webui).
Understood, TBH thats what I’m working toward as spec goes, however that refresh endpoint for all libraries doesn’t function. Its either the documentation that needs amending or its an API issue? Does that need a bug report of some sort?
I’ll echo what drzoidberg33 said in that in writing the API documentation there were several legacy aspects we explicitly chose to not document. This endpoint responding to GET requests is one such example. Another big one is the fact that only JSON responses are documented and XML is left out (so that future endpoints could be made JSON-only as some structures cannot be represented well in XML).
Mostly the documentation is for going forward so as to bring everything into a better place. That’s also why the API version mechanism is there.
Don’t worry about what the web interface does as that is being reworked (or at least it was when I was last working there).
1 Like