telstra / messagingapi-sdk-php
此包已被弃用,不再维护。没有建议的替代包。
1.0.6
2018-08-10 06:57 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
README
- API版本:2.2.9
- 包版本:1.0.6
要求
PHP 5.5 及以上
安装与使用
Composer
要使用Composer安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/Telstra/MessagingAPI-SDK-php.git"
}
],
"require": {
"Telstra/MessagingAPI-SDK-php": "*@master"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/vendor/autoload.php');
测试
运行单元测试
composer install
./vendor/bin/phpunit
入门
请遵循 安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new Telstra_Messaging\Api\AuthenticationApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $client_id = 'client_id_example'; // string | $client_secret = 'client_secret_example'; // string | $grant_type = 'client_credentials'; // string | try { $result = $apiInstance->authToken($client_id, $client_secret, $grant_type); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthenticationApi->authToken: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI相对于 https://tapi.telstra.com/v2
类 | 方法 | HTTP请求 | 描述 |
---|---|---|---|
AuthenticationApi | authToken | POST /oauth/token | 生成OAuth2令牌 |
MessagingApi | getMMSStatus | GET /messages/mms/{messageid}/status | 获取MMS状态 |
MessagingApi | getSMSStatus | GET /messages/sms/{messageId}/status | 获取SMS状态 |
MessagingApi | retrieveMMSResponses | GET /messages/mms | 检索MMS响应 |
MessagingApi | retrieveSMSResponses | GET /messages/sms | 检索SMS响应 |
MessagingApi | sendMMS | POST /messages/mms | 发送MMS |
MessagingApi | sendSMS | POST /messages/sms | 发送SMS |
ProvisioningApi | createSubscription | POST /messages/provisioning/subscriptions | 创建订阅 |
ProvisioningApi | deleteSubscription | DELETE /messages/provisioning/subscriptions | 删除订阅 |
ProvisioningApi | getSubscription | GET /messages/provisioning/subscriptions | 获取订阅 |
模型文档
- DeleteNumberRequest
- GetSubscriptionResponse
- InboundPollResponse
- MMSContent
- Message
- MessageSentResponse
- OAuthResponse
- OutboundPollResponse
- ProvisionNumberRequest
- ProvisionNumberResponse
- SendMmsRequest
- SendSMSRequest
- Status
授权文档
auth
- 类型: OAuth
- 流程: application
- 授权URL:
- 作用域:
- NSMS: NSMS