1 Answer
- Newest
- Most votes
- Most comments
0
Looking at the code you provided, it looks like you are missing a closing single quotation mark in the json.dumps line. The 'value should be 'value'. This might be causing the error you're experiencing.
import json
response = client.send_message(
ContentType='application/json',
Content=json.dumps({'key': 'value'}),
ConnectionToken=connection_token
)
answered a year ago
Relevant content
- asked 6 years ago
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Thanks for your quick answer, but sadly this was just a typo from copying over my code. An invalid JSON actually produces another error: An error occurred (InvalidRequestException) when calling the SendMessage operation: Message content is not a valid JSON.