NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 6 7 8 9 10 … 93 Next »
New web service clarification needed

 
  • 0 Vote(s) - 0 Average
New web service clarification needed
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2013-10-19, 12:37 AM
A few questions...

Do all of the new web api calls work as follows...
Code:
http://<server>:<port>/services?<whatever>

What is the difference between client= and sid=? I'm guessing client is a device type and sid is session id. Correct? If so does client have to be a device type with a unique identifier in order to distinguish it from other devices of the same type or is that handled by the sid to make sure the session is unique.

Is it possible to transfer a clone (or impersonate) a web api call? For example, if I build Google Cast ability into nDroid and make a web service request from my tablet, could I then pass it on to my Chromecast with the same session id which then makes a repeat request and gets the same response?

On a lesser note - the future of using JSON? Parsing large amounts of XML with Android devices (mostly older ones) is a PITA due to memory available - JSON is generally more efficient.

Cheers,
Brian
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,687
Threads: 767
Joined: Nov 2003
#2
2013-10-19, 01:02 AM
The web api I developed have the format http://<server>:<port>/service?method=......

It does require calls to be authenticated. This is done using the method=session.initiate and method=session.login calls, which result in a "sid" that can be then passed to all subsequent calls.

The method=session.initiate call does take a device parameter, and stores it, but doesn't yet do anything different based on device. It may do in future.

This api uses XML. It wasn't really targeting java/javascript, so JSON wasn't really a consideration in it's design. It was really for some earlier PC->PC stuff I was doing. Later I reused it for the XBMC addon. That said, I have added started add JSON support for the calls that return large data sets. ie, calls like /service?method=recording.list&filter=ready&format=json.

This api does not use a "client" parameter. The "client" parameter originally came about to help people that were using VLC etc to watch stream like the /live?channel=x, to help the server know which requests were coming the same client session (so it would know what previous sessions to freeup etc when changing channels). This "client" has also extended a bit further into the touch stuff as well, which is unrelated to the web API above. "client" was just some client side identifier. It could be any unique string.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2013-10-19, 01:44 AM
sub Wrote:It does require calls to be authenticated. This is done using the method=session.initiate and method=session.login calls, which result in a "sid" that can be then passed to all subsequent calls.

The method=session.initiate call does take a device parameter, and stores it, but doesn't yet do anything different based on device. It may do in future.
OK, I hadn't picked up on session.initiate and session.login but related to that side of things, I don't have to do that. Simply using...
Code:
http://192.168.0.5:8866/service?sid=12345&method=setting.list
...for example, actually returns a valid response when I enter it in Chrome browser from my other PC. Is it because authentication isn't needed for LAN connections?

Quote:This api uses XML. It wasn't really targeting java/javascript, so JSON wasn't really a consideration in it's design. It was really for some earlier PC->PC stuff I was doing. Later I reused it for the XBMC addon. That said, I have added started add JSON support for the calls that return large data sets. ie, calls like /service?method=recording.list&filter=ready&format=json.
Yes, I'd picked up on format=json but wasn't sure how much it was supported. It would be nice (from my point of view at least) if it was valid for all calls - I could ditch a load of my nDroid SAX parsing code and even trim out a load of the nDroid Service code. Smile

Quote:This api does not use a "client" parameter. The "client" parameter originally came about to help people that were using VLC etc to watch stream like the /live?channel=x, to help the server know which requests were coming the same client session (so it would know what previous sessions to freeup etc when changing channels). This "client" has also extended a bit further into the touch stuff as well, which is unrelated to the web API above. "client" was just some client side identifier. It could be any unique string.
OK, thanks.

Cheers,
Brian
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,687
Threads: 767
Joined: Nov 2003
#4
2013-10-19, 02:25 AM
bgowland Wrote:Yes, I'd picked up on format=json but wasn't sure how much it was supported. It would be nice (from my point of view at least) if it was valid for all calls - I could ditch a load of my nDroid SAX parsing code and even trim out a load of the nDroid Service code. Smile
I hear you, but there is pretty much no chance I'm going to go back and redo it all, so unfortunately you'll just have to live with the xml. Sorry.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,687
Threads: 767
Joined: Nov 2003
#5
2013-10-19, 02:28 AM
bgowland Wrote:OK, I hadn't picked up on session.initiate and session.login but related to that side of things, I don't have to do that. Simply using...
Code:
http://192.168.0.5:8866/service?sid=12345&method=setting.list
...for example, actually returns a valid response when I enter it in Chrome browser from my other PC. Is it because authentication isn't needed for LAN connections?
Yes, there is some auto-login stuff that happens for local connections.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#6
2013-10-19, 02:34 AM
sub Wrote:I hear you, but there is pretty much no chance I'm going to go back and redo it all, so unfortunately you'll just have to live with the xml. Sorry.
OK it's your call and I respect that. It's mostly older devices (more specifically older Android versions) which have limited working memory for the VM. I'll just need to take note of what format=json can or cannot be used for.

What about my comment about
Code:
http://192.168.0.5:8866/service?sid=12345&method=setting.list
I obviously just made that sid up - without it I get an "invalid session" response but I can put anything in there and I get a valid response.

Cheers,
Brian
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#7
2013-10-19, 02:36 AM
sub Wrote:Yes, there is some auto-login stuff that happens for local connections.

Sorry - overlapped posting. I vaguely remembered the web service allowed security bypass for local networks which is why I wasn't sure.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  is there a service?method which returns listings for multiple channels? reven 16 6,927 2022-04-11, 04:30 PM
Last Post: mandai
  NextPVR "Service" Backend? jcole998 5 4,781 2018-05-24, 01:17 PM
Last Post: jcole998
  Transcoding service mvallevand 27 12,337 2016-08-26, 07:43 PM
Last Post: sub
  Time to make Touch web Service less experimental fred250 106 28,124 2014-06-15, 09:13 PM
Last Post: fred250
  [REQ] Additional web service API calls reven 26 8,153 2013-08-31, 10:08 PM
Last Post: mvallevand
  getting recurring recordings from service?method API? reven 2 1,941 2013-08-03, 10:50 PM
Last Post: reven
  need some doc around service?methods reven 12 4,562 2013-07-25, 11:00 PM
Last Post: reven
  Skin help needed for EventDetails.xml bgowland 7 3,292 2011-06-26, 11:55 PM
Last Post: Jaggy
  Creating a Windows service McBainUK 8 3,375 2011-03-30, 03:29 AM
Last Post: mvallevand
  MVP/NMT testers needed for Weather2 scb147 46 11,828 2010-03-03, 08:12 PM
Last Post: scb147

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode