{"_id":"579dfde8f8b52d0e0043fd01","version":{"_id":"56e29a8dd3b68d0e00b48ffd","hasReference":true,"project":"56e29a8dd3b68d0e00b48ffa","__v":15,"hasDoc":true,"createdAt":"2016-03-11T10:14:37.460Z","releaseDate":"2016-03-11T10:14:37.460Z","categories":["56e29a8ed3b68d0e00b48ffe","56eb917a2e58011700afdfcc","56eb92252109011700f3ba5e","5704d4af849f721900f27835","57052a31473f900e004d5d54","5715222811537f19006aab2d","5715b57b810df00e00cc7832","5715baa9810df00e00cc7837","57180ed83a17770e009a7322","571810273a17770e009a7325","579b22d3f4ad7b190094b60e","584538ecba4f1c0f0096925e","586bb88e5602870f00ae7177","5a70407fb0a01400369583c5","5ace359e40606a0003eac1de"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"project":"56e29a8dd3b68d0e00b48ffa","user":"5795d43eb9ee2d0e00df357a","__v":4,"parentDoc":null,"category":{"_id":"579b22d3f4ad7b190094b60e","project":"56e29a8dd3b68d0e00b48ffa","__v":0,"version":"56e29a8dd3b68d0e00b48ffd","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-07-29T09:33:07.078Z","from_sync":false,"order":1,"slug":"accounts","title":"Accounts"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-31T13:32:24.746Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"name":"","code":"{\n    \"Id\": 4817517,\n    \"Email\": \"test:::at:::example.com\",\n    \"ApiKeys\": [\n        \"PsDW6SRVd4TXRdm69sPXEcdYDMRV1ZXX6z8X7ZU9iBb7Wf2qlUlPJP9U0Wend\",\n      \t\"MmozazEzajJrMmozMmtqZGRkIiwibmFtZSI6IkpvaG4gRG9lIiwiY1fac1X4\"\n    ],\n    \"FirstName\": 'Test',\n    \"LastName\": 'Example',\n    \"Company\": 'Example.com',\n    \"Phone\": '+44-7500-000-000',\n    \"Address\": '123 Test Street, London, UK',\n    \"SIREN\": null,\n    \"Roles\": \"User\",\n    \"Active\": true\n}","language":"json"},{"code":"{\n\t'Message' : 'Authorization has been denied for this request.'\n}","language":"json","status":401}]},"settings":"","examples":{"codes":[{"code":"{\n  \"package\" : \"Coverage\"\n}","language":"json"},{"code":"<?php\nrequire_once(\"vendor/autoload.php\");\nuse GuzzleHttp\\Client;\n\n// Create a client and provide a base URL\n$client = new Client([ \n\t'timeout' \t=> 30.0,\n\t'verify'\t=> true,\n\t'debug'\t\t=> true,\n]);\n\ntry \n{\n\t// POST the account creation request with the required parameters\n\t$response = $client->request('POST', $api_base_uri.\"/account/key\", [\n\t\t'headers' => [ 'apikey' => $apikey_account ],\n\t\t'json' \t=> \t[ \n\t\t\t\t\t\t'package' => \"Coverage\",\n\t\t\t\t\t],\n\t]);\n\n\t// Check the status code returned by the call\n\t$statusCode = $response->getStatusCode();\n\n\t// Get the data\n\t$data = json_decode($response->getBody(), true);\n\tprint json_encode($data, JSON_PRETTY_PRINT);\n}\ncatch (GuzzleHttp\\Exception\\ClientException $e) {\n    $response = $e->getResponse();\n    $responseBodyAsString = $response->getBody()->getContents();\n    print $responseBodyAsString;\n}","language":"php"}]},"method":"post","auth":"required","params":[{"_id":"579ef894994abf0e00a593c3","ref":"","in":"header","required":true,"desc":"Your API key for account management.","default":"","type":"string","name":"apikey"},{"_id":"579efe0abf088a0e00b8cfcd","ref":"","in":"body","required":true,"desc":"The type of key to request. Valid options are 'Account' or 'Coverage'.","default":"","type":"string","name":"package"}],"url":"/account/key"},"isReference":true,"order":3,"body":"This method allows you to request a new API key with which you can access the API. \n\nThis method is called with your default API key (the 'Account Management API key') as a query parameter; it will return your full Account object with the new key listed.\n\nThere are two types of API keys: \n\n* \"Account\" keys, referred to here as Account Management API keys, which are used for calling account-related functions. \n* \"Coverage\" keys, for calling coverage methods like searching, requesting a quote or activating coverage.","excerpt":"Request a new API key.","slug":"create-api-key","type":"endpoint","title":"Create API Key"}

postCreate API Key

Request a new API key.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

package:
required
string
The type of key to request. Valid options are 'Account' or 'Coverage'.

Headers

apikey:
required
string
Your API key for account management.

Examples


Result Format


Documentation

This method allows you to request a new API key with which you can access the API. This method is called with your default API key (the 'Account Management API key') as a query parameter; it will return your full Account object with the new key listed. There are two types of API keys: * "Account" keys, referred to here as Account Management API keys, which are used for calling account-related functions. * "Coverage" keys, for calling coverage methods like searching, requesting a quote or activating coverage.