aws sdk sesv2 ListContactsAsync problem in C#

35 Views Asked by At

Can anyone confirm that this works for them in C#? I'm using v2 of ses and trying to get the list of contacts. I don't have any problem getting an individual contact and I definitely have my IAM user setup with SES:ListContacts permissions. The keys work for sendmail and getcontact but not for listcontacts. ListContacts works with the same user and credentials when I do it through the AWS CLI.

var client = new AmazonSimpleEmailServiceV2Client("ID", "SECRET_KEY");

/* works
var cRequest = new GetContactRequest();
cRequest.ContactListName = "fmContacts";
cRequest.EmailAddress = "[email protected]";
GetContactResponse response = await client.GetContactAsync(cRequest);

Console.Write(response.EmailAddress);
*/

// fails with 
var cRequest = new ListContactsRequest();
cRequest.ContactListName = "fmContacts";

ListContactsResponse response = await client.ListContactsAsync(cRequest);

Console.Write(response.Contacts);

Amazon.SimpleEmailV2.AmazonSimpleEmailServiceV2Exception: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.'

0

There are 0 best solutions below