rentprep / smartmove-php
SmartMove PHP 库
Requires
- php: >=5.3.3
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-09-30 00:34:38 UTC
README
要求
PHP 5.3.3 及以上版本。
Composer
您可以通过Composer安装此库。运行以下命令:
composer require rentprep/smartmove-php
要使用此库,使用Composer的自动加载
require_once('vendor/autoload.php');
手动安装
如果您不想使用Composer,可以下载最新版本。然后,为了使用此库,请包含init.php文件。
require_once('/path/to/smartmove-php/init.php');
入门指南
简单用法如下:
use SmartMove\SmartMove; SmartMove::setApiKey('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'); SmartMove::setSandboxMode(true); //change to false for production $referenceId = 'XXX'; // The unique ID in your system of the person who created the application $applications = SmartMove::getApplications($referenceId);
可选地,您可以在全局范围内设置应用程序的用户$referenceId一次。
use SmartMove\SmartMove; SmartMove::setApiKey('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'); SmartMove::setSandboxMode(true); //change to false for production SmartMove::setReferenceId('XXX'); $applications = SmartMove::getApplications();
用法
这并非旨在提供API的完整文档。更多详细信息,请参阅官方文档。
##应用
创建新应用
string SmartMove::createApplication([mixed $referenceId [, array $params]]);
$referenceId 创建应用的系统中该用户的唯一ID
$params 预填申请表字段的其他选项
返回可以访问应用的URL
列出所有应用
array SmartMove::getApplications([mixed $referenceId]);
$referenceId 创建应用的系统中该用户的唯一ID
返回应用对象数组
获取应用详情
object SmartMove::getApplication(int $applicationId [, mixed $referenceId]);
$applicationId 从SmartMove::getApplications获取的应用ID
$referenceId 创建应用的系统中该用户的唯一ID
返回应用对象
取消应用
bool SmartMove::cancelApplication(int $applicationId [, mixed $referenceId]);
$applicationId 从SmartMove::getApplications获取的应用ID
$referenceId 创建应用的系统中该用户的唯一ID
如果应用被取消,则返回true,否则返回false
将申请人添加到应用
bool SmartMove::addApplicant(int $applicationId, mixed $email [, mixed $referenceId]);
$applicationId 从SmartMove::getApplications获取的应用ID
$email 申请人电子邮件地址的字符串或数组
$referenceId 创建应用的系统中该用户的唯一ID
如果申请人被添加到应用,则返回true,否则返回false
从应用中移除申请人
bool SmartMove::removeApplicant(int $applicationId, mixed $email [, mixed $referenceId]);
$applicationId 从SmartMove::getApplications获取的应用ID
$email 申请人电子邮件地址的字符串或数组
$referenceId 创建应用的系统中该用户的唯一ID
如果申请人被从应用中移除,则返回true,否则返回false
获取报告URL
string SmartMove::getReportUrl(int $applicationId [, mixed $referenceId]);
$applicationId 从SmartMove::getApplications获取的应用ID
$referenceId 创建应用的系统中该用户的唯一ID
返回可以访问应用报告的URL