eBay Managing Videos Technical Scope
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
30.03.2023 | 1.0 | Bogomil Pavlov | Create Video Title Mapping changed |
The purpose of this document is to give good understanding how videos are managed via API on eBay and how we will incorporate the new features within our current integration.
The process will look like we will have to create a new video on eBay then from the response we get the videoID and use it for upload video request and the last step is to associate the videoID with the listing.
The key changes here are:
1 Integrating to eBy Media API > Create Video and eBay Media API > Upload Video
2 Adding additional node in Trading API > AddFixedPriceItem
New fields in Item Account
field name | data type | comment |
---|---|---|
Video URL | varchar | our video url |
Use Video | checkbox | Indicates if we want to associate the video / use the vide |
New fields in Item table
field name | data type | comment |
---|---|---|
Video URL | varchar | our video url |
New table Videos which is slave table of Item and Item Account using video URL
field name | data type | comment |
---|---|---|
Video URL | varchar | our video url |
New table eBay Videos which is slave table of Videos
field name | data type | comment |
---|---|---|
Video ID | ||
Video Status | ||
Video Error |
Creating Video
The first step is to add our video URL in Item > Video URL or in Item Account > Video URL from where will be picked with priority if populated. Once we have added the Vide URL we can set Item Account > Use Video check box which will trigger the cron and we will start creating the video on eBay. This will create a new record in Videos table and store the video URL from where we get the file and all the parameters of the video. Once we request the creation the Video ID will be populated in eBay Videos > Video ID.
Note: The size of the uploaded video must exactly match the size that was stated for the file in the createVideo method. If the sizes do not match, the video will not upload successfully.
Once we have this we can make createVideo request Request The inputs are the title, size, classification, and (optionally) description.ST
POST https://apim.ebay.com/commerce/media/v1_beta/video
{
"size": "3569629",
"title": "title of the video",
"description": "description of the video",
"classification": [
"ITEM"
]
}
eBay Field | Hemi Field | Comment |
---|---|---|
size | The size of the video in Bytes | Required |
title | "Video“ + Item > SKU | Required |
description | N/A | Optional |
classification | hardcoded as 'ITEM ' |
Required |
Response
The output is an HTTP status. If the call is successful, the video will be created and the video ID is returned in the Location header.
eBay Field | Hemi Field | Comment |
---|---|---|
Video ID | eBay Videos > Video ID |
Upload Video
The second step is to basically upload the actual file using the Video ID from the first step. To do so we will need to make uploadVideo request. Request
POST https://apim.ebay.com/commerce/media/v1_beta/video/{{VideoID}}/upload
As a parameter we push the eBay Videos > Video ID As headers we will need to add:
Header | Type | Description |
---|---|---|
Content-Length | string | Use this header to specify the content length for the upload. Use Content-Range: bytes {1}-{2}/{3} and Content-Length:{4} headers. |
Note: This header is optional and is only required for resumable uploads (when an upload is interrupted and must be resumed from a certain point).
Occurrence: Strongly Recommended |
| Content-Range | string | Use this header to specify the content range for the upload. The Content-Range should be of the following bytes ((?:[0-9]+-[0-9]+)|\\)/([0-9]+|\\*) pattern.
Note: This header is optional and is only required for resumable* uploads (when an upload is interrupted and must be resumed from a certain point).
Occurrence: Strongly Recommended |
| Content-Type | string | Use this header to specify the content type for the upload. The Content-Type should be set to application/octet-stream
.
Occurrence: Required |
Note: This method has no request payload. Instead, a video file is uploaded to the endpoint. The input stream source must be an .mp4 file of the type MPEG-4 Part 10 or Advanced Video Coding (MPEG-4 AVC). The maximum supported video size is 150 MB. The maximum upload resolution is 1080p. Supported output resolutions are 240p, 360p, 480p, and 720p. It is recommended also not to exceed 1 min of length
Output
The output is an HTTP status. If the call is successful, the video will be uploaded and we will receive 200
Get Video Response
The last step is to check if the video is created successfully. In order to do so we will need to use getVideo request. The purpose of this call is to make sure the video is uploaded and there are no errors. We will need to track only the status node.
Request GET https://apim.ebay.com/commerce/media/v1_beta/video/{{videoID}}
Response
{
"videoId": "f******************************a",
"size": "3569629",
"title": "title of the video",
"description": "description of the video",
"status": "LIVE",
"expirationDate": "2022-01-11T22:24:19Z",
"thumbnail.imageUrl": "https://example.com/m********e.jpg",
"playLists": [
{
"protocol": "DASH",
"playUrl": "https://video.ebaycdn.net/videos/v1/f******************************a/playlist.mpd"
},
{
"protocol": "HLS",
"playUrl": "https://video.ebaycdn.net/videos/v1/f******************************a/playlist.m3u8"
}
],
"classification": [
"ITEM"
]
}
eBay Status | Comment |
---|---|
PENDING_UPLOAD | The video is pending upload. The video is being associated with a video ID and has not been uploaded yet. |
PROCESSING | After a video upload is successfully completed, the status will show as PROCESSING until the video reaches one of the terminal states of LIVE , BLOCKED or PROCESSING_FAILED . |
PROCESSING_FAILED | The video failed to process. If processing fails, it could be because the file is corrupted, is too large, or its size doesn’t match what was provided in the metadata. Refer to the error messages to determine the cause of the video’s failure to upload. |
BLOCKED | The video is blocked. A video might be BLOCKED if it contains malware, or if it is blocked by the (future) video moderation feature. |
LIVE | The video is live. When the status of the video is LIVE , this indicates the file has been processed and uploaded successfully. The playList providing URLs for the video in DASH and HLS streaming video protocols will only be generated if the video uploads successfully. |
Create video will need to be triggered only if: We have Item > Video URL or Item Account > Video URL populated We have Item Account > Use Video = 1
Upload Video will be triggered only if: We have Video added the new record in Videos We have eBay Videos > Video ID
After successful video upload (both 1 and 2 step) we will have to set eBay Videos > Status = the status we get from eBay eBay Videos > Error = if error is returned when uploading the video
Associate Video with Listing
Once we have successfully uploaded a video with status Live and video ID the with full product update we can associate the video with the listing. The new node in AddFixedPriceItem request is:
<Item>
...
<VideoDetails>
<VideoID>f******************************a</
</VideoDetails>
...
</Item>
After successful video create and video upload and receive status Live we can now associate the listing with the new Live eBay Video using the Trading API or LMS full product update request. ''
The key thing here is how we are going to work with the variations because once variation group is most likely to have only one video ID. I can confirm that there is only 1 video for the entire listing, so each variant will share the same video.
Same is the case and for the LMS we will be able to associate videos using the Large Merchant Service as well.
To remove a video from the listing using the Revise or Relist calls, the seller can include a DeletedField tag in the request and set its value to Item.VideoDetails.VideoID. So, it will look like the following in a ReviseItem request payload:
<?xml version="1.0" encoding="utf-8"?>
<ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseCo...>
<DeletedField>Item.VideoDetails.VideoID</DeletedField>
...
</ReviseItemRequest>
In order to remove a video we need to revise the item without Item Account > Use Video flag