Logon token format - VisualCron - Forum

Community forum

tecbuilt
2020-03-16T21:48:18Z
I'm using the REST api and can successfully logon and make api calls if I put the username/password in the URL. But I have jobs that are making several requests so I would like to use the token method but nothing I have tried has been successful.
This is an example of what is returned when I use the logon method (http://localhost:8001/visualcron/text/logon?username=admin&password=)
result,token
OK,11d2a06c-4b05-43f4-b1ae-b7a25305086b
I have tried various ways to add that string to a command but they all end in "Permission Denied". Can somebody explain a little more on what needs to follow the "token" parameter.
http://localhost:8001/VisualCron/text/Job/List?token=<what goes here>
tecbuilt
2020-03-17T17:33:57Z
I have parsed the response to the token request to get just the token itself and pass it into the list jobs request but get the following message:
Permission denied. Method: job.list. Token: c1f03ff0-27c5-4fbb-b075-aad27c79d00d
I don't see any extra characters or anything else that would cause it to not recognize the token. Still not sure what I'm missing here, doesn't seem like it should be that difficult.
tecbuilt
2020-03-18T16:52:15Z
So the documentation says that the default expire time for a token is 1 hour (3600 seconds)
/// <param name="expireTime">[optional (default 3600)] Token expire time in seconds</param>
Turns out that is incorrect, the default expire time is 0 seconds, when I specify an expire time of 300 in my job and use the token returned all web api calls made now return results rather than the "Permission denied" message. So I guess this issue has been resolved and either the documentation needs to be updated or the web api needs to be fixed to have a default 3600 second expiration on the logon.
Support
2020-03-19T10:23:54Z
Originally Posted by: tecbuilt 

So the documentation says that the default expire time for a token is 1 hour (3600 seconds)
/// <param name="expireTime">[optional (default 3600)] Token expire time in seconds</param>
Turns out that is incorrect, the default expire time is 0 seconds, when I specify an expire time of 300 in my job and use the token returned all web api calls made now return results rather than the "Permission denied" message. So I guess this issue has been resolved and either the documentation needs to be updated or the web api needs to be fixed to have a default 3600 second expiration on the logon.




Hi,

Yes. We are aware of that we need to update the documentation regarding this part. Thanks for reporting it and updating
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top