When to obtain a new token

Use this forum to discuss issues related to the SD-JSON service.
jdwirtz
Posts: 9
Joined: Thu Jun 16, 2016 7:28 am

When to obtain a new token

Post by jdwirtz »

I'm having a bit of a problem getting schedules and it seems that I'm getting

[response] => INVALID_USER

Code: Select all

 => 4003
    [serverID] => 20141201.web.1
    [message] => Invalid username or token has expired.
    [datetime] => 2016-06-28T15:23:49Z

while I'm attempting to download the schedules. I obtain the token before I
start the schedule retrieval run.  I'm still in the process of building my new
guide listings so while it is retrieving the schedule, is testing other processes
where at the beginning of that process I also obtain a token.  
So am I shooting myself in the foot?  
Is asking for a new token for the current process killing the token of the running process?  If that is the case, what is best practice for obtaining tokens? 
Do I only get/have one token to my username?

Jim

rkulagow
SD Staff
Posts: 925
Joined: Tue Aug 14, 2007 3:15 pm

Re: When to obtain a new token

Post by rkulagow »


jdwirtz
Posts: 9
Joined: Thu Jun 16, 2016 7:28 am

Re: When to obtain a new token

Post by jdwirtz »

Yes... I've read that So...... what if I'm attempting to access the data from a
couple of different computers? Just don't do it at the same time?

rkulagow
SD Staff
Posts: 925
Joined: Tue Aug 14, 2007 3:15 pm

Re: When to obtain a new token

Post by rkulagow »

Yeah, don't do that.

jdwirtz
Posts: 9
Joined: Thu Jun 16, 2016 7:28 am

Re: When to obtain a new token

Post by jdwirtz »

I was really hoping for more help than. "Yeah, don't do that."
I have 3 NextPVR servers running all set to update the schedules
at the same time. How is NextPVR getting away with it?

Are we really limited to one login and one token at a time?

Jim

rmeden
SD Board Member
Posts: 1563
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX
Contact:

Re: When to obtain a new token

Post by rmeden »

They don't update all the time... they update for maybe 2-3 minutes a few times a day. Don't schedule them all at the same time.

Randomized times are good all-around.

Robert

jdwirtz
Posts: 9
Joined: Thu Jun 16, 2016 7:28 am

Re: When to obtain a new token

Post by jdwirtz »

So... you do only get one token per login/account?

Jim

rkulagow
SD Staff
Posts: 925
Joined: Tue Aug 14, 2007 3:15 pm

Re: When to obtain a new token

Post by rkulagow »

jdwirtz wrote:So... you do only get one token per login/account?
Jim
Yes. Please look at the documentation that I provided in the link upthread; it explains how the tokens work, and what their lifecycle is.

jdwirtz
Posts: 9
Joined: Thu Jun 16, 2016 7:28 am

Re: When to obtain a new token

Post by jdwirtz »

Yes I've read it and made use of it. I'm just trying to get some clarification on it.
It reads like I can only get a single token per my user account. Just want to be sure
that is really the case.

rkulagow
SD Staff
Posts: 925
Joined: Tue Aug 14, 2007 3:15 pm

Re: When to obtain a new token

Post by rkulagow »

Yes, only one outstanding token at a time.

Post Reply