Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Video On Demand/ API Reference/ Uploads media files/ Obtains authorization for multipart upload

Obtains authorization for multipart upload

Function

When a client requests for creating a media file larger than 20 MB, the media file needs to be uploaded to OBS by part. The client needs to obtain the authorization using this API each time before uploading a file part to OBS.

This API is used to obtain a temporarily authorized URL for initializing a multipart upload, uploading parts, merging parts, listing uploaded parts, and canceling part merging. You need to configure the HTTP request method, request header, and request body by following the OBS API document. Then you can request for the corresponding temporarily authorized URL.

The multipart upload method is the same as that in the OBS API reference, including the HTTP request method, request header, and request body. This API is used to generate a URL with authentication information (sign_str) to replace the URL in the OBS API, so that the user has the temporary permission for uploading files to the bucket of VOD.

When calling the API for obtaining authorization, input bucket, object_key, and http_verb. bucket and object_key are obtained from the target field in the response body returned by the API for Uploading a Media Asset to VOD. http_verb varies depending on the specified operation.

URI

GET /v1.1/{project_id}/asset/authority

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

http_verb

Yes

String

HTTP method for calling the OBS API for multipart upload. For details about the suitable HTTP method, see the OBS API reference.

  • Initializing an upload task: POST

  • Uploading a part: PUT

  • Merging parts: POST

  • Canceling a part: DELETE

  • Listing uploaded parts: GET

bucket

Yes

String

Bucket name

Value of bucket obtained in the target field in the response body returned by the API for Uploading Media Files to VOD.

object_key

Yes

String

Object name

Value of object obtained in the target field in the response body returned by the API for Uploading Media Files to VOD.

content_type

No

String

Content type corresponding to the file type. This parameter is mandatory for upload task initialization.

For details about how to set parameters, see Uploading a Media File Greater Than 20 MB by Part.

  • Video file: video/Video format, for example, video/mp4

  • Audio file: audio/Audio format, for example, audio/mp3

  • Image file: image/Image format, for example, image/png

  • Subtitle file: application/octet-stream

content_md5

No

String

MD5 value of each uploaded part

upload_id

No

String

ID of each upload task, which is returned after OBS initializes the multipart upload task. This field is mandatory except in the upload task initialization scenario.

part_number

No

Integer

ID of each uploaded part

Value range: 1–10,000

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

sign_str

String

Signed URL. For details about the API calling example, see Example 2: Uploading a Media File More Than 20 MB by Part.Example: https://{obs_domain}/{bucket}?AWSAccessKeyId={AccessKeyID}&Expires={ExpiresValue}&Signature={Signature}

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

  • Initializes an upload task

    GET https://{endpoint}/v1.1/{project_id}/asset/authority?http_verb=POST&content_type={type}&bucket={bucket}&object_key={objectKey}
  • Uploads a part

    GET https://{endpoint}/v1.1/{project_id}/asset/authority?http_verb=PUT&content_md5={md5}&part_number={num}&upload_id={id}&bucket={bucket}&object_key={objectKey}
  • Merges parts

    GET https://{endpoint}/v1.1/{project_id}/asset/authority?http_verb=POST&upload_id={id}&bucket={bucket}&object_key={objectKey}
  • Cancels a part

    GET https://{endpoint}/v1.1/{project_id}/asset/authority?http_verb=DELETE&bucket={bucket}&object_key={objectKey}&upload_id={uploadId}
  • Lists uploaded parts

    GET https://{endpoint}/v1.1/{project_id}/asset/authority?http_verb=GET&bucket={bucket}&object_key={objectKey}&upload_id={uploadId}

Example Responses

Status code: 200

The information is returned when the request succeeds.

{
  "sign_str" : "https://obs.cn-north-4.myhuaweicloud.com:443/obs-vod-1/%7Bproject_id%7D/f488337c31c8e4622f1590735b134c65/Avatar_480P.mp4?AWSAccessKeyId=CBN2J**********0RCSN&Expires=1518147618&Signature=kZYh0hEos2V**********AHGyXA%3D"
}

Status code: 403

The information is returned when the request fails.

{
  "error_code" : "VOD.10053",
  "error_msg" : "The request parameter is illegal, illegal field: {xx}."
}

Status Codes

Status Code

Description

200

The information is returned when the request succeeds.

403

The information is returned when the request fails.

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback