You are here

function mobile_number_services_resources in Mobile Number 7

Implements hook_services_resources().

File

./mobile_number.module, line 1172
mobile_number.module

Code

function mobile_number_services_resources() {
  return array(
    'mobile_number' => array(
      'actions' => array(
        'request_verification_code' => array(
          'help' => 'Sends a verification code to a mobile number',
          'file' => array(
            'type' => 'inc',
            'module' => 'mobile_number',
            'name' => 'include/mobile_number.resources',
          ),
          'callback' => '_mobile_number_request_code',
          'access arguments' => array(
            'access mobile number services api',
          ),
          'args' => array(
            array(
              'name' => 'number',
              'type' => 'string',
              'description' => 'The mobile number to send code to.',
              'source' => array(
                'data' => 'number',
              ),
              'optional' => FALSE,
            ),
            array(
              'name' => 'country',
              'type' => 'string',
              'description' => 'The country of the mobile number.',
              'source' => array(
                'data' => 'country',
              ),
              'optional' => TRUE,
            ),
          ),
        ),
        'verify_number' => array(
          'help' => 'Verifies a mobile number.',
          'file' => array(
            'type' => 'inc',
            'module' => 'mobile_number',
            'name' => 'include/mobile_number.resources',
          ),
          'callback' => 'mobile_number_resource_verify_number',
          'access arguments' => array(
            'access mobile number services api',
          ),
          'args' => array(
            array(
              'name' => 'number',
              'type' => 'string',
              'description' => 'The mobile number to verify.',
              'source' => array(
                'data' => 'number',
              ),
              'optional' => FALSE,
            ),
            array(
              'name' => 'country',
              'type' => 'string',
              'description' => 'The country of the mobile number.',
              'source' => array(
                'data' => 'country',
              ),
              'optional' => TRUE,
            ),
            array(
              'name' => 'code',
              'type' => 'string',
              'description' => 'The that was sent to the mobile number.',
              'source' => array(
                'data' => 'code',
              ),
              'optional' => FALSE,
            ),
            array(
              'name' => 'verification_token',
              'type' => 'string',
              'description' => 'The token generated to go with the code.',
              'source' => array(
                'data' => 'verification_token',
              ),
              'optional' => TRUE,
            ),
          ),
        ),
      ),
    ),
  );
}