Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated instructions on uploading a remote url

...

To create a video file, use a multipart form-data. Example , or provide a remote URL. Examples in cURL is are shown below.

REST API

Video File:

POST /api/v0/videos

Code Block
languagebash
curl -X POST \
  https://admin-videoconsole.springserve.com/api/v0/videos/ \
  -H 'Authorization: <authorizationToken>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'video=@/<filepath>/videofile.mp4'
  -F 'demand_parnterpartner_id="<demand_parnterpartner_id>"'
  -F 'name="MyCreative"'

Status code 201

Response (example)

Code Block
{
    "id": <id>,
    "account_id": <account_id>,
    "name": "videofile.mp4MyCreative",
    "height": 1080,
    "width": 1920,
    "duration_seconds": 14,
    "video_file_name": "VIDEO FILE API DOCS",
    "video_content_type": "video/mp4",
    "video_file_size": 6737024,
    "video_updated_at": "2018-08-20T21:25:27.235Z",
    "video_remote_url": null
}


Remote URL:

POST /api/v0/videos

Code Block
languagebash
titleCode Block
curl -X POST \
  https://console.springserve.com/api/v0/videos/ \
  -H 'Authorization: <authorizationToken>' \
  -H 'Cache-Control: no-cache' \
  -F 'demand_partner_id="<demand_partner_id>"'
  -F 'creative_remote_url="<remote_url>"'
  -F 'name="MyCreative"'

Status code 201

Response (example)

Code Block
languagebash
titleCode Block
{
    "id": <id>,
    "account_id": <account_id>,
    "demand_partner_id": <demand_partner_id>,
    "name": "MyCreative",
    "height": 1080,
    "width": 1920,
    "duration_seconds": 31,
    "creative_file_name": "video.mp4",
    "creative_content_type": "video/mp4",
    "creative_file_size": 14305681,
    "creative_updated_at": "2022-08-03T22:08:04.187Z",
    "creative_remote_url": "https://cdn.samplewebsite.com/video.mp4"
}


SDK

Code Block
 resp = springserve.video_creatives.upload_video({'demand_partner_id': 5}, "/Users/blah/Downloads/video.mp4")

...