Imgur

СПЛАЧЕНО
Verified
(Ким) Imgur | Оновлено 7 days ago | Entertainment
Популярність

9.9 / 10

Затримки

1,084ms

Рівень обслуговування

100%

Health Check

N/A

Повернутися до всіх обговорень

Weird response JSON when uploading video

Rapid account: Fullnitrous
fullnitrous
3 years ago

So basically I want to be able to upload videos via the RapidAPI version of the api. When formatting my request in the following fashion:

headers = {
“authorization”: …
“x-rapidapi-key”: …
“x-rapidapi-host”: “imgur-apiv3.p.rapidpai.com
}

url = “https://imgur-apiv3.p.rapidapi.com/3/image

payload = {“type”: “file”}

files = [
(“video”, open(“ball.mp4”, “rb”))
]

resp = requests.request(“POST”, url, headers=headers, data=payload, files = files)

i get this response:

{‘data’: {‘errorCode’: None, ‘ticket’: ‘…’}, ‘success’: True, ‘status’: 200}

now the video has been successfully uploaded to my account but the response does not provide a link to the uploaded video. In comparision: if i were to simply just change the file to a image it would give the link. Also it gives this weird key parameter called ‘ticket’ which i have no idea of what it is. It is never even mentioned once in the documentation of the API. Can somebody help me out?

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення