文档中心 > Miravia Open Platform

Miravia - Manage product video

更新时间:2023/01/06 访问次数:604

1. Description

Use these API to upload video content into Miravia through this API and get the corresponding VideoID. After that, user can attach the videoID on CreateProduct or UpdateProduct step when listing products on Miravia.

2. The flow of API calls

  • Step1: Call InitCreateVideo API to initiate a create video task, response the upload ID.
  • Step2: Call UploadVideoBlock API to upload video files.
  • Step3: Call CompleteCreateVideo API to combine the binary blocks uploaded when calling the uploadvideoblock API and generate a complete video.
  • Step4: Call GetVideo API to get video information and video status.


image



2.1 InitCreateVideo

Initiate a create video task, response the upload ID. (Max video size: 100mb)

Example of request

image


Example of response

{
    "upload_id": "ED87222BDC974722BD01E8F22320817D",
    "result_message": "",
    "success": true,
    "result_code": "",
    "code": "0",
    "request_id": "211b500616619108826821976"
}



2.2 UploadVideoBlock

This API is used to upload video files, if the video file is large then it needs to be uploaded in binary chunks.

For example, an 8MB video file needs to be split into chunks of size 3MB, 3MB and 2MB in binary cut, and then requested in three times.

Example of request

image


Example of response

{
    "result_message": "",
    "success": true,
    "result_code": "",
    "e_tag": "61F4949269F20AF4D1025F5825552FC3",
    "code": "0",
    "request_id": "210399f216619109980006389"
}


2.3 CompleteCreateVideo

Calling this API will combine the binary blocks uploaded when calling the uploadvideoblock API and generate a complete video.

Example of request

Note: the value of "partNumber" starts from 1

image


Example of response

{
    "result_message": "",
    "success": true,
    "result_code": "",
    "video_id": "68015",
    "code": "0",
    "request_id": "210399f216619111507216391"
}


2.4 GetVideo

Call this API to get video information and video status.

Note: only when the video status is "audit_success" can it be used when creating or updating products.

Example of request

https://api.miravia.es/rest/media/video/get?videoId=68015&app_key=500460&sign_method=sha256&access_token=5000030*************************1529145eMt4S&timestamp=1661911227092&sign=C4487E3676AAC574D439914D7DA032EACE0626089955E1186841EAE994EBB3C7


Example of response

{
    "cover_url": "https://fb-es.mrvcdn.com/kf/Ed72d9145a56c45668e374567eb5e283df.jpg",
    "video_url": "http://video.mrvcdn.com/psp/20220831/ebc2*************70dd92@@hd.mp4?auth_key=1662170502-0-0-15eb7582f0603c51c0f246e52217536b",
    "result_message": "",
    "success": true,
    "result_code": "",
    "state": "AUDIT_SUCCESS",
    "title": "hello",
    "code": "0",
    "request_id": "210399f216619113028816394"
}

FAQ

关于此文档暂时还没有FAQ
返回
顶部