Amazon SES – Working With Request ID

While upgrading our AWS SDK from version 1 to version 2, I faced a strange issue which kept me struggling for a day. The article is specifically for Amazon SES developers who are upgrading from AWS SDK version 1 to version 2.

If you are beginner with Amazon Web Service you can get started with below articles.

Importance of Amazon SES Request ID

  • It’s useful for logging and debugging purpose. For each email sent through Amazon SES api, unique request ID is generated.
  • For a specific email related issue like why the email wen’t to spam. While communicating with Amazon SES support they ask for either message ID or request ID for debugging.
  • We were storing request ID in our email sending logs table. So it was important for us to retrieve request ID.


Ruby language is used for all the sample code.

What is Amazon SES Request ID Issue?

I was upgrading AWS SDK stack from version 1.42.0 to version 2.1.32. In the response structure after sending email in Amazon SES version 1 both message id as well as request id was returned. However in version 2 only message id was present in response. Question was how to get request id after sending email in version2.

AWS SDK Sending Email Version 1 Sample Code

AWS SDK Sending Email Version 2 Sample Code

After reading Amazon SES version 2 docs, I was able to write wrapper quickly for sending email. Below is the sample code:

However there was 1 issue. When you try to print request ID, It throws error saying there is no such method called request_id.

This was strange for us since we needed to store request ID for every email sent in email send logs table.

Getting Request ID in Version2

Struggling with this, I reported the issue on AWS SDK github repository. Below is the link:

Got the answer in couple of hours which saved lot of my time. Below is the correct way to retrieve Amazon SES request ID in AWS SDK version 2.

We concluded that from Ruby SDK version 1 to version 2 there was a total rewrite. As a result the request ID is not part of the same return object anymore. The request ID is now part of the AWS connection object, instead of the SES client object.

Thanks for reading my article. If you are interested in AWS big data services, I recommend reading below articles:

If you like my article please like our Facebook page and also follow us on Twitter so that you get regular updates. For regular updates you can also subscribe to

Please also share on Facebook and Twitter to help others.