Cannot Get List of Servers

Hi,

I have just started developing a new service and the first thing I need to do is get a list of servers. Starting with the simplest thing, I get a token by following this guide; assume this token is {token}.

I then call https://plex.tv/pms/servers.xml, setting the appropriate headers. A curl representation would be:

curl --request GET \
  --url https://plex.tv/pms/servers.xml \
  --header 'X-Plex-Client-Identifier: MyClientId' \
  --header 'X-Plex-Token: {token}'

Auth seems to go OK however, the response I get (not sure if machine ID is private so I redacted it) contains no servers:

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer friendlyName="myPlex" identifier="com.plexapp.plugins.myplex" machineIdentifier="redacted" size="0"></MediaContainer>

I have a single server running locally and it is available remotely.

Can anyone give me any pointers for this seemingly trivial endpoint?

See: WebTools-NG/plextv.js at master · WebTools-NG/WebTools-NG · GitHub

URL is: https://plex.tv/api/v2/resources

Ah, thanks. So is the endpoint I was looking for deprecated?

I was actually showing the curl for a .NET Plex library I was trying to use from Nuget. I can’t easily change that URL and it doesn’t look like the project is being maintained anymore.

I may have to go back to basics and write my own client.

Can’t you fork it from from like GitHub?

Yes, I can but I am wary of forking projects that I do not then have the time to then maintain. I think it might be a better idea to produce my own API client, limited to the endpoints I need for my use case.

What language are you using?

I’m using C#, .NET 5

I’m currently investigating replacing the client I was using with something based on refit. It is well maintained and in use by some pretty big companies.

Okay…If on Python, there’s a few API’s on GitHub, but know not of any C# based ones

Thanks. There are a couple of C# based ones but I am having much better success writing my own using the refit client. It’s working well.

1 Like