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?

已提问 1 年前399 查看次数
1 回答
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
已回答 1 年前
  • 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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则