Drupal Rest services "access denied user anonymous" I have created a custom service where I am passing parameters and retrieving result from another file. 

So to test it I tried on Postman and I put URL with sitename/endpoint/resource and passed parameters in key value.
When I submit I get an error as access denied user anonymous.

I have return my custom services under hook_services_resources() function

function mymodule_services_resources() {
 $api = array(
  'blog' =&gt; array(
    'actions' =&gt; array(
     'math' =&gt; array(
      'help' =&gt; 'Retrieves posted blogs',
      'file' =&gt; array('type' =&gt; 'inc', 'module' =&gt; 'MYMODULE', 'name' =&gt; 'mymodule'),

      'callback' =&gt; 'mymodule_blog_retrieve',
      'access arguments' =&gt; array('services_access_menu'),

      'access arguments append' =&gt; TRUE,
      'args' =&gt; array(
        array(
          'name' =&gt; 'var1',
          'type' =&gt; 'string',
          'description' =&gt; 'variable 1',
          'source' =&gt; array('data' =&gt; 'var1'),
          'default' =&gt; '0',
        ),
        array(
          'name' =&gt; 'var2',
          'type' =&gt; 'string',
          'description' =&gt; 'variable 2',
          'source' =&gt; array('data' =&gt; 'var2'),
          'default' =&gt; '0',
        ),
      ),
    ),
  ),
),

 );
  return $api;
}


and inc file just takes parameters var1 and var2 and adds it and returns the sum.

Please help me finding out where i have done mistakes.
Here is running code with access callback function:



function mymodule_services_resources() {
 $api = array(
  'blog' => array(
    'actions' => array(
     'math' => array(
      'help' => 'Retrieves posted blogs',
      'file' => array('type' => 'inc', 'module' => 'MYMODULE', 'name' => 'mymodule'),
      'callback' => 'mymodule_blog_retrieve',
      'access arguments' => array('views'),
      'access callback' => '_blog_access_provide_access', 
      'access arguments append' => TRUE,
      'args' => array(
        array(
          'name' => 'var1',
          'type' => 'string',
          'description' => 'variable 1',
          'source' => array('data' => 'var1'),
          'default' => '0',
        ),
        array(
          'name' => 'var2',
          'type' => 'string',
          'description' => 'variable 2',
          'source' => array('data' => 'var2'),
          'default' => '0',
        ),
      ),
    ),
  ),
),

 );
  return $api;
}



/** * Access callback */
function _blog_access_provide_access() {
  return TRUE;
}


I hope this would help you.