Add category file

Prev Next

Available in Classic and VPC

Add an encoding file to a category.

Request

This section describes the request format. The method and URI are as follows:

Method URI
PUT /api/v2/category/{categoryId}/add-files

Request headers

For information about the headers common to all VOD Station APIs, see VOD Station request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
categoryId String Required Category ID

Request body

You can include the following data in the body of your request:

Field Type Required Description
bucketName String Conditional Name of the bucket where the input file is stored
  • Required if pathList is set
  • Can't be used with httpDownloadURL.
  • Required if httpDownloadURL is not used
pathList Array Conditional Detailed path to the bucket for the input file, including file name
  • Enter 100 or less.
  • Required if bucketName is set
  • Can't be used with httpDownloadURL.
  • Required when not using bucketName and pathList
httpDownloadUrlList Array Conditional HTTP URL path to the input file, including file name
  • Enter 100 or less in HTTP URL format.
  • Can't be used with bucketName and pathList.
  • Available extensions: AVI, MOV, MP4, MP3, 3GP, MPG, MPEG, M4V, VOB, WMV, ASF, MKV, FLV, WEBM, GIF, AV1, MXF
  • If the output file has a private visibility, it may not be accessible.
notification String Optional Callback URL settings for the input file
  • It overrides the category's callback settings only for encoding files that you add during setup.
output Object Optional Output settings for the input file
output.bucketName String Required Bucket name to save the output file
output.filePath String Required Detailed path to save the output file
  • Enter 1 to 256 characters, including English letters, numbers, and special characters.
  • Special characters "<, >, :, ", /, \, ?, *, %" can't be used.
output.thumbnailBucketName String Optional Name of bucket to store thumbnail extract files in
  • If not entered, the output.bucketName setting is followed.
output.thumbnailFilePath String Optional Detailed path to store thumbnail extract files to
  • If not entered, the output.filePath setting is followed.
output.accessControl String Optional Output file disclosure scope
  • PUBLIC_READ | PRIVATE (default)
    • PUBLIC_READ: Public
    • PRIVATE: Private
output.thumbnailAccessControl String Optional Extracted thumbnail disclosure scope
  • PUBLIC_READ | PRIVATE (default)
    • PUBLIC_READ: Public read
    • PRIVATE: Private
output.withoutCategoryName Boolean Optional Whether to create a category name directory in the storage path
  • true | false (default)
    • true: Create
    • false: Not create
setAdvancedOptions Boolean Optional Advanced settings
  • true | false (default)
    • true: Enable
    • false: Disable
advancedOptions Object Optional Advanced settings
advancedOptions.trimming Object Optional Output file trimming (playback section) settings
advancedOptions.trimming.startTimeCode String Required Trimming start point (HH:MM:SS.S)
advancedOptions.trimming.endTimeCode String Required Trimming end point (HH:MM:SS.S)
  • Value smaller than advancedOptions.trimming.startTimeCode can't be entered.
advancedOptions.imageOverlay Object Optional Image overlay (insertion) settings
advancedOptions.imageOverlay.input Object Required Image settings
advancedOptions.imageOverlay.input.bucketName String Required Name of the bucket where the image is saved
advancedOptions.imageOverlay.input.filePath String Required Detailed path of the image including the file name
advancedOptions.imageOverlay.position Object Required Image location settings
advancedOptions.imageOverlay.position.x Integer Required Location of x-axis (pixel)
advancedOptions.imageOverlay.position.y Integer Required Location of y-axis (pixel)
advancedOptions.imageOverlay.size Object Required Image size settings
advancedOptions.imageOverlay.size.width Integer Required Image width (pixel)
advancedOptions.imageOverlay.size.height Integer Required Image height (pixel)

Request example

The request example is as follows:

