Getting the Records using Rest Api from a module which created by module builder

I am developing a web portal which all data stored in suitecrm, I need to retrieve some records from a module which I was created using module builder.

I am tried the following way , It gives me a error which is "Access Denied ", but It works when I gives the module name as default such as ‘Notes’, ‘Accounts’, etc…

Please correct me anything wrong, or give me a suggestion how to achieve this tasks…

private function get_session_id()
$login_parameters = array(
“user_auth” => array(
“user_name” => $this->username,
“password” => md5($this->password),
“version” => “1”),
“application_name” => “RestTest”,
“name_value_list” => array(),);
$login_result = $this->call(“login”, $login_parameters, $this->url);
$session_id = $login_result->id;
return $session_id;
public function get_tariffs()
$get_entry_list_parameters = array(
“session” => $session_id,
‘module_name’ => ‘TCB_Service_tariffs’,
‘query’ => “”,
‘order_by’ => “”,
‘offset’ => ‘0’,
‘select_fields’ => array(
$res = $this->call(‘get_entry_list’, $get_entry_list_parameters, $this->url);
return $res;

public function call($method, $parameters, $url)
$curl_request = curl_init();
curl_setopt($curl_request, CURLOPT_URL, $url);
curl_setopt($curl_request, CURLOPT_POST, 1);
curl_setopt($curl_request, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($curl_request, CURLOPT_HEADER, 1);
curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl_request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_request, CURLOPT_FOLLOWLOCATION, 0);
$jsonEncodedData = json_encode($parameters);
$post = array(
“method” => $method,
“input_type” => “JSON”,
“response_type” => “JSON”,
“rest_data” => $jsonEncodedData
curl_setopt($curl_request, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($curl_request);
$result = explode("\r\n\r\n", $result, 2);
$response = json_decode($result[1]);
return $response;

Sivakumar Johnson.

IT is working for me If I give the table name on the maule_name