CINXE.COM
:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src='/js/jquery.wiggle.min.js' type='text/javascript'></script> <script src="/js/explorer.js" type="text/javascript"></script> <link href="/css/xcode.css" type="text/css" media="screen" rel="stylesheet"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <link href="/css/style.css" rel="stylesheet"> <link href="/css/govstrap.css" rel="stylesheet"> <link href="/css/govstrap_extra.css" rel="stylesheet"> <link href="/css/developer.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet"> <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' rel='stylesheet' type='text/css'> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <script src='/js/highlight.pack.js' type='text/javascript'></script> <script>hljs.initHighlightingOnLoad();</script> <title>: </title> </head> <body > <nav class="navbar navbar-fixed-top shadow"> <div class="container-fluid"> <div class="row"> <div class="1 col-lg-1 hidden-xs hidden-sm hidden-md"></div> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-10"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">Companies House</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a href="/">All APIs</a> </li> </ul> </div> </div> <div class="col-lg-1 hidden-xs hidden-sm hidden-md"></div> </div> </div> </nav> <div class="container-fluid"> <div class="row"> <div class="hidden-md col-lg-1 hidden-xs hidden-sm"></div> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-10 main-body"> <div class="body-header body-header-content"> <ul id="SIN" class="nav navbar-nav navbar-right userbar deactivate"> <li> <span class="user_info" id="email"></span>: </li> <li><a href="/developer/applications">Applications</a></li> <li> <a href="/developer/signout">Sign out</a> </li> </ul> <ul id="SOUT" class="nav navbar-nav navbar-right userbar deactivate"> <li><a href="/developer/signin">Sign in</a></li> </ul> <ul id="ERROR" class="nav navbar-nav navbar-right userbar deactivate"> <li id="placeholder"></li> </ul> </div> <div class="row"> <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3"> <script> $(document).ready(function(){ $('.items').hide(); var $pagename=decodeURI( window.location.pathname ); var $parent=$('ul[id="navigation"]'); var $element=$parent.find('a[href$="'+$pagename+'"]'); if( $element.length == 0 ) { $pagename = sessionStorage.lastpage; $element=$parent.find('a[href$="'+$pagename+'"]'); } sessionStorage.lastpage = $pagename; var api_id = $element.data('outer'); var toggler = $("#toggle"+api_id); var outerul = $("#ul"+api_id); outerul.addClass('in'); toggler.addClass('open'); toggler.removeClass('collapsed'); $element.addClass('nav-selected'); $parent.removeClass('hide'); }); </script> <div class="side-nav affix"> <ul class="nav nav-sidebar hide" id="navigation"> <li> <a href="/guides/index">Companies House API</a> </li> <li> <a href="/guides/gettingStarted">Getting started</a> </li> <li> <a href="/guides/quickStart">Quick start</a> </li> <li> <a href="/guides/introduction">Introduction</a> </li> <li> <a href="/guides/authorisation">Authorisation</a> </li> <li> <a href="/guides/developerGuidelines">Developer guidelines</a> </li> <li> <a href="/guides/rateLimiting">Rate limiting</a> </li> <li> <a href="/guides/versioning">API versioning</a> </li> </ul> </div> </div> <div class="col-xs-12 col-sm-9 col-md-9 col-lg-9 main"> <h1 class="page-header"><a name="authorisation" class="anchor" href="#authorisation" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a>Authorisation</h1> <h2 class="sub-header"><a name="api-key-authentication" class="anchor" href="#api-key-authentication" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a> API key authentication</h2> <p>The Companies House API requires authentication credentials, in the form of an API key, to be sent with each request.</p> <p>To obtain an API key, go to <a href="https://developer.company-information.service.gov.uk/manage-applications" rel="nofollow">Your applications</a> and register the application with the Companies House Developer Hub as an <code>API Key</code> application. This will allocate a unique key to the application which can be sent with any <code>GET</code> request for a public resource served by the Companies House API.</p> <h3 class="sub-sub-header"><a name="sending-the-api-key" class="anchor" href="#sending-the-api-key" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a> Sending the API key</h3> <p>The Companies House API uses <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" rel="nofollow">HTTP Basic Authentication</a> to transmit an API key between the client application and the server. Basic authentication is usually made up of a username and password pair; the Companies House API takes the username as the API key and ignores the password, so can be left blank.</p> <h3 class="sub-sub-header"><a name="example" class="anchor" href="#example" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a> Example</h3> <h4 class="sub-sub-sub-header"><a name="http-basic-authentication" class="anchor" href="#http-basic-authentication" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a> HTTP Basic Authentication</h4> <p>For an API key of my_api_key, the following curl request demonstrates the setting of the <code>Authorization</code> HTTP request header, as defined by <a href="https://tools.ietf.org/html/rfc2617" rel="nofollow">RFC2617</a>.</p> <pre><code><code>curl -XGET -u my_api_key: https://api.company-information.service.gov.uk/company/00000006 GET /company/00000006 HTTP/1.1 Host: api.company-information.service.gov.uk Authorization: Basic bXlfYXBpX2tleTo= </code></code></pre> <h2 class="sub-header"><a name="oauth-2-0-authentication" class="anchor" href="#oauth-2-0-authentication" rel="nofollow" aria-hidden="true"><span class="octicon octicon-link"></span></a> OAuth 2.0 authentication</h2> <p>The Companies House API has some functionality that requires OAuth 2.0 authentication for actions that require and end user.</p> <p>For details on integrating a third party web service with the Companies House OAuth 2.0 service see <a href="/companies-house-identity-service/guides/ServerWeb" rel="nofollow">the guide here</a> and the available <a href="/manipulate-company-data-api-filing/reference" rel="nofollow">API Filing functionality here</a>.</p> </div> </div> </div> <div class="col-lg-1 hidden-xs hidden-sm hidden-md"></div> </div> </div> <div id="footer" class="footer"> <div class="container-fluid"> <div class="row"> <div class="col-lg-1 hidden-xs hidden-sm hidden-md"></div> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-10"> <ul class="nav navbar-nav"> <li><a href="http://www.companieshouse.gov.uk/legal/termsAndConditions.shtml">Policies</a></li> <li><a href="https://find-and-update.company-information.service.gov.uk/help/cookies">Cookies</a></li> <li><a href="http://forum.aws.chdev.org">Forum</a></li> <li><a href="https://find-and-update.company-information.service.gov.uk/help/contact-us">Contact us</a></li> </ul> </div> <div class="col-lg-1 hidden-xs hidden-sm hidden-md"></div> </div> </div> </div> <script src="/js/userbar.js"></script> <script> $(document).ready(function(){ apiExplorer.setBeforeSendCallback( function( request ) { var apiKey = apiExplorer.readApiKey(); var accessToken = apiExplorer.readAccessToken(); var basicAuth = apiExplorer.getBasicAuthentication(); if( accessToken != "" ) { request.headers = {Authorization: "Bearer "+accessToken}; } else if( apiKey != "" ) { request.params = {key: apiKey}; } else if( basicAuth != "" ) { request.headers = {Authorization: "Basic "+basicAuth}; } }); }); </script> </body> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> </html>