Discussions
Asset Upload Issue
4 months ago by Anubhav Sharma
Hello! I'm experiencing an issue with file uploads through the HeyGen API. When I try to upload an image file, I get the error "asset data must be provided".
Details:
- Endpoint: https://upload.heygen.com/v1/asset
- Method: POST
- Headers: X-Api-Key, Content-Type: multipart/form-data
Result:
All attempts return a 400 BAD REQUEST error with the message:
{"code":40001,"message":"asset data must be provided"}
Payload and I am connecting:
files = {"file": (os.path.basename(image_path), f, mime_type)}
have also run
files = {"content": (os.path.basename(image_path), f, mime_type)}