Weird API Issues

Discussion in 'Troubleshooting' started by rockstar12, Aug 10, 2017.

  1. rockstar12

    rockstar12 aMember Pro Customer

    Joined:
    Nov 1, 2012
    Messages:
    43
    Hi.

    I have a API Key created for login checks. Majority of time ti works fine but for some users, it says this

    {"ok":false,"code":-1,"msg":"Please login"}

    Username and password is correct. Its via Check Login with user and pass method. I have a lot of complaints like this.

    Any Help is appreciated!
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,681
    Hello,

    This response means either login or password is incorrect. Do you mind to contact us in helpdesk?
    https://www.amember.com/support

    We will check what is wrong with your request.

    Best Regards.
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,681
    The solution of this issue:

    Please be aware about special characters in get parameters.
    You need to do special encoding for it:
    http://php.net/urlencode
    http://php.net/http_build_query

    For example if password contain '#' then you need to replace it with '%23' before use in get request:
    pass=%23abc instead of pass=#abc

    It is better to use function http_build_query (if you use PHP) to prepare query string.

    Best Regards.

Share This Page