Method Community

 

The API could not validate your log in

Last post 06-01-2016 3:39 PM by milos. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-01-2016 1:58 PM

    • milos
    • Not Ranked
    • Joined on 06-01-2016
    • Posts 5

    The API could not validate your log in

    Hi everyone,

    I am using php for soap request. This is my code 

    $client = new SoapClient('https://www.methodintegration.com/MethodAPI/service.asmx?wsdl');
    $response = $client->MethodAPITableListV2('comapnyName','myusername(email)','password','');
    I tested my credibility on https://www.methodintegration.com/MethodAPI/service.asmx?op=MethodAPITableListV2 and everything is good. When I tried to use my php code in my project I get this:
    
    

    stdClass Object
    (
    [MethodAPITableListV2Result] => <?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Failure. The API could not validate your log in. Please make sure you have entered the correct Company Account, User and Password, and that each are spelt correctly. Also, ensure that this User has been configured for Method API access by going to Customize > Users, editing the User, and ensuring that there is a check in the 'Is Allowed to Connect via MethodAPI' checkbox." ></MethodAPI>
    )


    Can U help me with this error?

    Thanks


  • 06-01-2016 2:54 PM In reply to

    Re: The API could not validate your log in

    Answer

    Hi milos,

    First off, welcome to the Method forum! I see that you're looking for some help using our API and you've certainly come to the right place.

    I'm not too familiar with PHP myself, but I think I may see an issue with your code. When making a call to the API, you'll need to pass both a key (or field) and a value. In your example, it appears that you're just passing the value.

    There are some examples of how to do this included on the PHP website HERE. By the looks of it, you'll need to include the parameters in an associative array.


    arguments
    An array of the arguments to pass to the function. This can be either an ordered or an associative array. Note that most SOAP servers require parameter names to be provided, in which case this must be an associative array.

    Please take a look at the documentation and post back if you're still having trouble with this. I hope this helps.

    --Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 06-01-2016 3:39 PM In reply to

    • milos
    • Not Ranked
    • Joined on 06-01-2016
    • Posts 5

    Re: The API could not validate your log in

    Thank you so much. This work perfectly now :)

Page 1 of 1 (3 items)