I'm trying to create an object through back4app
for class sound
the issue which am having that am unable to upload the file.
code used:
import requests
headers = {
"X-Parse-Application-Id": "hidden",
"X-Parse-REST-API-Key": "hidden",
}
data = {
"audio": {
"__type": open("a.mp3", 'rb'),
"name": "a.mp3"
},
"displayText": "test"
}
def main(url):
with requests.Session() as req:
req.headers.update(headers)
r = req.post(url, data=data)
print(r.text)
main("https://parseapi.back4app.com/classes/sounds")
Output:
{"code":111,"error":"schema mismatch for sounds.audio; expected File but got Array"}
You first need to upload the file:
Then create the object: