No Description

sms_query_single_template.php 633B

123456789101112131415161718192021222324252627
  1. <?php
  2. require_once __DIR__ . '/../../autoload.php';
  3. use Qiniu\Auth;
  4. use Qiniu\Sms\Sms;
  5. // 控制台获取密钥:https://portal.qiniu.com/user/key
  6. $accessKey = getenv('QINIU_ACCESS_KEY');
  7. $secretKey = getenv('QINIU_SECRET_KEY');
  8. $auth = new Auth($accessKey, $secretKey);
  9. $client = new Sms($auth);
  10. // 查询单个模板
  11. // 参考文档:https://developer.qiniu.com/sms/api/5969/query-a-single-template
  12. // 模板 ID
  13. $template_id = 'xxxxxx';
  14. list($ret, $err) = $client->querySingleTemplate($template_id);
  15. echo "\n====> query single template result: \n";
  16. if ($err !== null) {
  17. var_dump($err);
  18. } else {
  19. var_dump($ret);
  20. }