edit-icon download-icon

Samples

Last Updated: Jul 03, 2017
  1. <?php
  2. include_once 'aliyun-php-sdk-core/Config.php';
  3. use Ram\Request\V20150501 as Ram;
  4. // Construct an Aliyun Client for initiating a request
  5. // Set AccessKeyID and AccessKeySevcret when constructing the Aliyun Client
  6. // RAM is a Global Service, and its API ingress is located in the East China 1 (Hangzhou) region. Enter "cn-hangzhou" in "Region"
  7. $iClientProfile = DefaultProfile::getProfile("cn-hangzhou", "<acccess-key-id>", "<access-key-secret>");
  8. $client = new DefaultAcsClient($iClientProfile);
  9. // Construct a "CreateUser" request
  10. $request = new Ram\CreateUserRequest();
  11. //Set the parameter - UserName
  12. $request->setUserName("alice");
  13. // Initiate a request and obtain the response
  14. $response = $client->doAction($request);
  15. print_r("\r\n");
  16. print_r($response);
  17. ?>
Thank you! We've received your feedback.