如何在amazon Pinpin中创建端点和发送消息

2024-06-11 08:54:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图使用boto3发送pinpoint到的消息,但是update_endpoint和send_messages的函数会使return me资源找不到

client = boto3.client('pinpoint', region_name="us-east-1", aws_access_key_id="xxx", aws_secret_access_key="xxx")

client.update_endpoint(ApplicationId="xxx",EndpointId='+573163781068',EndpointRequest={'Address': '+573163781068','ChannelType': 'SMS','Location': {'Country': 'CO'}})

client.send_messages(ApplicationId="xxx", MessageRequest={'Addresses': {'+573163781068': {'ChannelType': 'SMS'}}, 'MessageConfiguration': {'SMSMessage': {'Body': 'hola desde libreria', 'MessageType': 'TRANSACTIONAL'}}})

返回给我的错误是:

^{pr2}$

提前谢谢你的帮助


Tags: keyclientawssendaccessupdateboto3sms
1条回答
网友
1楼 · 发布于 2024-06-11 08:54:38

不需要发送消息。只需删除update_endpoint行。在

NotFoundException可能来自找不到的应用程序ID。请确保在正确的区域中指定了正确的应用程序ID值。在

您可以使用以下命令查找特定区域的有效应用程序及其ID的列表:

aws  region us-east-1 pinpoint get-apps

相关问题 更多 >