urgourgo
9 years agoQrew Trainee
Error code 4 ""Your ticket has expired"" when using a usertoken in an API call
Hi,
I'm trying to use a usertoken to access the QuickBase API, instead of logging in and using a ticket.
I've created a usertoken and assigned it to my app. Here is a sample request where I'm trying to use it:
Unfortunately, this request returns the following error response:
Am I missing something? Why does this mention a ticket if I'm not using one?
PS - Turns out that if I first login via a call to API_Authenticate then I can use my usertoken successfully in subsequent calls. Why does this happen when QuickBase API documentation clearly states:
"...user tokens are pre-generated, and don't require a call to API_Authenticate."
I'm trying to use a usertoken to access the QuickBase API, instead of logging in and using a ticket.
I've created a usertoken and assigned it to my app. Here is a sample request where I'm trying to use it:
POST /db/#READACTED# HTTP/1.1 Host: #READACTED#.quickbase.com Content-Type: application/xml QUICKBASE-ACTION: API_GetSchema Cache-Control: no-cache <qdbapi> <usertoken>#READACTED#</usertoken> </qdbapi>
Unfortunately, this request returns the following error response:
<?xml version="1.0" ?> <qdbapi> <action>API_GetSchema</action> <errcode>4</errcode> <errtext>Bad ticket</errtext> <errdetail>Your ticket has expired. By default, tickets expire after 12 hours of use. One-time tickets expire after 5 minutes. Please log in again.</errdetail> </qdbapi>
Am I missing something? Why does this mention a ticket if I'm not using one?
PS - Turns out that if I first login via a call to API_Authenticate then I can use my usertoken successfully in subsequent calls. Why does this happen when QuickBase API documentation clearly states:
"...user tokens are pre-generated, and don't require a call to API_Authenticate."