I am using the Java SDK 2 (version 2.17.51), and when attempting a simple listContacts
request, I get the following:
software.amazon.awssdk.services.sesv2.model.SesV2Exception:
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.
This same key works fine when calling getContact
, and is also used with other modules (e.g. S3) without problems, and the associated user has "Full Access" for SES. If I just remove the credentials, I get a different error (software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers
) so finding the credentials doesn't seem to be the issue.
EDIT: adding the code (Scala)
val client = sesv2.SesV2Client.builder()
.region(Region.US_EAST_1)
.build()
val topic =
TopicFilter.builder()
.topicName("mytopic")
.build()
val filter =
ListContactsFilter.builder()
.topicFilter(topic)
.build()
val request =
ListContactsRequest.builder()
.contactListName("mylist")
.pageSize(10000)
.filter(filter)
.build()
val contacts = client.listContacts(request).contacts