PMS web api documentation

Here is the GET I made which started playing content on my google tv

GET http://192.168.1.4:32400/player/playback/playMedia?key=%2Flibrary%2Fmetadata%2F13615&offset=0&machineIdentifier=&address=&port=32400&protocol=http&containerKey=%2FplayQueues%2F13%3Fown%3D1%26window%3D200&commandID=5

Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
X-Plex-Version: 2.1.3
X-Plex-Platform-Version: 34.0
Origin: http://localhost:32400
X-Plex-Client-Identifier:
X-Plex-Target-Client-Identifier:
X-Plex-Device-Name: Plex Web (Chrome)
X-Plex-Platform: Chrome
X-Plex-Username:
Accept: text/plain, /; q=0.01
X-Plex-Product: Plex Web
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
X-Plex-Device: Windows
DNT: 1

The remote machineid can be found by simply selecting a section in plex web. It will take you to an address as such:

http://plex.tv/web/app#!/server//section/6

or

http://localhost:32400/web/index.html#!/server//section/6

You can also get the machineID and some other information that may be helpful via localhost

http://localhost:32400/

What's the difference in client identifier and target client identifier? Similar to vulcanjedi, this isn't a plugin that has client status. I'm actually working on a workflow for Alfred. I have a client (hackintosh) that is connected to my tv and I want to be able to search my library within Alfred and show results, select one, and have it play on the tv through that client. I already have search, play, stop, etc working. I just can't make it play a file. Is there other documentation somewhere that I could see what all parameters it is expecting?

The client identifier AFAIK is assigned to every individual Plex Client for every individual user. In this case, my assumption is the target client identifier is that of the target client of which you want media to play. It is most likely returned in the call below. But again, I highly encourage you to use plex web’s play to feature and watch chrome’s network tab to see whats going on. You’ll want to check “preserve logs” and be sure to pay attention to headers sent and returned.


#Client IP: 192.168.1.4
#Host/pms server IP 192.168.1.2
#Remote PMS server ip where content lives 123.123.123.123

GET 192.168.1.4:32400/player/timeline/poll?wait=0&commandID=0
(Returns machine id which is used later)






Sent from my iPhone using Tapatalk

Thank you for your tips on using Chrome's dev tools and watching Plex Web's activities. I think I have it mostly working. I was able to get it working from a URL call by utilizing the below URL structure.

http://:/player/playback/playMedia?key=%2Flibrary%2Fmetadata%2F&offset=0&X-Plex-Client-Identifier=&machineIdentifier=&address=&port=&protocol=http&path=http%3A%2F%2F%3A%2Flibrary%2Fmetadata%

Thank you for your tips on using Chrome's dev tools and watching Plex Web's activities. I think I have it mostly working. I was able to get it working from a URL call by utilizing the below URL structure.

http://:3005/player/playback/playMedia?key=%2Flibrary%2Fmetadata%2F&offset=0&X-Plex-Client-Identifier=&machineIdentifier=&address=&port=32400&protocol=http&path=http%3A%2F%2F%3A32400%2Flibrary%2Fmetadata%

Isn;t the port (3005) different for different clients? It would be the port showing in the server-ip:32400/clients xml 

Good point, I updated my URL string just in case it is different. Thanks for pointing it out.

Thanks guys I finally got this working now too!!! This has been bugging me so long now :/ I think I missed an identifier before and didnt realize the clients were on diff port.

A bit more involved and not documented

But I got it working, woot

Thank you for your tips on using Chrome's dev tools and watching Plex Web's activities. I think I have it mostly working. I was able to get it working from a URL call by utilizing the below URL structure.

http://:/player/playback/playMedia?key=%2Flibrary%2Fmetadata%2F&offset=0&X-Plex-Client-Identifier=&machineIdentifier=&address=&port=&protocol=http&path=http%3A%2F%2F%3A%2Flibrary%2Fmetadata%

The client identifier AFAIK is assigned to every individual Plex Client for every individual user. In this case, my assumption is the target client identifier is that of the target client of which you want media to play. It is most likely returned in the call below. But again, I highly encourage you to use plex web's play to feature and watch chrome's network tab to see whats going on. You'll want to check "preserve logs" and be sure to pay attention to headers sent and returned.




Sent from my iPhone using Tapatalk

Hello all,

Just as a quick update while looking for some other call I stumbled upon this:

