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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南