Forum Discussion

DeanOusterhout's avatar
DeanOusterhout
Qrew Assistant Captain
9 years ago

api_authenticate returns error 20, Unknown username/password

I am trying to do the api_authenticate in order to do the api_importfromCSV and am failing.  It seems pretty simple, but it is failing.

Here is the link
 $urlQuery=" https://fixandpaint.quickbase.com/db//main?a=API_Authenticate&appToken=xxx_valid_token&usern..."


 $data=Invoke-RestMethod -Uri  $urlQuery

But even running the link manually gives the error.

Any help would be greatly appreciated.

Thanks,
Dean
  • DeanOusterhout's avatar
    DeanOusterhout
    Qrew Assistant Captain
    Mystery solved... sort of... the = was causing the problem.  Is there a way to escape special characters like the = in a password?
  • Use %3D for =.

    I don't know what language you are using but every modern language has a URLEncoding function. If you URL is coming from the QuickBase formula language you use this:

    URLEncode([url])
    • _anomDiebolt_'s avatar
      _anomDiebolt_
      Qrew Elite
      $Encode = [System.Web.HttpUtility]::UrlEncode($URL) 

      $Decode = [System.Web.HttpUtility]::UrlDecode($Encode) 

      Do us a favor and post your script when it is debugged.
  • DeanOusterhout's avatar
    DeanOusterhout
    Qrew Assistant Captain
    I decided to not use the authenticate and use the usertoken instead.  instead of the xml, I used the URL approach, and for that I was having issues with the multiple records being handled by QB.  It kept coming back and saying 1 record input, regardless of how many were included.

    The solution involved adding a carriage return after each data row ("'r'n ").  Then I had issues with strings, but encapsulating them in double quotes fixed that.

    Saga over for now... :)  Thanks for the help Dan.