GET https://plex.tv/devices.xml
GET /devices.xml HTTP/1.1
Host: plex.tv
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
X-Plex-Version: 2.1.5
X-Plex-Platform-Version: 34.0
Origin: http://localhost:32400
X-Plex-Token: 
X-Plex-Client-Identifier: 
X-Plex-Device-Name: Plex Web (Chrome)
X-Plex-Platform: Chrome
X-Plex-Username: reallistic
Accept: text/plain, */*; q=0.01
X-Plex-Product: Plex Web
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
X-Plex-Device: Windows
DNT: 1
Referer: http://localhost:32400/web/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

The output was as follows:


  
  
  
    
    
    
    
    
  
  
    
    
    
    
  
........

Note that the areas that are blank and not snipped were indeed blank in the response.

Also,

I have integrated an "API Sniffer" into another project and will soon have a decently populated api listing posted from it.

reallistic, may want to update your posts above, the ones dreamstatic has has both

clientID and serverID being used, yours I think only the client, the former is the only way I got to work? Were yours just typos or bad copy/pastes or should the shorter one really work?

Have you guys tried this method w/ sendkeys? i'd prefer a faster way to toggle subtitles or info screen w/o a keyboard.

 

Also,

I have integrated an "API Sniffer" into another project and will soon have a decently populated api listing posted from it.

Hello all,

Just as a quick update while looking for some other call I stumbled upon this:

GET https://plex.tv/devices.xml GET /devices.xml HTTP/1.1 Host: plex.tv Connection: keep-alive Cache-Control: no-cache Pragma: no-cache X-Plex-Version: 2.1.5 X-Plex-Platform-Version: 34.0 Origin: http://localhost:32400 X-Plex-Token:  X-Plex-Client-Identifier:  X-Plex-Device-Name: Plex Web (Chrome) X-Plex-Platform: Chrome X-Plex-Username: reallistic Accept: text/plain, */*; q=0.01 X-Plex-Product: Plex Web User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 X-Plex-Device: Windows DNT: 1 Referer: http://localhost:32400/web/index.html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 

The output was as follows:

  
  
  
    
    
    
    
    
  
  
    
    
    
    
  
........

Note that the areas that are blank and not snipped were indeed blank in the response.

Thanks for the info! I will update the doc.

for myplex validating a user here are the headers That I use in plex notify:

request.AddHeader("X-Plex-Platform", name); 
request.AddHeader("X-Plex-Platform-Version", version); 
request.AddHeader("X-Plex-Provides", "player"); 
request.AddHeader("X-Plex-Client-Identifier", Config.Settings.ApplicationID); 
request.AddHeader("X-Plex-Product", "PlexWMC"); 
request.AddHeader("X-Plex-Version", "0");
https://my.plexapp.com/users/sign_in.xml

I updated the wiki with the additional infromation in the thread. Thank you!

I updated the wiki with the additional infromation in the thread. Thank you!

Are there any other .xml plex endpoints that you know of?
Also, where is/how did you stumble upon the sign_in.xml?

I haven't had time to do and real digging but I would like to
Sign-up
Share a server
Accept a server share

*EDIT* sign-up was easy:
https://plex.tv/users/sign_up.xml

Only question now is what post information does it need?
(Will figure that out when I get to my computer)


Sent from my iPhone using Tapatalk

Could we have the dead links in this thread removed and replaced to save one having to get to the right post to get the right link for the wiki

Also could we add information such as this which i found in the plex.js Plex/web code:

The list of MediaTypes - names and ID's
           id: 1,
            typeString: "movie",
            title: "Movie",
            plural: n.pluralize("Movie"),
            element: "video"

            id: 2,
            typeString: “show”,
            title: “Show”,
            plural: n.pluralize(“TV Show”),
            element: “directory”,
            related: [3, 4]

            id: 3,
            typeString: “season”,
            title: “Season”,
            plural: n.pluralize(“Season”),
            element: “directory”,
            related: [2, 4]

            id: 4,
            typeString: “episode”,
            title: “Episode”,
            plural: n.pluralize(“Episode”),
            element: “video”,
            related: [2, 3]

            id: 5,
            typeString: “trailer”,
            title: “Trailer”,
            plural: n.pluralize(“Trailer”),
            element: “video”

            id: 6,
            typeString: “comic”,
            title: “Comic”,
            plural: n.pluralize(“Comic”),
            element: “photo”

            id: 7,
            typeString: “person”,
            title: “Person”,
            plural: n.pluralize(“Person”, null, “People”),
            element: “directory”

            id: 8,
            typeString: “artist”,
            title: “Artist”,
            plural: n.pluralize(“Artist”),
            element: “directory”,
            related: [9, 10]

            id: 9,
            typeString: “album”,
            title: “Album”,
            plural: n.pluralize(“Album”),
            element: “directory”,
            related: [8, 10]

            id: 10,
            typeString: “track”,
            title: “Track”,
            plural: n.pluralize(“Track”),
            element: “audio”,
            related: [8, 9]

            id: 11,
            typeString: “photoAlbum”,
            title: “Photo Album”,
            plural: n.pluralize(“Photo Album”),
            element: “directory”,
            related: [12, 13]

            id: 12,
            typeString: “picture”,
            title: “Picture”,
            plural: n.pluralize(“Picture”),
            element: “photo”,
            related: [11]

            id: 13,
            typeString: “photo”,
            title: “Photo”,
            plural: n.pluralize(“Photo”),
            element: “photo”,
            related: [11]

            id: 14,
            typeString: “clip”,
            title: “Clip”,
            plural: n.pluralize(“Clip”),
            element: “video”

            id: 15,
            typeString: “playlistItem”,
            title: “Clip”,
            plural: n.pluralize(“Clip”),
            element: “video”

