By using AWS re:Post, you agree to the Terms of Use

PHP listSuppressedDestinations > Uncaught InvalidArgumentException: Operation not found:

0

Hi i'm trying to the the account Suppressed list with the api. But run into this error:

PHP Fatal error: Uncaught InvalidArgumentException: Operation not found: ListSuppressedDestinations in ..../web/sdk/vendor/aws/aws-sdk-php/src/AwsClient.php:261 Stack trace: #0 ..../web/sdk/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(86): Aws\AwsClient->getCommand('ListSuppressedD...', Array) #1 ..../test.php(18): Aws\AwsClient->__call('listSuppressedD...', Array) #2 {main} thrown in .../web/sdk/vendor/aws/aws-sdk-php/src/AwsClient.php on line 261 Fatal error: Uncaught InvalidArgumentException: Operation not found: ListSuppressedDestinations in ..../web/sdk/vendor/aws/aws-sdk-php/src/AwsClient.php:261 Stack trace: #0 ..../web/sdk/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(86): Aws\AwsClient->getCommand('ListSuppressedD...', Array) #1 ..../test.php(18): Aws\AwsClient->__call('listSuppressedD...', Array) #2 {main} thrown in ...../web/sdk/vendor/aws/aws-sdk-php/src/AwsClient.php on line 261

This is the code u use:

require_once($Path.'/sdk/vendor/autoload.php');

use Aws\S3\S3Client;
use Aws\Exception\AwsException;
$aws_api = new Aws\Ses\SesClient([
    'profile' => 'amazon',
    'region' => 'eu-west-1',
    'version' => 'latest'
]);
print_r( $aws_api->listSuppressedDestinations([  'EndDate' => time(), 'StartDate' => 1609455600 ]));

When i get 'ListIdentities' it all works fine. anyone know how to fix this?

1 Answers
0

Hello,

The listSuppressedDestinations() function is only available in the SesV2Client Client for the AWS PHP SDK.

Try switching Aws\Ses\SesClient to Aws\SesV2\SesV2Client and this should work fine.

Relevant documentation - https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sesv2-2019-09-27.html

profile picture
MODERATOR
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions