I get an error when I try to send a message in Python. What could be the reason?
import requests, json
def sendMessage(keyAPI, chatID, keySESSION, message):
data = {
"message_type": "MESG",
"user_id": "1",
"message": message
}
response = requests.post(f"https://api-{keyAPI}.sendbird.com/v3/group_channels/{chatID}/messages", headers = {"session-key": keySESSION}, data = json.dumps(data))
print(response.text)
{"message":"Invalid value: \"JSON body.\".","code":400403,"error":true}