Could we have the dead links in this thread removed and replaced to save one having to get to the right post to get the right link for the wiki

Also could we add information such as this which i found in the plex.js Plex/web code:

The list of MediaTypes - names and ID's
           id: 1,             typeString: "movie",             title: "Movie",             plural: n.pluralize("Movie"),             element: "video"             id: 2,             typeString: "show",             title: "Show",             plural: n.pluralize("TV Show"),             element: "directory",             related: [3, 4]             id: 3,             typeString: "season",             title: "Season",             plural: n.pluralize("Season"),             element: "directory",             related: [2, 4]             id: 4,             typeString: "episode",             title: "Episode",             plural: n.pluralize("Episode"),             element: "video",             related: [2, 3]             id: 5,             typeString: "trailer",             title: "Trailer",             plural: n.pluralize("Trailer"),             element: "video"             id: 6,             typeString: "comic",             title: "Comic",             plural: n.pluralize("Comic"),             element: "photo"             id: 7,             typeString: "person",             title: "Person",             plural: n.pluralize("Person", null, "People"),             element: "directory"             id: 8,             typeString: "artist",             title: "Artist",             plural: n.pluralize("Artist"),             element: "directory",             related: [9, 10]             id: 9,             typeString: "album",             title: "Album",             plural: n.pluralize("Album"),             element: "directory",             related: [8, 10]             id: 10,             typeString: "track",             title: "Track",             plural: n.pluralize("Track"),             element: "audio",             related: [8, 9]             id: 11,             typeString: "photoAlbum",             title: "Photo Album",             plural: n.pluralize("Photo Album"),             element: "directory",             related: [12, 13]             id: 12,             typeString: "picture",             title: "Picture",             plural: n.pluralize("Picture"),             element: "photo",             related: [11]             id: 13,             typeString: "photo",             title: "Photo",             plural: n.pluralize("Photo"),             element: "photo",             related: [11]             id: 14,             typeString: "clip",             title: "Clip",             plural: n.pluralize("Clip"),             element: "video"             id: 15,             typeString: "playlistItem",             title: "Clip",             plural: n.pluralize("Clip"),             element: "video" 

Yeah I have to do the directory stuff still. I am going to write a how-to on navigating directories throgh the web API.

I went ahead and added this stuff to both my google doc (force of habit) and the Google Code repo

https://code.google.com/p/plex-api/w/list

Anyone know where the rest of the playback control commands are? I'd like to finish out that section too.

Anyone know where the rest of the playback control commands are? I'd like to finish out that section too.

I'll try and "sniff" those out later tonight. My gut tells me it is more than likely something like this:

http://:/player/playback/[stop|pause|resume]Media?

Personally albeit some of the urls didnt work for me, I think it is a bit odd to retroactively fix all those posts. I think Reallistic as the OP if you could post the google doc and/or other doc and do an update / date thing, on the first post that would help.  Kinda like that big thread for the unsupported app store. Technically the doc(s) should have the latest / greatest info anyways based on how this thread started.

the playback commands from the old http api all still work for me. The volume control most recently stopped working.

I'll try and "sniff" those out later tonight. My gut tells me it is more than likely something like this:

http://:/player/playback/[stop|pause|resume]Media?

Personally albeit some of the urls didnt work for me, I think it is a bit odd to retroactively fix all those posts. I think Reallistic as the OP if you could post the google doc and/or other doc and do an update / date thing, on the first post that would help. Kinda like that big thread for the unsupported app store. Technically the doc(s) should have the latest / greatest info anyways based on how this thread started.


Agreed. I will do this in a few. I actually was planning to overhaul it once I got my "api sniffer" working. Thus far i've got it logging stuff and just need to "pretty" it up a bit. Hopefully I can get that out in the next day or so.


Sent from my iPhone using Tapatalk