1

I am new to Drupal and its web services.

I am working on user forgot password API by using the Services module. Below is my service resource code:

function test_api_services_resources() { $definition = array( 'test_api' => array( 'actions' => array( 'forgot_password' => array( 'help' => 'Reset user password', 'callback' => '_test_api_resource_forgot_pass', 'args' => array( array( 'name' => 'email', 'type' => 'string', 'description' => 'The user email id', 'source' => 'data', 'optional' => FALSE, ), ), 'access callback' => 'services_access_menu', 'file' => array('type' => 'inc', 'module' => 'services', 'name' => 'resources/user_resource'), ), ), ), ), return $definition; } function _test_api_resource_forgot_pass($email){ //Just for testing purpose i have returned my input parameter return $email; } 

Whenever I try to run this in Firefox Poster addon I get an error 404 Not found: Could not find the controller. I don't know what is the exact issue!

4
  • You need to login with token to see OK Commented Oct 30, 2015 at 13:19
  • @Stefen login is working in actions but my custom forgot_password only not works in any of .. Commented Oct 30, 2015 at 13:30
  • 1
    does your arrays and fields are correct? also is the resource is checked on the services? Commented Oct 30, 2015 at 13:35
  • The request_new_password resource already exists in the Services module: cgit.drupalcode.org/services/tree/resources/… - other than that, clear all your caches and be sure to POST along the X-CSRF-Token with your requests. Commented Nov 1, 2015 at 13:34

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.