softgarden / php-sdk
softgarden PHP SDK
dev-master
2020-04-24 07:50 UTC
Requires
- php: >=5.2.0
- ext-curl: *
- ext-json: *
This package is not auto-updated.
Last update: 2024-09-15 02:22:01 UTC
README
softgarden-cloud API 是一套连接您的应用程序到 softgarden 云 ATS 的 API。
此存储库包含允许您从 PHP 应用程序访问 softgarden 云 API 的开源 PHP SDK。除非另有说明,否则 softgarden PHP SDK 在 Apache 许可证 2.0 版下授权(https://apache.ac.cn/licenses/LICENSE-2.0.html)。
用法
您至少需要以下内容
require 'softgarden-php-sdk/src/Softgarden.php';
$softgarden = new Softgarden(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET' // only required if your app has an secret
));
// call an API endpoint
$response = $softgarden->get('v2/frontend/me');
要进行 API 调用,一般模式为
try {
// make the api call, generic
$response = $softgarden->api('v2/frontend/me');
// make the api call, get
$response = $softgarden->get('v2/frontend/me', $optionalQueryParamsAsArray);
// make the api call, post
$response = $softgarden->post('v2/frontend/me', $optionalPostParamsAsArray);
// make the api call, put
$response = $softgarden->put('v2/frontend/me', $optionalPostParamsAsArray);
// make the api call, delete
$response = $softgarden->delete('v2/frontend/me', $optionalQueryParamsAsArray);
} catch (SoftgardenApiException $e) {
error_log($e);
}
}
测试
目前,由于我们刚开始开发此 SDK,因此没有测试覆盖率。
贡献
目前,尚无外部贡献我们 SDK 的途径。