Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Programming using v5 commands. How to login?

  1. #11
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,154
    For your usage, pretty much every call needs a "&sid=481e61328cc54915aa67639973969460" type parameter on the url. If it's not on the url, the application falls back to checking the user's session for the sid, which is how the web app appears to make these api calls without explicitly passing it.

  2. #12
    Join Date
    Sep 2013
    Location
    USA
    Posts
    184
    Ok, thanks for the explanation. Easy enough to add. I was looking at the plugin code and it never adds the sid to any of it's calls that I could see either so I was really confused. I thought that maybe the DoRequest() call added it to the headers or some such.

    Next question: some of the calls have a 'random' parameter with a floating point value. Is it truly just a random number and what is it's function?


    JLM

  3. #13
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,149
    The DoRequest logic in kodi and in knewc does append the sid and prepend http://iport so the calls can focus on the API. If you are planning on using JSON, I would recommend you also have a similar common function so you can also pass the accept:application/json header in the request.

    Martin

  4. #14
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,154
    Quote Originally Posted by drmargarit View Post
    Ok, thanks for the explanation. Easy enough to add. I was looking at the plugin code and it never adds the sid to any of it's calls that I could see either so I was really confused. I thought that maybe the DoRequest() call added it to the headers or some such.
    The plugin code does end up adding it to the url inside DoRequest(). See https://github.com/kodi-pvr/pvr.next...endRequest.cpp

    Next question: some of the calls have a 'random' parameter with a floating point value. Is it truly just a random number and what is it's function?
    You don't need it. I should remove these.

  5. #15
    Join Date
    Sep 2013
    Location
    USA
    Posts
    184
    Quote Originally Posted by mvallevand View Post
    The DoRequest logic in kodi and in knewc does append the sid and prepend http://iport so the calls can focus on the API. If you are planning on using JSON, I would recommend you also have a similar common function so you can also pass the accept:application/json header in the request.

    Martin
    Oh no! Do I have to pass inline smiley faces too? Can't find that on stackoverflow....

    LOL

    JLM

  6. #16
    Join Date
    Sep 2013
    Location
    USA
    Posts
    184
    Thanks for the info. I really appreciate it. If you need any dental consults, let me know

    JLM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •