jensenkd / plex-api

.NET Core SDK for Plex Media Server
MIT License
86 stars 27 forks source link

Instructions on querying the server using a sub user/profile #61

Closed seertenedos closed 2 years ago

seertenedos commented 2 years ago

Is your feature request related to a problem? Please describe. Unser my user I have a number of accounts for family members that show on the TV screen. I am trying to sync the watch status for different family members between servers and while i can do that for my self as the main user via the API i could not work out how to get the API to use one of the other users under my account to make the calls.

Describe the solution you'd like Documentation or this issue updated with the steps needed to make calls to the servers from sub user accounts instead of the main user which is default.

Additional context I am talking about the users you can see on the screen and can set a pin to login as if you want. I can see them in the users collection under my account as well via the API mixed with other users but no idea how to use it when doing further queries as it is all based off the account object returned from login and there did not seem to be a method to select a sub user for the account.

seertenedos commented 2 years ago

I managed to find the call the website does which is https://plex.tv/api/v2/home/users/zzzzzzz/switch?includeSubscriptions=1&includeProviders=1&includeSettings=1&includeSharedSettings=1&X-Plex-Client-Identifier=xxxxx&X-Plex-Token=xxxx where zzzzzzz is the UUID off the freind record that matches the home user/sub user.

jensenkd commented 2 years ago

interesting. I never thought about this use case but makes sense. Thanks for finding the api call. I'll take a look shortly.

seertenedos commented 2 years ago

Functionality is in https://github.com/jensenkd/plex-api/pull/65 feel free to change it if you don't like naming or how it is done.