Amazon Simple Storage Service
Developer Guide (API Version 2006-03-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Making Requests Using AWS Account or IAM User Credentials - AWS SDK for PHP

The following tasks guide you through using the PHP classes to send authenticated requests using your AWS account or IAM user credentials.

Making Requests Using Your AWS Account or IAM user Credentials

1

Create an instance of the AmazonS3 class by providing your AWS Account or IAM user credentials.

2

Execute one of the AmazonS3 methods to send requests to Amazon S3. The client API generates the necessary signature from your credentials and include it in the request it sends to Amazon S3.


The following PHP code sample demonstrates the preceding tasks and illustrate how the AmazonS3 client sends a request to list all object keys in a bucket.

// Instantiate the class.
$s3 = new AmazonS3();
// Use the high-level API.
$response = $s3->get_object_list($bucket);

[Note]Note

You can create the AmazonS3 client without providing your security credentials. Requests sent using this client are anonymous requests, without a signature. Amazon S3 returns an error if you send anonymous requests for a resource that is not publicly available.

For working examples, see Working with Amazon S3 Objects and Working with Amazon S3 Buckets. You can test these examples using your AWS Account or IAM user credentials.

For example, to list all the object keys in your bucket, see Listing Keys Using the AWS SDK for PHP.