Hello! I am trying to use the api to fetch filing file. I am using python requests library.
First step:
response = requests.get('https://api.companieshouse.gov.uk/company/09446231/filing-history/MzI1NDYyNzcxNWFkaXF6a2N4',
headers={'Authorization': {mykey}).json()
I receive:
{'action_date': '2020-01-07',
'category': 'capital',
'date': '2020-01-16',
'description': 'capital-allotment-shares',
'description_values': {'date': '2020-01-07',
'capital': [{'figure': '12.946916', 'currency': 'GBP'}]},
'links': {'self': '/company/09446231/filing-history/MzI1NDYyNzcxNWFkaXF6a2N4',
'document_metadata': 'https://frontend-doc-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k'},
'paper_filed': True,
'type': 'SH01',
'pages': 10,
'barcode': 'A8WN6FJF',
'transaction_id': 'MzI1NDYyNzcxNWFkaXF6a2N4'}
However when I try to get metadata I get 404 error.
requests.get('https://frontend-doc-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k',
headers={'Authorization': '{mykey}'})
<Response [404]>
The documentation says that to get metadata I need to use http://document-api.companieshouse.gov.uk/document/{id}
However I am not sure, whether the id is MzI1NDYyNzcxNWFkaXF6a2N4(transaction_id)
or the last part of broken metadata link 2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k
. Anyway both ioptions yield error 500.
requests.get('http://document-api.companieshouse.gov.uk/document/MzI1NDYyNzcxNWFkaXF6a2N4',
headers={'Authorization': '{mykey}'})
<Response [500]>
requests.get('http://document-api.companieshouse.gov.uk/document/2N7iuPGYl8d4g_jcmQtl_Mpqk6CbVFSGZQyPad70Y0k',
headers={'Authorization': '{mykey}'})
<Response [500]>
Thank you in advance for the help!