curl --location --request PUT 'https://vodstation.apigw.ntruss.com/api/v2/category/*****/add-files' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--data '{
    "httpDownloadUrlList": [
        "https://kr.object.ncloudstorage.com/station-000-input/VODStation2.mp4"
    ],
    "notification": "https://example.com/callback",
    "output": {
        "bucketName": "station-000",
        "filePath": "/",
        "thumbnailBucketName": "station-000",
        "thumbnailFilePath": "/thumbnail",
        "accessControl": "PUBLIC_READ",
        "thumbnailAccessControl": "PUBLIC_READ",
        "withoutCategoryName": false
    },
    "setAdvancedOptions": true,
    "advancedOptions": {
        "trimming": {
            "startTimeCode": "00:00:00.0",
            "endTimeCode": "00:08:00.9"
        },
        "imageOverlay": {
            "input": {
                "bucketName": "station-000",
                "filePath": "/VODStation.png"
            },
            "position": {
                "x": 50,
                "y": 50
            },
            "size": {
                "width": 50,
                "height": 50
            }
        }
    }
}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
content Array - Result of adding an encoding file to the category: content

content

The following describes content.

Field Type Required Description
id Integer - File encoding job ID
status String - File encoding status
  • COMPLETE | WAITING | RUNNING | FAILURE
    • COMPLETE: Completed
    • WAITING: Pending
    • RUNNING: In progress
    • FAILURE: Failed
    • CANCELED: Canceled
output Object Required Category output settings
output.bucketName String Required Bucket name to save the output file
output.filePath String Required Detailed path to save the output file
output.accessControl String - Output file disclosure scope
  • PUBLIC_READ | PRIVATE
    • PUBLIC_READ: Public
    • PRIVATE: Private
output.thumbnailAccessControl String - Extracted thumbnail disclosure scope
  • PUBLIC_READ | PRIVATE
    • PUBLIC_READ: Public
    • PRIVATE: Private
output.withoutCategoryName Boolean - Whether to create a category name directory in the storage path
  • true | false
    • true: Create
    • false: Not create
output.thumbnailOutput Object - Thumbnail extraction settings information
output.thumbnailOutput.bucketName String - Bucket name to save the thumbnail extraction file
output.thumbnailOutput.filePath String - Detailed path to save the thumbnail extraction file
setAdvancedOptions Boolean - Advanced settings
advancedOptions Object - Advanced settings information
  • Displayed if setAdvancedOptions is true
advancedOptions.trimming Object - Output file trimming (playback section) settings
advancedOptions.trimming.startTimeCode String - Trimming start point (HH:MM:SS.S)
advancedOptions.trimming.endTimeCode String - Trimming end point (HH:MM:SS.S)
advancedOptions.imageOverlay Object - Image overlay (insertion) settings
advancedOptions.imageOverlay.input Object - Image settings information
advancedOptions.imageOverlay.input.bucketName String - Name of the bucket where the image is saved
advancedOptions.imageOverlay.input.filePath String - Detailed path of the image including the file name
advancedOptions.imageOverlay.size Object - Image size information
advancedOptions.imageOverlay.size.width Integer - Image width (pixel)
advancedOptions.imageOverlay.size.height Integer - Image height (pixel)
advancedOptions.imageOverlay.position Object - Location settings of image to be inserted
advancedOptions.imageOverlay.position.x Integer - Location of x-axis (pixel)
advancedOptions.imageOverlay.position.y Integer - Location of y-axis (pixel)
httpDownloadUrl String - HTTP URL to download externally

Response status codes

For information about the HTTP status codes common to all VOD Station APIs, see VOD Station response status codes.

Response example

The response example is as follows:

{
    "content": [
        {
            "id": *******,
            "status": "WAITING",
            "output": {
                "bucketName": "station-000",
                "filePath": "/",
                "accessControl": "PUBLIC_READ",
                "thumbnailAccessControl": "PUBLIC_READ",
                "withoutCategoryName": false,
                "thumbnailOutput": {
                    "bucketName": "station-000",
                    "filePath": "/thumbnail"
                }
            },
            "setAdvancedOptions": true,
            "advancedOptions": {
                "trimming": {
                    "startTimeCode": "00:00:00.0",
                    "endTimeCode": "00:08:00.9"
                },
                "imageOverlay": {
                    "input": {
                        "bucketName": "station-000",
                        "filePath": "/VODStation.png"
                    },
                    "size": {
                        "width": 50,
                        "height": 50
                    },
                    "position": {
                        "x": 50,
                        "y": 50
                    }
                }
            },
            "httpDownloadUrl": "https://kr.object.ncloudstorage.com/station-000-input/VODStation2.mp4"
        }
    ]
}