TvOs App not connecting to timeline request

I submitted [verbose] logs from my AppleTV that show me trying to make a timeline connection from my SmartThings App. My source is available here: https://dl.dropboxusercontent.com/u/18989001/plex-manager.groovy
I was able to packet sniff a connection from another device and confirm that it is sending the timeline request in the same manner, and my Plex Media Player instance works well with this same code and is able to connect to back to the device fine.
The data is from ~7:50pm ET on 26 January 2017 from my account [Ph4r] on an Apple TV.

I get an HTTP 500 back from the Player that it was unable to open the connection, but I’m not sure why. Other devices on my local subnet are able to connect back to my application fine.

[index:18, mac:086698912345, ip:0A0A0A70, port:7EF4, requestId:d0b7ee6f-50fe-401d-8d98-f4805f312345, headers:[x-plex-client-identifier:0A8567E3-26C4-484C-903F-E1CA9B012345, content-length:233, access-control-expose-headers:X-Plex-Client-Identifier, http/1.1 500 internal server error:null, connection:Close, access-control-allow-origin:*, access-control-max-age:1209600, content-type:text/html; charset=utf-8, date:Mon, 23 Jan 2017 23:59:38 GMT, server:PMKWebServer, access-control-allow-methods:OPTIONS,HEAD,GET,POST,DELETE,PUT], body:HTTP Error 500
HTTP Error 500: Failed to forward request

[NSURLErrorDomain] Could not connect to the server. (-1004)
, header:HTTP/1.1 500 Internal Server Error
Server: PMKWebServer
Content-Type: text/html; charset=utf-8
Access-Control-Expose-Headers: X-Plex-Client-Identifier
Access-Control-Max-Age: 1209600
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS,HEAD,GET,POST,DELETE,PUT
Date: Mon, 23 Jan 2017 23:59:38 GMT
X-Plex-Client-Identifier: 0A8567E3-26C4-484C-903F-E1CA9B012345
Content-Length: 233
Connection: Close, status:500]

Note: in the error excerpt above, I have replaced the ends of potentially sensitive data with 12345.

from my AppleTV that show me trying to make a timeline connection from my SmartThings App

I’m not entirely sure what this means.

Can you give us a curl command which reproduces the issue? And what exactly are you trying to do?

I feel a bit silly, but I finally figured this out going to pull the logs! I had an uninitialized variable which was using the POST Method for the timeline request which the Windows Apps apparently accept, but the AppleTV App does not accept. I noticed POST in the logs and then changed the method to GET, and then the AppleTV started Responding!

I still think a more prompt log review would have pointed this out, and the API Docs published here only make one nod in passing to the fact that commands should be sent as GET.

I don’t have curl installed to be able to simulate the command, but here is the output from the SmartThings Logs where the top line is the method and Path, and the following lines are the Headers I am including.

Was (did not work):
POST /player/timeline/subscribe?port=39500&protocol=http&commandID=3&X-Plex-Token=vB3Y8q12HWSh6Pb12345 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
X-Plex-Device-Name: STHub
X-Plex-Client-Identifier: PlexManager
X-Plex-Client-Platform: SmartThings
X-Plex-Version: 5.3.4.759
X-Plex-Platform: SmartThings
X-Plex-Platform-Version: 4.4.4
X-Plex-Provides: controller,sync-target
X-Plex-Product: PlexManager for ST
X-Plex-Device: STHub
X-Plex-Model: v2
X-Plex-Device-Vendor: Samsung
X-Plex-Device-Screen-Resolution: 1024x768 (Mobile)
X-Plex-Device-Screen-Density: 160
X-Plex-Username: 1234
Accept-Language: en-us
Connection: Keep-Alive
Accept-Encoding: gzip
X-Plex-Target-Client-Identifier: 0A8567E3-26C4-484C-903F-E1CA9B012345
HOST: 10.10.10.111:32500

Now (works):
GET /player/timeline/subscribe?port=39500&protocol=http&commandID=3&X-Plex-Token=vB3Y8q12HWSh6Pb12345 HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
X-Plex-Device-Name: STHub
X-Plex-Client-Identifier: PlexManager
X-Plex-Client-Platform: SmartThings
X-Plex-Version: 5.3.4.759
X-Plex-Platform: SmartThings
X-Plex-Platform-Version: 4.4.4
X-Plex-Provides: controller,sync-target
X-Plex-Product: PlexManager for ST
X-Plex-Device: STHub
X-Plex-Model: v2
X-Plex-Device-Vendor: Samsung
X-Plex-Device-Screen-Resolution: 1024x768 (Mobile)
X-Plex-Device-Screen-Density: 160
X-Plex-Username: 1234
Accept-Language: en-us
Connection: Keep-Alive
Accept-Encoding: gzip
X-Plex-Target-Client-Identifier: 0A8567E3-26C4-484C-903F-E1CA9B012345
HOST: 10.10.10.111:32500

Oh nice, glad you figured it out!