title: How can I generate an API Key in My own Controller in Codeigniter
body: <p>Just want to mention that I am really a newbie in API development (concepts, structure, best practices) I am not nearly familiar with it at all, so please excuse my pathetic stupid question if you find it to be, I'm using Phil Sturgeon's REST API server, Curl Library, and REST API client here's my code:</p>
  
  <p>in my controller application/controllers/make_key</p>
  
  <pre><code>function index(){
        $this-&gt;load-&gt;library('rest');
        $this-&gt;load-&gt;library('curl');
        $this-&gt;rest-&gt;put('https://www.myapplication.com/apifolder/key/X-API-KEY/FOO');
      }
  </code></pre>
  
  <p>- no response at all</p>
  
  <p>where apifolder/key is the location of my key.php (from Phil Sturgeon's default example):</p>
  
  <p>and note that I've also tried this via address bar:</p>
  
  <p><a href="https://www.myapplication.com/apifolder/key/X-API-KEY/FOO" rel="nofollow">https://www.myapplication.com/apifolder/key/X-API-KEY/FOO</a> 
  - returns ({"status":false,"error":"Invalid API Key."})</p>
  
  <p><a href="https://www.myapplication.com/apifolder/key?X-API-KEY=FOO" rel="nofollow">https://www.myapplication.com/apifolder/key?X-API-KEY=FOO</a>
   - returns ({"status":false,"error":"Unknown method."}) </p>
  
  <p>and tried quite a lot more queries but none seem to be working, my only question is... </p>
  
  <p>How can make this key.php work? my apologies for such a simple minded question thank you in advance</p>