Download the PHP package dljfield/companies-house without Composer
On this page you can find all versions of the php package dljfield/companies-house. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dljfield/companies-house
More information about dljfield/companies-house
Files in dljfield/companies-house
Package companies-house
Short Description Client to interact with Companies House API
License MIT
Informations about the package companies-house
Companies House API Client
A simple API client for the Companies House API.
Installation
This client can be installed with Composer:
Endpoints
This client currently has at least partial support for the following endpoints of the Companies House API:
- Company Profile
- Officer List
- Filing History List
- Persons With Significant Control List
- Company Search
- Document Meta
- Document Contents
Usage
To use the client, you must create an instance of DLJField\CompaniesHouse\Client
, passing your Companies House API key into the constructor.
Responses
All endpoints return a named class as a response.
Except for the DocumentContents
type, these classes are simple data objects that contain the response contents of the API call. As such, you can iterate over them and access them the way you would any other simple data object. e.g.
DocumentContents
instead has two fields:
$content
$contentLength
The content should be the file available to stream directly to the browser, e.g.
Exceptions
If an API call fails, an exception will be thrown. As well as a normal exception message, these exceptions hold a statusCode
parameter, a reason
parameter and a contents
parameter. These are the status code of the API response, the reason phrase associated with that status code, and any response body returned from the Companies House API (such as their own errors).