Request

POST /api_key/
Content-Type: application/json
{
    "label": "Api key for application A"
}

Response

201 Created
Content-Type: application/json
Location: /api_key/1/
{
    "created_at": "2013-09-12T14:12:39.720112", 
    "resource_uri": "/api/v1/api_key/1/", 
    "id": 1, 
    "key": "20d1b1d8d107b508f2e2e280ab8a3a012c2112de", 
    "label": "Api key for application A"
}

Request

POST /api_key/
Content-Type: application/xml
<object>
  <label>Api key for application B</label>
</object>

Response

201 Created
Content-Type: application/xml; charset=utf-8
Location: /api_key/2/
<object>
  <created_at>2013-09-12T14:12:39.789207</created_at>
  <resource_uri>/api/v1/api_key/2/</resource_uri>
  <id type="integer">2</id>
  <key>94a33ea6824fcb5e46276d3053e23d2c951b1de8</key>
  <label>Api key for application B</label>
</object>

Request

POST /api_key/
Content-Type: text/yaml
{label: !!python/unicode 'Api key for application C'}

Response

201 Created
Content-Type: text/yaml; charset=utf-8
Location: /api_key/3/
{created_at: '2013-09-12T14:12:39.808002', !!python/unicode 'id': 3, key: !!python/unicode '719820bfe2e033ccdcec52d5f98c93e327cde911',
label: !!python/unicode 'Api key for application C', resource_uri: !!python/unicode '/api/v1/api_key/3/'}