Method Community

 

[MethodAPITableListResult] => Failure. The API could not validate your log in.

Last post 02-05-2016 3:21 PM by arrowplane. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-21-2015 4:52 PM

    [MethodAPITableListResult] => Failure. The API could not validate your log in.

    I was able to get a SOAPClient working with php, but its coming back with this error:

    [MethodAPITableListResult] => 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.

    The user is allowed to connect to method api.

    Can someone help?

  • 01-21-2015 5:57 PM In reply to

    Re: [MethodAPITableListResult] => Failure. The API could not validate your log in.

    In case anyone else needs a working PHP example, this was the easiest way I found and it works just fine:


    $company     = 'XXXX';
    $login         = 'XXXX';
    $password     = 'XXXX';
    $method     = file_get_contents("https://www.methodintegration.com/MethodAPI/service.asmx/MethodAPITableListV2?strCompanyAccount=$company&strLogin=$login&strPassword=$password&strSessionID=");

    $methodAPI = new SimpleXMLElement($method);

    $xml = simplexml_load_string($methodAPI[0]);
    $json = json_encode($xml);
    $array = json_decode($json,TRUE);

    print_r($array);

  • 01-22-2015 8:30 AM In reply to

    Re: [MethodAPITableListResult] => Failure. The API could not validate your log in.

    Thanks for posting a follow up with your working example. 

  • 01-21-2016 11:27 AM In reply to

    Re: [MethodAPITableListResult] => Failure. The API could not validate your log in.

    Thanks for posting this.  It works for me, using your exact code.  However, if I try using another method -- MethodAPIInsert -- I keep getting this error:

    PHP Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' 

    ...referencing SimpleXMLElement.  Do you have any insight into this?  For the insert method, I do have to pass arrays.  Will that work with SimpleXMLElement?

  • 02-05-2016 3:21 PM In reply to

    Re: [MethodAPITableListResult] => Failure. The API could not validate your log in.

    Here is a post with a working PHP example: http://www.method.me/cs/forums/p/9307/31447.aspx#31447

Page 1 of 1 (5 items)