this is my python code
import base64
import requests
import json
token_url = ‘http://159.89.172.189/api/authorize/access_token’
library = ‘http://159.89.172.189/api/library’
main_url = ‘http://159.89.172.189/api/user’
client_id = ‘DPVW8hUHlFMullOM4YVmurdBKfVZKZHtshqEuqlk’
client_secret = ‘hKblJgU7OWoqKfuZ34lJRCoTk7OWqmaBNmiKIHfCbiKPa31kaJcNxnpAIxH0NrhiHkcHYJpRT8orR3MhzMWFRxl1bUycas5S5MEo4GeowlUIifZ3ofC01omDPaYwII9NlbNwLgxzaIszHxUt5DKrSuV1dCldFPUEdzqwb9Gg0gtkDGAkn4UoIde5rzRzOnif6jImpttO9A3kblRIskyhYHEteQdcn7SkwJ2eXJZiXyUJsaK4WHJVfkLWU32R4K’
data = {‘grant_type’:‘client_credentials’}
access_token_response = requests.post(token_url,data=data,verify=False,allow_redirects=False,auth=(client_id, client_secret))
tokens = json.loads(access_token_response.text)
##print(access_token_response.text)
print("Bearer " + tokens[‘access_token’])
querystring = {‘media’:‘CTV_Sendung’}
headers = {‘Authorization’: "Bearer " + tokens[‘access_token’],‘Cache-Control’:‘no-cache’,‘content-type’: ‘multipart/form-data’}
payload = {‘Content-Disposition’: ‘form-data’,‘name’:‘files’,‘filename’:“https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Hyderabadi_Chicken_Biryani.jpg”,}
data = json.dumps(payload)
response = requests.request(‘POST’,library,data=data,headers=headers)
print(response.text)
i’m getting this error with xibo upload api
“files”:[{“name”:“1492523640-7615”,“size”:1316610,“type”:“multipart/form-data; boundary=--------------------------449316675376425057078541”,“error”:“Filetype not allowed”}]}