title: CodeIgniter Rest Server Integration
body: <p>I have downloaded CodeIgniter Rest Server source code from github <a href="https://github.com/chriskacerguis/codeigniter-restserver" rel="nofollow">https://github.com/chriskacerguis/codeigniter-restserver</a>.</p>
  
  <p>I have integrated as per readme document but i am getting an error of "Invalid API Key " with 403 Forbidden error when i call like htttp://www.sitename.com:81/api/key/index to generate first time new key and store into database.</p>
  
  <p>Screenshot 1 :<a href="http://i.stack.imgur.com/7Dtpb.png" rel="nofollow">See this screenshot of error occured in FF browser as well as in POSTMAN Extension used in Google Chrome Windows 7 - 64bit</a></p>
  
  <p>Below is the code in my Rest.php >>>>></p>
  
  <pre><code>&lt;?php 
  defined('BASEPATH') OR exit('No direct script access allowed');
  $config['force_https'] = FALSE;
  $config['rest_default_format'] = 'json';
  $config['rest_supported_formats'] = ['json','array','csv','html','jsonp','php','serialized','xml'];
  $config['rest_status_field_name'] = 'status';
  $config['rest_message_field_name'] = 'error';
  $config['enable_emulate_request'] = TRUE;
  $config['rest_realm'] = 'REST API';
  $config['rest_auth'] = FALSE;
  $config['auth_source'] = ''; //i set it as none/blank, default value set as 'ldap'
  $config['auth_library_class'] = '';
  $config['auth_library_function'] = '';
  $config['rest_valid_logins'] = ['admin' =&gt; '1234'];
  $config['rest_ip_whitelist_enabled'] = FALSE;
  $config['rest_ip_whitelist'] = '';
  $config['rest_ip_blacklist_enabled'] = FALSE;
  $config['rest_ip_blacklist'] = '';
  $config['rest_database_group'] = 'default';
  $config['rest_keys_table'] = 'keys';
  $config['rest_enable_keys'] = TRUE; //i set it as TRUE default value is FALSE
  $config['rest_key_column'] = 'key';
  $config['rest_limits_method'] = 'ROUTED_URL';
  $config['rest_key_length'] = 40;
  $config['rest_key_name'] = 'X-API-KEY';
  $config['rest_enable_logging'] = TRUE;//i set it as TRUE default value is FALSE
  $config['rest_logs_table'] = 'logs';
  $config['rest_enable_access'] = FALSE;
  $config['rest_access_table'] = 'access';
  $config['rest_logs_json_params'] = FALSE;
  $config['rest_enable_limits'] = FALSE;
  $config['rest_limits_table'] = 'limits';
  $config['rest_ignore_http_accept'] = FALSE;
  $config['rest_ajax_only'] = FALSE;
  $config['rest_language'] = 'english';
  </code></pre>
  
  <p>Code in routes.php >></p>
  
  <pre><code>$route['api/key/index'] = 'api/key/index'; // Generate First Time Key
  </code></pre>
  
  <p>Can anyone please guide me how to generate this first time key for CI rest server?</p>
  
  <p>It will be really helpful if anyone give solution for this issue asap as i was trying to resolve it since 2 days to find the solution but did not get any success. :(</p>