ncloud-sms
https://sens.apigw.ntruss.com/sms/v2
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 2019-09-25T10:30:14Z
- Build package: io.swagger.codegen.languages.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
run composer require crucifyer/ncloud-sms dev-master
Getting Started
Please follow the installation procedure and then run the following:
<?php
include_once 'vendor/autoload.php';
$config = \Xeno\Ncloud\Sms\Configuration::getDefaultConfiguration();
// https://www.ncloud.com/mypage/manage/authkey
$config->setApiKey('access-key', 'Access Key ID');
$config->setApiKey('secret-key', 'Secret Key');
$apiInstance = new \Xeno\Ncloud\Sms\Service\V2Api(
new \GuzzleHttp\Client(),
$config
);
// https://console.ncloud.com/sens/project sms service id (not secret)
$serviceId = "service id";
try {
$result = $apiInstance->servicesServiceIdMessagesPost($serviceId, new \Xeno\Ncloud\Sms\Model\SmsMessageRequest([
'type' => 'SMS',
'from' => '01044445555',
'content' => 'swagger 테스트',
'messages' => [
['to' => '01077778888']
]
]));
echo $result."\n";
} catch (Exception $e) {
echo $e->getMessage(), PHP_EOL;
}
?>