https://github.com/yunpian/yunpian-php-sdk
The https://www.yunpian.com php sdk.
https://github.com/yunpian/yunpian-php-sdk
php-sdk
Last synced: 5 months ago
JSON representation
The https://www.yunpian.com php sdk.
- Host: GitHub
- URL: https://github.com/yunpian/yunpian-php-sdk
- Owner: yunpian
- License: mit
- Created: 2016-04-09T08:56:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-15T05:34:20.000Z (over 4 years ago)
- Last Synced: 2025-10-19T07:55:44.825Z (8 months ago)
- Topics: php-sdk
- Language: PHP
- Size: 119 KB
- Stars: 69
- Watchers: 15
- Forks: 23
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
yunpian-php-sdk
================================
[云片](https://www.yunpian.com/) SDK
## 快速开始
- 添加composer依赖
```json
"require": {
"yunpian/yunpian-php-sdk" : "~1.0"
}
```
**注**: master是最新稳定版。我们会更新到[Packagist](https://packagist.org/explore/)
- 使用YunpianClient
```php
use \Yunpian\Sdk\YunpianClient;
//初始化client,apikey作为所有请求的默认值
$clnt = YunpianClient::create($apikey);
$param = [YunpianClient::MOBILE => '18616020000',YunpianClient::TEXT => '【云片网】您的验证码是1234'];
$r = $clnt->sms()->single_send($param);
//var_dump($r);
if($r->isSucc()){
//$r->data()
}
//账户$clnt->user() 签名$clnt->sign() 模版$clnt->tpl() 短信$clnt->sms() 语音$clnt->voice() 流量$clnt->flow() 视频短信$clnt->vsms()
```
**注**: v1.0开始使用composer管理工程。不兼容之前版本,若需要可从github下载[0.0.1](https://github.com/yunpian/yunpian-php-sdk/releases/tag/0.0.1)
## 配置说明 (默认配置就行)
- 默认配置文件 src/yunpian.ini
- 构造器配置
- `YunpianClient::create($apikey);`
- `YunpianClient::create($apikey,$conf);`
- apikey的优先级 函数的$param[YunpianConstant::APIKEY] > 构造器的$apikey > 构造器的$conf[YunpianConstant::YP_APIKEY] > yunpian.ini
## 源码说明 yunpian-php-sdk
- 工程使用composer构造,php5.6 or higher
- 开发API可参考单元测试 tests/Api
- 执行单元测试 `phpunit tests`,安装[phpunit](https://phpunit.de/manual/5.7/en/installation.html)
## 视频教程
[使用视频教程](https://deqing.b0.upaiyun.com/yunpian/video/yunpiannbhd.mp4)
## 联系我们
[云片支持 QQ](https://static.meiqia.com/dist/standalone.html?eid=30951&groupid=0d20ab23ab4702939552b3f81978012f&metadata={"name":"github"})
SDK开源QQ群

## 文档链接
- [api文档](https://www.yunpian.com/dev-doc)