I am building an App that connects to the aMember database on my server for validation of the users. I have been successful is getting it to create an account in the aMember database. I can also validate the username / password entered in the app against the one from aMember. Lastly, once user is logged in, I am able to change the password by having them enter their current password, validate it and change it to a new one. The one piece I am missing is a forgot password. On the login of my app, if the user enters the password and it is wrong, I want to offer them an option to enter a username or email and the app will send that info to a page on my server. On that page, I need to somehow trigger the forgot password functionality for aMember that will send them an email with the password reset link. This, I have no clue how to do and is the last piece of the puzzle.
Send a post request to your /amember/sendpass with one parameter: login=USERLOGIN You will receive jSON in response, then parse it in your script.
Hi Alex, Sorry to dig up an old thread, but I am trying to do exactly this, and am not getting a response back in JSON format -- instead I am getting the response back as an entire webpage. Below is the code I am using to make the request -- is there a certain header I need to send to get JSON format? $foo = "http://my.server.com/signup/sendpass"; $request = new HTTP_Request2($foo); $request->setHeader('Content-type: application/json'); $request->setMethod(HTTP_Request2::METHOD_POST) ->addPostParameter('login',"testusername"); try { $response = $request->send(); if (200 == $response->getStatus()) { //echo $response->getBody(); $debuglog->LogInfo("SUCCESS: POST TO SENDPASS"); $debuglog->LogInfo("SUCCESS: RESPONSE ". $response->getStatus() . " " . $response->getBody()); } else { //echo 'ERROR: Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); $errorlog->LogError("ERROR: Unexpected HTTP status POST VIA HTTP_Request2(" .$foo." ): ". $response->getReasonPhrase() . "**"); $errorlog->LogError("ERROR: POST RESPONSE: ". $response->getReasonPhrase()); //Am_Di::getInstance()->errorLogTable->logException($response->getReasonPhrase()); } } catch (HTTP_Request2_Exception $e) { //Am_Di::getInstance()->errorLogTable->logException($e); $errorlog->LogError("ERROR: An exception was thrown in HTTP_Request2( ".$foo." ) ". $e->getMessage() . "**"); $errorlog->LogError("ERROR: FULL TRACE: ( ".$foo." ) ". $e->getTraceAsString() . ""); //echo 'Error: ' . $e->getMessage(); $response = "ERROR: " . $response->getReasonPhrase; return $response; } Thanks, Brian