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?

질문됨 일 년 전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
답변함 일 년 전
  • 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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