sms_edit_signature.php 923 B

123456789101112131415161718192021222324252627282930
  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/5890/sms-api-edit-signature
  12. // 签名审核标准:https://developer.qiniu.com/sms/manual/5816/signature-specification
  13. $id = 'xxxxxx'; // 签名 ID
  14. $signature = 'xxxx'; // 签名
  15. $source = 'website'; // 签名来源,申请签名时必须指定签名来源
  16. $pics = '../php-logo.png'; // 签名对应的资质证明图片
  17. list($ret, $err) = $client->updateSignature($id, $signature, $source, $pics);
  18. echo "\n====> edit signature result: \n";
  19. if ($err !== null) {
  20. var_dump($err);
  21. } else {
  22. echo "\n====> Update Signature Successfully\n";
  23. }