作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 boto3 向我发送带有精确定位的消息,但是 update_endpoint 和 send_messages 的函数一直返回找不到资源
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'}}})
返回给我的错误是:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Applications/MAMP/htdocs/enviroment/kleanapp/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Applications/MAMP/htdocs/enviroment/kleanapp/lib/python3.7/site-packages/botocore/client.py", line 661, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.NotFoundException: An error occurred (NotFoundException) when calling the SendMessages operation: Resource not found
提前感谢您的帮助
最佳答案
您不需要端点来发送消息。只需删除 update_endpoint
行即可。
NotFoundException 可能来自未找到的应用程序 ID。请确保您在正确的区域指定正确的应用程序 ID 值。
您可以使用以下命令找到特定区域的有效应用程序列表及其 ID:
aws --region us-east-1 pinpoint get-apps
关于python - 如何在 amazon pinpoint 中创建端点和发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55821198/
我是一名优秀的程序员,十分优秀!