# Help with Document API & Fetch a Document

**URL:** <http://forum.companieshouse.gov.uk/t/help-with-document-api-fetch-a-document/255>\
**Category:** Uncategorized\
**Created:** [September 4, 2015, 8:05am UTC](http://forum.companieshouse.gov.uk/t/help-with-document-api-fetch-a-document/255 "2015-09-04T08:05:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![csmith](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/csmith/32/8_2.png) [@csmith](http://forum.companieshouse.gov.uk/u/csmith)\
**Post date:** [September 8, 2015, 12:10pm UTC](http://forum.companieshouse.gov.uk/t/help-with-document-api-fetch-a-document/255/6 "2015-09-08T12:10:05Z")

</div>

The API is authenticated using BASIC authentication, where the username is your API key, and the password is blank:

> **[Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)**
>
> In the context of an HTTP transaction, basic access authentication is a method for an HTTP user agent (e.g. a web browser) to provide a user name and password when making a request. In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic \<credentials\>, where \<credentials\> is the Base64 encoding of ID and password joined by a single colon :.
> It was originally implemented by Ari Luotonen at CERN in 1993 and defined in the HTTP 1.0 specification in 1996.
> ...

See also:

> [@Getting invalid authorization](http://forum.aws.chdev.org/t/getting-invalid-authorization/41/7):
>
> The existing XML Gateway API employs a custom authentication mechanism unique to Companies House, and involves the complex MD5 hashing of passwords and transaction ID’s. The new Companies House REST API uses standard [Basic HTTP Authorisation][1]. This makes API key authentication as simple as the following curl command: curl -v -uYOUR\_APIKEY\_FOLLOWED\_BY\_A\_COLON: https://api.companiseshouse.gov.uk/company/00002065 You may have to do a little more work in code, depending on whether your client…

This is described on the Developer Hub page, with an example:

[https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/apikey\_authorisation.html](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/apikey_authorisation.html)

---

_[View the full topic](http://forum.companieshouse.gov.uk/t/help-with-document-api-fetch-a-document/255)._
