I receive an invalid parameter error message in Amazon Simple Notification Service (Amazon SNS) when I make API calls.
Resolution
Platform credential errors
"InvalidParameter - Error message: Invalid parameter: Attributes Reason: Platform credentials are invalid"
Prerequisite: Check the provider certificate type in your Apple Developer account and download the certificate.
To resolve a platform credential error, complete the following steps:
- Open the Amazon SNS console.
- In the navigation pane, choose Push notifications.
- Choose Create platform application.
- For Application name, enter a name for your application.
- For Push notification platform, choose Apple iOS/VoIP/Mac.
- For only the Sandbox certificate type, in the Apple Credentials section, select Used for development in sandbox.
Important: If you use the Sandbox & Production certificate type, then don't select Used for development in sandbox. Otherwise, you receive an error.
- For Push certificate type, select your certificate type.
- Choose Choose file, and then select the certificate that you want to load credentials from.
- Choose Create platform application.
FIFO errors
"message: Invalid parameter: The MessageGroupId parameter is required for FIFO topics"
You might see the preceding error even when you provide the MessageID. Verify that you use the AWS SDK for JavaScript in the browser or AWS SDK for JavaScript in Node.js version 2.777.0 or later.
You might receive Amazon SNS FIFO errors for an invalid MessageGroupId or MessageDeduplicationId even though you provided the IDs in the API request. Amazon SNS FIFO attributes are available only for newer SDK versions. For more information, see Changelog for AWS SDK for JavaScript on the GitHub website.
Text messaging (SMS) errors
"Couldn't set text messaging attributes. Error code: InvalidParameter - Error message: Invalid parameter:"
To resolve the text messaging error, complete the following steps:
- Open the Amazon SNS console.
- In the navigation pane, choose Text messaging (SMS).
- For Text messaging preferences, choose Edit.
- For Account spend limit - Optional Parameter, enter the numeric value 1.
Note: By default, every Amazon SNS account has a monthly spend quota of $1 in every AWS Region. When you exceed the default value, you receive an error. To increase the account monthly spend quota, request an account spend quota increase.
- Choose Save changes.
If the destination country requires a dedicated long code, short code, or SenderID, then use the code after you register. For more information, see Supported countries and regions for SMS messaging with AWS End User Messaging SMS.
Note: A registered Origination identity or Sender ID is country specific. To use an Origination Number or SenderID for other countries, you must separately register the Origination Number or SenderID for each additional destination country. For more information, see Choosing a phone number or sender ID for AWS End User Messaging SMS.
Subscription delete errors
"Couldn't delete subscription.Error code: InvalidParameter - Error message: Invalid parameter: SubscriptionArn Reason: An ARN must have at least 6 elements, not 1"
PendingConfirmation status
You might receive an error when you try to remove a subscription that's in PendingConfirmation status. When you use the Unsubscribe API to delete a subscription, the API call requires the SubscriptionARN. If you use the Amazon SNS console to delete the subscription, then Amazon SNS automatically selects the SubscriptionARN.
For a subscription that's in the PendingSubscription status, the console doesn't show SubscriptionId. As a result, the console uses the PendingConfirmation as a SubscriptionId. Then, the API call fails and returns an error.
To resolve a subscription that's in the Pending confirmation status, complete the following steps:
-
Open the Amazon SNS console.
-
In the navigation pane, choose Topics, and then choose your topic.
-
Select the topic with the subscription that's in the Pending confirmation status and the subscription that's in the Pending confirmation status.
-
Choose Request confirmation. A subscribe notification is sent to the endpoint to confirm the subscription. The notification includes a link that's similar to the following example:
https://sns.us-east-1.amazonaws.com/confirmation.html?TopicArn=arn:aws:sns:your-aws-region:your-account-number:your-topic-name&Token=your-token&Endpoint=your-endpoint
-
In the navigation pane, choose Subscriptions, and then select your subscription.
-
Choose Confirm subscription.
-
Enter the subscribe URL from the subscribe notification into the dialog box, and then choose Confirm subscription.
-
Select your subscription, and then choose Delete.
Or, wait the default 3 days for Amazon SNS to remove the subscription that's in the PendingConfirmation status.
Deleted status
You might receive an error for a subscription that has the Deleted status.
Check the endpoint where you chose the unsubscribe link. After you unsubscribe from the subscription, the endpoint receives another notification that's similar to the following:
"Your subscription to the topic below has been deactivated:arn:aws:sns:Your-AWS-Region:Your-Account-Number:Your-Topic-Name
If this was in error or you wish to resubscribe, click or visit the link below:
Resubscribe
Please click on the resubscribe link present in the notification. This will confirm the subscription. On success, please select the specific subscription and click on Delete button."