承接 dljfield/companies-house 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dljfield/companies-house

Composer 安装命令:

composer require dljfield/companies-house

包简介

Client to interact with Companies House API

README 文档

README

A simple API client for the Companies House API.

Installation

This client can be installed with Composer:

composer require dljfield/companies-house

Endpoints

This client currently has at least partial support for the following endpoints of the Companies House API:

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.

$companyProfile = $companiesHouseClient->getCompanyProfile($companyNumber);

foreach ($companyProfile as $field) {
    echo $field;
}

echo $companyProfile->next_accounts->due_on;

DocumentContents instead has two fields:

  • $content
  • $contentLength

The content should be the file available to stream directly to the browser, e.g.

$pdfFile = $companiesHouseClient->getDocumentContents($documentId, DocumentContents::CONTENT_TYPE_PDF);

header("Content-type: application/octet-stream");
header("Content-disposition: attachment;filename=filing-history-document.pdf");

echo $pdfFile->content;
exit;

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).

统计信息

  • 总下载量: 64
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固