Chuyển tới nội dung chính

v2.media.init_video_upload

POST /api/v2/media/init_video_upload

Dùng API này để khởi tạo một tác vụ tải video mới và nhận ID phiên tải lên duy nhất.

Đường dẫn Endpoint

URL: https://partner.shopeemobile.com/api/v2/media/init_video_upload

Tham số chung

TênKiểuMẫuMô tả
partner_idint1ID đối tác được cấp sau khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu.
timestamptimestamp1610000000Dùng để xác định thời điểm của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút.
signstringe318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2Signature generated by partner_id, api path, timestamp and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2

Tham số Request

TênKiểuBắt buộcMẫuMô tả
businessint32True3Xác định loại nghiệp vụ của video tải lên. Các giá trị hỗ trợ: 3 = Video
sceneint32True1Defines the purpose of the uploaded image under the specified business type. Supported values: - If business = 3 (Video): 1 = Shopee Video
file_namestringTruetest_video_name.mp4Tên tệp video gốc.
file_sizeint64True26214400Total video file size in bytes. Rules and restrictions by business and scene: - If business = 3 (Video) and scene = 1 (Shopee Video): Maximum 1GB.
durationint32True105Thời lượng video tính bằng giây. Rules and restrictions by business and scene: - If business = 3 (Video) and scene = 1 (Shopee Video): 1s~180s.

Tham số Response

TênKiểuMẫuMô tả
errorstringCho biết loại lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi.
messagestringCho biết chi tiết lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi.
warningstringThông báo cảnh báo bạn cần lưu ý.
request_idstringe3e3e7f33ee88a7454c64e7a0b546e01Mã định danh cho yêu cầu API, dùng để theo dõi lỗi.
responseobject
video_upload_idstringsg-11110201-6kh48-mepm7a0ttcw3c3ID phiên tải lên duy nhất.
part_sizeint6410485760Kích thước mỗi phần. Khi tải video theo từng phần, video phải được chia theo kích thước phần này cho mỗi yêu cầu tải.