Jump to content

Internal API error


l0sth34d

Recommended Posts

Hello,

 

I'm using the internal API, I added the IP of the server in the security section and created an admin with the API Access for the Role and I'm still getting the "result=error;message=Authentication Failed;" message when I call the API. I tried a simple validate login command, the result is "result=error;message=Authentication Failed;OK". So basicly everything is working except that it keeps saying this Authentication Failed without any reason... Is this a bug or am I missing something here ? Heres the code..

 

 <?php
require("../includes/api.php");

# Set Vars
$command = 'validatelogin';
$values = array( 'email' => 'email_of@the_client.com', 'password2' => 'his_password', );
$adminuser = 'API_USERNAME';

# Call API
$results = localAPI($command,$values,$adminuser);
if ($results['result']!="success") {
 echo "An Error Occurred: ".$results['result'];
}
else {
 echo "OK";
}

?>

Link to comment
Share on other sites

Thank you very much for your reply gnugeek,

 

I found out what was the problem, I was calling the api.php and I found out that it's not the way to do it. We need to call some files like when we create a custom page (can't remember the file names and cannot verify since I'm writing this with my cellphone). However if anyone have the same problem I will be glad to help.

Edited by l0sth34d
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated