Aly.php 1002 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use AlibabaCloud\Client\AlibabaCloud;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use AlibabaCloud\Client\Exception\ServerException;
  5. use AlibabaCloud\SDK\Cloudauth\V20190307\Cloudauth;
  6. // Download:https://github.com/aliyun/openapi-sdk-php
  7. // Usage:https://github.com/aliyun/openapi-sdk-php
  8. AlibabaCloud::accessKeyClient('LTAI5tAVV4VEU4vFVqpune1Q', 'IMRENgb7kQsjLXfJ33aCyeTLeNj9DH')
  9. ->regionId('cn-hangzhou')
  10. ->asDefaultClient()->options([]);
  11. try {
  12. $request = Cloudauth::v20190307()->initFaceVerify();
  13. $result = $request
  14. ->debug(true) // Enable the debug will output detailed information
  15. ->request();
  16. print_r($result->toArray());
  17. } catch (ClientException $exception) {
  18. echo $exception->getMessage() . PHP_EOL;
  19. } catch (ServerException $exception) {
  20. echo $exception->getMessage() . PHP_EOL;
  21. echo $exception->getErrorCode() . PHP_EOL;
  22. echo $exception->getRequestId() . PHP_EOL;
  23. echo $exception->getErrorMessage() . PHP_EOL;
  24. }