Send Message to a Pinpoint Custom Channel

0

I need to send the slack message using a custom channel in AWS Pinpoint without creating a campaign. Is it possible to send a direct message without creating a campaign?

asked a year ago385 views
1 Answer
1

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.

SeanSi
answered a year ago
  • 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?

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