Cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to call API after running for a while

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Hi,

 

I'm developing a dashboard app using Angular, running on Mindsphere. 

But I'm facing such a problem: everything works fine at the beginning. After running for about 30 minutes, API request returns 401 with the message 

{ MSG exception: Failed to perform POST on TokenExchange! Reason: 401 null }.

 

Does anyone have any idea? Is it about session timeout or session inactive timeout?

 

Thanks Smiley Happy

4 REPLIES 4

Re: Failed to call API after running for a while

Experimenter
Experimenter

Hi

 

It looks like Your Token expires, I would make some code that check for the errorcode above or equal 400 and below 500 and then get a new token.

 

 

TSB

Re: Failed to call API after running for a while

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

The token is got from the cookie, is there any way to refresh the token in the cookie from client side?

 

Referring:  Calling APIs from Frontend

 

Thanks.

Re: Failed to call API after running for a while

Siemens Genius Siemens Genius
Siemens Genius

@EvanLau The token should be refreshed automatically when there are calls to either the API or application. I can recommend creating some heartbeat / keep alive calls. If there are not calls the token times out after ~30 minutes. 

 

Unfortunately, there was a bug that invalidated the session even if there were calls. If this is still the case please contact the dev support and they will fix this for your tenant.

 

Regards,

Michael

Re: Failed to call API after running for a while

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Thank You, Michael.

 

I'm calling the Mindsphere timeseries API every one minute, but the session will be invalidated after 30 minutes.

 

I have request Mindsphere support. 

 

Best regards

 

Evan