# Fetching filing file metadata

**URL:** <http://forum.companieshouse.gov.uk/t/fetching-filing-file-metadata/2819>\
**Category:** API Issues\
**Created:** [January 23, 2020, 1:10pm UTC](http://forum.companieshouse.gov.uk/t/fetching-filing-file-metadata/2819 "2020-01-23T13:10:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [January 24, 2020, 5:34pm UTC](http://forum.companieshouse.gov.uk/t/fetching-filing-file-metadata/2819/2 "2020-01-24T17:34:33Z")

</div>

Either [document-api.companieshouse.gov.uk](http://document-api.companieshouse.gov.uk) or [frontend-doc-api.companieshouse.gov.uk](http://frontend-doc-api.companieshouse.gov.uk) should work (basically, use whatever you get back from CH in “document\_metadata”) - see:  
[Filing history change - documents api alias?](https://forum.aws.chdev.org/t/filing-history-change-documents-api-alias/1813)

For the 404 - that suggests something else has crept in to the URL you’re requesting. I tested exactly the “document\_metadata” link you got back from CH and it worked OK for me (see later).

I don’t know if this is significant but I notice in your examples you’ve got two different expressions going on:  
First example:

```
headers={'Authorization': {mykey})

```

and in the subsequent examples:

```
headers={'Authorization': '{mykey}'})

```

It’s likely not significant but I notice you’re using “[http://document-api.companieshouse.gov.uk](http://document-api.companieshouse.gov.uk)” not https in one example - I’d ensure you always use https.

I just tested the link (using curl) - either way works:

```
curl -u"API_KEY_HERE:" "https://frontend-doc-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k"

```

Gives:

```
{
    "company_number": "09446231",
    "barcode": "A8WN6FJF",
    "significant_date": null,
    "significant_date_type": "",
    "category": "capital",
    "pages": 10,
    "created_at": "2020-01-17T12:28:09.163046105Z",
    "etag": "",
    "links": {
        "self": "https://document-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k",
        "document": "https://document-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k/content"
    },
    "resources": {
        "application/pdf": {
            "content_length": 207979
        }
    }
}

```

And:

```
curl -u"API_KEY_HERE:" "https://document-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k"

```

…gives the same resource.

---

_[View the full topic](http://forum.companieshouse.gov.uk/t/fetching-filing-file-metadata/2819)._
