- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetContactCommand
Returns a contact from a contact list.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SESv2Client, GetContactCommand } from "@aws-sdk/client-sesv2"; // ES Modules import
// const { SESv2Client, GetContactCommand } = require("@aws-sdk/client-sesv2"); // CommonJS import
const client = new SESv2Client(config);
const input = { // GetContactRequest
ContactListName: "STRING_VALUE", // required
EmailAddress: "STRING_VALUE", // required
};
const command = new GetContactCommand(input);
const response = await client.send(command);
// { // GetContactResponse
// ContactListName: "STRING_VALUE",
// EmailAddress: "STRING_VALUE",
// TopicPreferences: [ // TopicPreferenceList
// { // TopicPreference
// TopicName: "STRING_VALUE", // required
// SubscriptionStatus: "OPT_IN" || "OPT_OUT", // required
// },
// ],
// TopicDefaultPreferences: [
// {
// TopicName: "STRING_VALUE", // required
// SubscriptionStatus: "OPT_IN" || "OPT_OUT", // required
// },
// ],
// UnsubscribeAll: true || false,
// AttributesData: "STRING_VALUE",
// CreatedTimestamp: new Date("TIMESTAMP"),
// LastUpdatedTimestamp: new Date("TIMESTAMP"),
// };
GetContactCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ContactListName Required | string | undefined | The name of the contact list to which the contact belongs. |
EmailAddress Required | string | undefined | The contact's email address. |
GetContactCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
AttributesData | string | undefined | The attribute data attached to a contact. |
ContactListName | string | undefined | The name of the contact list to which the contact belongs. |
CreatedTimestamp | Date | undefined | A timestamp noting when the contact was created. |
EmailAddress | string | undefined | The contact's email address. |
LastUpdatedTimestamp | Date | undefined | A timestamp noting the last time the contact's information was updated. |
TopicDefaultPreferences | TopicPreference[] | undefined | The default topic preferences applied to the contact. |
TopicPreferences | TopicPreference[] | undefined | The contact's preference for being opted-in to or opted-out of a topic. |
UnsubscribeAll | boolean | undefined | A boolean value status noting if the contact is unsubscribed from all contact list topics. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | The input you provided is invalid. |
NotFoundException | client | The resource you attempted to access doesn't exist. |
TooManyRequestsException | client | Too many requests have been made to the operation. |
SESv2ServiceException | Base exception class for all service exceptions from SESv2 service. |