- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Yes, it is possible to send a direct message through Amazon Pinpoint without creating a campaign. You can use the SendMessages operation of the Amazon Pinpoint API to send a direct message to a specific channel or address, such as a phone number or email address.
To use the SendMessages operation, you will need to provide the following parameters:
ApplicationId: The unique identifier for the application to which you want to send the message.
MessageRequest: An object that contains the message and the addresses or channels to which you want to send the message. The MessageRequest object has the following fields:
Addresses: A map of address or channel to MessageConfiguration objects. The MessageConfiguration object contains the message and any other settings for the message, such as the message title and content, the sender ID, and any custom data that you want to include in the message.Context: A map of custom data that you want to include in the message.
Here is an example of how you could use the SendMessages operation to send a direct message through Amazon Pinpoint:
import boto3
client = boto3.client('pinpoint')
response = client.send_messages( ApplicationId='YOUR_APPLICATION_ID', MessageRequest={ 'Addresses': { 'YOUR_CHANNEL_OR_ADDRESS': { 'ChannelType': 'YOUR_CHANNEL_TYPE', 'MessageConfiguration': { 'SimpleMessage': { 'Body': 'YOUR_MESSAGE_BODY', 'Title': 'YOUR_MESSAGE_TITLE' } } } }, 'Context': { 'custom-key': 'custom-value' } } ) Replace YOUR_APPLICATION_ID, YOUR_CHANNEL_OR_ADDRESS, YOUR_CHANNEL_TYPE, YOUR_MESSAGE_BODY, and YOUR_MESSAGE_TITLE with the appropriate values for your message.
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata un anno fa
Hi Seansi, Thanks for the reply. For Email and SMS, It is possible to send a direct message through Amazon Pinpoint without creating a campaign(I'm done with the Email and SMS part using kotlin). But my question is for sending a slack message (custom channel) is it possible to send without creating a campaign?