可信度/dandb

Dun & Bradstreet新兴商业API的PHP包装器

v1.0.24 2017-01-10 23:34 UTC

README

Build Status Coverage Status Packagist

Dun & Bradstreet新兴商业RESTful API的PHP包装器

要使用Laravel,请参阅 credibility/dandb-laravel

安装

使用composer安装

"require": {
  "credibility/dandb": "dev-master"  
}

使用方法

请见下方的示例初始化代码

<?php

include_once 'vendor/autoload.php';

// See Doc Comments for parameters
$dandb = DandB::getInstance('https://api.dandb.com', 'client-id', 'client-secret', array());

//From here, you can use the $dandb object to make requests. See PHP Doc comments in the class for info on how to use.

$response = $dandb->businessSearchByDuns('123456789');

if($response->isValid()) {
  print_r($response->getResponseData());  
} else {
  print_r($response->getErrors());
}

?>

注意:每个请求都有一个可选的访问令牌参数。这允许您在自己的服务器上缓存一个访问令牌,然后将其传递给每个请求。否则,DandB对象将在实际调用之前请求一个访问令牌。