1
votes

I want to access the AWS SES Webservice to programmatically add new verified Email identities. The API reference does not give the relevant information or at least I can't find it there.

When I try to access the api I get an error due to the missing signature.

https://email.us-east-1.amazonaws.com?AWSAccessKeyId=EXAMPLEKeyId&Action=VerifyEmailIdentity&[email protected]&Timestamp=2013-04-27T19:30:00Z&Version=2010-12-01&Signature=

How do I create this signature exactly, for example using php's hash_hmac()?

Do I need to hash the entire parameters using the SES secret key?

Is there a newer version of the SES API than the one documented (2010-12-01)?

1

1 Answers

9
votes

You should really go through the documentation (again).

Take a look at the AWS PHP SDK which would help you a lot.
A sample implementation would be something like:

<?php
require 'aws.phar';

use Aws\Common\Enum\Region;
use Aws\Ses\SesClient;


try {   
$ses = SesClient::factory(array(
  'key'    => 'YOUR_KEY',
  'secret' => 'YOUR_SECRET',
  'region' => Region::US_EAST_1
));


$ses->verifyEmailIdentity( array(
    'EmailAddress' => '[email protected]'
));

}
catch( Exception $e )
{
    echo $e->getMessage();
}