Discussions

Expand all | Collapse all

api_authenticate returns error 20, Unknown username/password

  • 1.  api_authenticate returns error 20, Unknown username/password

    Posted 03-12-2017 19:20
    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


  • 2.  RE: api_authenticate returns error 20, Unknown username/password

    Posted 03-12-2017 19:29
    Would an "=" sign in the password field cause issues?


  • 3.  RE: api_authenticate returns error 20, Unknown username/password

    Posted 03-12-2017 19:33
    Mystery solved... sort of... the = was causing the problem.  Is there a way to escape special characters like the = in a password?


  • 4.  RE: api_authenticate returns error 20, Unknown username/password

    Top
    Contributor
    Posted 03-12-2017 19:52
    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])


  • 5.  RE: api_authenticate returns error 20, Unknown username/password

    Posted 03-12-2017 19:56
    Thanks Dan.  I am using powershell... I will lookup the urlencode.


  • 6.  RE: api_authenticate returns error 20, Unknown username/password

    Top
    Contributor
    Posted 03-12-2017 20:09
    $Encode = [System.Web.HttpUtility]::UrlEncode($URL) 

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

    Do us a favor and post your script when it is debugged.


  • 7.  RE: api_authenticate returns error 20, Unknown username/password

    Posted 03-18-2017 13:14
    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.