### SproutVideo API: Create Call to Action Request/Response (JSON Examples)
Source: https://sproutvideo.com/docs/api
This section provides JSON examples for both the request payload to create a new call to action and its subsequent response, which mirrors the structure of getting a single call to action.
```json
{
"text": "This is a all to action",
"url": "https://sproutvideo.com",
"start_time": 0.0,
"end_time": 5.0
}
```
```json
{
"id": "51d18e6c",
"text": "This is a call to action",
"url": "https://sproutvideo.com",
"start_time": 0.0,
"end_time": 5.0,
"created_at": "2012-09-27T13:13:50-10:00",
"updated_at": "2012-09-27T13:13:50-10:00"
}
```
--------------------------------
### SproutVideo API: Get a Single Call to Action (JSON Example)
Source: https://sproutvideo.com/docs/api
This JSON example illustrates the response received when fetching details for a single call to action associated with a video. It includes all properties of the call to action.
```json
{
"id": "51d18e6c",
"text": "This is a call to action",
"url": "https://sproutvideo.com",
"start_time": 0.0,
"end_time": 5.0,
"created_at": "2012-09-27T13:13:50-10:00",
"updated_at": "2012-09-27T13:13:51-10:00"
}
```
--------------------------------
### Create Subtitle Response (API Example)
Source: https://sproutvideo.com/docs/api
This example shows the JSON response received after successfully creating a new subtitle. The response is identical to that of getting a single subtitle, confirming creation and providing its details.
```json
{
"id": "51d18e6c",
"language": "en",
"language_description" : "English",
"published": true,
"content": "WEBVTT FILE...",
"created_at": "2012-09-27T13:14:27-10:00",
"updated_at": "2012-09-27T13:14:28-10:00"
}
```
--------------------------------
### Create Login Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response after successfully creating a new login. Returns the details of the created login.
```json
{
"email": "test@example.com",
"created_at": "2011-05-07T21:55:35Z",
"access_grants": [],
"updated_at": "2011-05-07T21:55:35Z",
"id": "06edb9ee"
}
```
--------------------------------
### Create Folder Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response after successfully creating a folder. Includes folder details like id, name, and timestamps.
```json
{
"id": "06edb9ee",
"name": "My Folder",
"parent_id": null,
"created_at": "2011-05-07T21:55:35Z",
"updated_at": "2011-05-07T21:55:35Z"
}
```
--------------------------------
### Create Folder Request Example
Source: https://sproutvideo.com/docs/api
Example of a JSON request to create a new folder. Requires a 'name' and optionally accepts a 'parent_id'.
```json
{
"name": "My Folder"
}
```
--------------------------------
### Create Login Request Example
Source: https://sproutvideo.com/docs/api
Example JSON request to create a new login. Requires 'email' and 'password'.
```json
{
"email": "test@example.com",
"password": "thisisthepassword"
}
```
--------------------------------
### Get Single Login Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response for retrieving details of a single login. Includes id, email, access grants, and timestamps.
```json
{
"email": "test@example.com",
"created_at": "2010-08-27T01:35:41Z",
"access_grants": ["c25d194a"],
"updated_at": "2011-05-07T21:55:35Z",
"id": "06edb9ee"
}
```
--------------------------------
### List Logins Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response for listing multiple logins. Includes total count, pagination links, and an array of login objects.
```json
{
"total": 12,
"next_page": "https://api.sproutvideo.com/v1/logins?page=2&per_page=25",
"logins": [
{
"email": "test@example.com",
"created_at": "2010-08-27T01:35:41Z",
"access_grants": ["c25d194a"],
"updated_at": "2011-05-07T21:55:35Z",
"id": "06edb9ee"
},
...
]
}
```
--------------------------------
### Get Live Streams with Filtering and Sorting
Source: https://sproutvideo.com/docs/api
This example demonstrates how to fetch a list of live streams from the SproutVideo API, applying various optional parameters for filtering and sorting. These parameters allow users to narrow down results by criteria such as tags, privacy settings, state, and specific order. The API returns a paginated response containing the total count and a list of live stream objects.
```text
https://api.sproutvideo.com/v1/live_streams?order_by=updated_at
https://api.sproutvideo.com/v1/live_streams?order_by=title&order_dir=desc
https://api.sproutvideo.com/v1/live_streams?tag_id=a323d32
https://api.sproutvideo.com/v1/live_streams?tag_name=funny+cat+videos
https://api.sproutvideo.com/v1/live_streams?privacy=2
https://api.sproutvideo.com/v1/live_streams?state=active
https://api.sproutvideo.com/v1/live_streams?archive_folder_id=709df9
```
--------------------------------
### List Access Grants Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response when listing access grants. It includes details for each grant like play counts, access times, and download permissions.
```json
[
{
"updated_at": "2012-08-03T18:44:33Z",
"play_count": 1,
"allowed_plays": 5,
"access_starts_at": null,
"login_id": "1da5",
"access_ends_at": "2014-08-03T21:56:03Z",
"download_permissions": ["original", "hd"],
"video_id": "49fc3ee1215b2d89c1",
"id": "52998a",
"created_at": "2012-08-03T18:44:33Z",
"session_watermarks": false
},
{
"updated_at": "2012-08-03T18:44:33Z",
"play_count": 1,
"allowed_plays": 5,
"access_starts_at": null,
"login_id": "5733b1d19accd1",
"access_ends_at": "2014-08-03T21:56:03Z",
"download_permissions": ["original", "hd"],
"video_id": "49fc3ee1215b2d89c1",
"id": "52998a",
"created_at": "2012-08-03T18:44:33Z",
"session_watermarks": false
}
]
```
--------------------------------
### Edit Folder Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response after editing a folder. Reflects the updated folder details.
```json
{
"id": "06edb9ee",
"name": "My Other Folder",
"parent_id": null,
"created_at": "2010-08-27T01:35:41Z",
"updated_at": "2011-05-07T21:55:35Z"
}
```
--------------------------------
### Get Single Folder Response Example
Source: https://sproutvideo.com/docs/api
This JSON object illustrates the response format for fetching a single folder's details from the SproutVideo API. It includes the folder's unique identifier, its name, the ID of its parent folder (or null if it's a root folder), and timestamps for creation and last update. Dependencies: None. Input: API GET request. Output: JSON object for a single folder.
```json
{
"id": "06edb9ee"
"name": "My Folder"
"parent_id": null,
"created_at": "2010-08-27T01:35:41Z",
"updated_at": "2011-05-07T21:55:35Z"
}
```
--------------------------------
### Live Stream Creation/Update Request Body Example (JSON)
Source: https://sproutvideo.com/docs/api
An example of a JSON request body for creating or updating a live stream. It includes common parameters such as title, description, privacy settings, password, and tags.
```json
{
"title":"An updated live stream title",
"description": "This really is an amazing live stream!",
"privacy": 1,
"password": "live stream password",
"prefers_embed_password": true,
"tags": ["82dbbde97a"]
}
```
--------------------------------
### SproutVideo API Playback Sessions Example
Source: https://sproutvideo.com/docs/api
This JSON example demonstrates the structure of the response when retrieving playback session data. It includes pagination details and a list of session objects, each with viewer, geo, and video information.
```json
{
"next_page": "https://api.sproutvideo.com/v1/stats/engagement/sessions?page=2&per_page=25",
"total": 91,
"sessions": [
{
"id": "7dab7225-5258-4a7d-abcd-636464be4539",
"date": "2012-11-30T01:49:49-05:00",
"viewer": {
"other_videos_watched": 0,
"id": "3768cc89-abdb-4874-99c5-23727863e1c1",
"email": null,
"name": null
},
"url": "http://example.com/page.html",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0",
"watched": [
1,
1,
1,
1,
1,
1,
...
],
"ip_address": "76.102.85.225",
"geo": {
"region": "CA",
"country": "US",
"city": "Pinole"
},
"playback_type": "flash",
"video_id": "709bd8fe7c0f8"
},
{
"id": "a0ce0614-b13a-422e-983b-9f500f0ed477",
"date": "2012-11-30T01:11:49-05:00",
"viewer": {
"other_videos_watched": 2,
"name": "Test Person",
"id": "4c80f6e3-0fc6-45f5-b458-94fd2de72acc",
"email": "test@example.com"
},
"url": "https://s-static.ak.facebook.com/common/referer_frame.php",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11",
"watched": [
2,
2,
2,
2,
1,
1,
...
],
"ip_address": "142.255.78.220",
"geo": {
"region": "NY",
"country": "US",
"city": "Brooklyn"
},
"playback_type": "flash",
"video_id": "709bd8fe7c0f8"
},
...
]
}
```
--------------------------------
### SproutVideo Live Stream Response Example (JSON)
Source: https://sproutvideo.com/docs/api
Example of a JSON response body for a SproutVideo live stream, detailing its properties such as ID, stream key, state, and embed code.
```json
{
"id": "2c4cadd90b",
"stream_key": "2c2a273e-16ef-d071-6eb0-ff0d97ab3c3",
"state": "archived",
"latency": "low",
"reconnect_window": 300,
"title": "This really is an amazing live stream!",
"description": "My Live Stream Description",
"created_at": "2022-05-01T16:48:36-04:00",
"updated_at": "2022-05-02T05:01:06-04:00",
"archive_live_stream": null,
"unlist_after_live_stream_ends": null,
"duration": 190.28,
"embed_code": "",
"video_uid": "db04e91c46dc97193c",
"video_security_token": "6090caa41998fe08",
"privacy": 1,
"password": "live stream password",
"tags": ["82dbbde97a"],
"requires_signed_embeds": null,
"selected_poster_frame_number": 1588366164,
"embedded_url": null,
"download_sd": null,
"download_hd": null,
"download_uhd": null,
"download_source": null,
"allowed_domains": null,
"allowed_ips": null,
"player_social_sharing": null,
"player_embed_sharing": null,
"require_email": false,
"require_name": false,
"hide_on_site": false,
"archive_folder_id": "1d6c66d8b9e8bd15",
"webhook_url": null,
"assets": {
"poster_frames": [
"https://images.sproutvideo.com/5926a94544bef354e4ddb653b73690cc/b4f1db863fb48796be2f4469291e4adf/poster_frames/frame_1588366164.jpg"
]
},
"automated_subtitles": false
}
```
--------------------------------
### List Folders Response Example
Source: https://sproutvideo.com/docs/api
This JSON structure represents the response when listing folders via the SproutVideo API. It includes the total count of folders, links for pagination, and an array of folder objects, each with an ID, name, parent ID, and creation/update timestamps. Dependencies: None. Input: API GET request. Output: JSON object with folder list.
```json
{
"total": 12,
"next_page": "https://api.sproutvideo.com/v1/folders?page=2&per_page=25",
"folders": [
{
"id": "06edb9ee"
"name": "My Folder",
"parent_id": null,
"created_at": "2010-08-27T01:35:41Z",
"updated_at": "2011-05-07T21:55:35Z"
},
...
]
}
```
--------------------------------
### Edit Access Grant Response Example
Source: https://sproutvideo.com/docs/api
Example JSON response after successfully editing an access grant. It reflects the updated settings for the grant.
```json
{
"updated_at": "2012-08-03T18:44:33Z",
"play_count": 1,
"allowed_plays": 0,
"access_starts_at": null,
"login_id": "1da5",
"access_ends_at": null,
"download_permissions": ["sd"],
"video_id": "49fc3ee1215b2d89c1",
"id": "52998a",
"created_at": "2012-04-28T16:08:32Z",
"session_watermarks": false
}
```
--------------------------------
### Create Subtitle Request (API Example)
Source: https://sproutvideo.com/docs/api
This example illustrates the JSON payload required to create a new subtitle for a video. It specifies the language and content, with optional publication status.
```json
{
"language": "en",
"content": "WEBVTT FILE..."
}
```
--------------------------------
### SproutVideo Overall Play Counts Example (JSON)
Source: https://sproutvideo.com/docs/api
Example JSON response for overall play counts on SproutVideo, showing total plays, impressions, and unique plays/impressions.
```json
{
"play_count": 16189,
"impression_count": 201216,
"unique_play_count": 8146,
"unique_impression_count": 65950
}
```
--------------------------------
### Edit Subtitle Response (API Example)
Source: https://sproutvideo.com/docs/api
This example displays the JSON response after a subtitle has been successfully edited. The response reflects the updated subtitle information, similar to the 'get single subtitle' response.
```json
{
"id": "51d18e6c",
"language": "de",
"language_description" : "German",
"published": true,
"content": "WEBVTT FILE...",
"created_at": "2012-09-27T13:14:27-10:00",
"updated_at": "2012-08-09T10:19:08-10:00"
}
```
--------------------------------
### Get Single Subtitle (API Example)
Source: https://sproutvideo.com/docs/api
This example shows the JSON response structure when retrieving details for a single subtitle. It includes the subtitle's ID, language, publication status, content, and timestamps.
```json
{
"id": "51d18e6c",
"language": "en",
"language_description": "English",
"published": true,
"content": "...",
"created_at": "2012-09-27T13:13:50-10:00",
"updated_at": "2012-09-27T13:13:51-10:00"
}
```
--------------------------------
### Create New Playlist (API Example)
Source: https://sproutvideo.com/docs/api
This example illustrates how to create a new playlist using the SproutVideo API. A POST request to the `/v1/playlists` endpoint is used. Specific parameters for creating a playlist, such as title and description, would typically be included in the request body, though they are not detailed in the provided text.
```bash
curl -X POST "https://api.sproutvideo.com/v1/playlists" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{"title": "My New Playlist", "description": "A description for my playlist"}'
```
--------------------------------
### Get Playlist Response Example
Source: https://sproutvideo.com/docs/api
This JSON object represents a typical response when retrieving playlist details from the SproutVideo API. It includes metadata like creation/update times, privacy settings, associated video IDs, and the embed code. Dependencies: None. Input: API GET request. Output: JSON object representing a playlist.
```json
{
"created_at": "2011-08-25T18:09:46Z",
"updated_at": "2012-02-03T19:02:28Z",
"privacy": 2,
"password": "",
"title": "Awesome Movie Trailers",
"description": null,
"requires_signed_embeds": null,
"prefers_embed_password": false,
"security_token": "9c4afc572c2af416",
"videos": [
"5ce81a011d6b9286ce",
"8b19c6e1560e8da1c2",
"21a0c9b6ec18ed6815",
"081c261c1d5b6e9ae8"
],
"id": "e210c6ad6b1ec88591",
"embed_code": "",
"assets": {
"poster_frames": []
}
}
```
--------------------------------
### Update Account Settings (JSON Request Example)
Source: https://sproutvideo.com/docs/api
This JSON object demonstrates a sample request payload for updating account settings. It includes options for enabling SD and HD video downloads. Note that many settings can be overridden on a per-video basis.
```json
{
"download_sd": true,
"download_hd": true,
"download_source": true
}
```
--------------------------------
### Get Single Playlist by ID (API Example)
Source: https://sproutvideo.com/docs/api
This section provides the API endpoint for retrieving details of a specific playlist using its unique ID. The GET request returns comprehensive information about the playlist, including its ID, security token, privacy settings, title, description, associated video IDs, embed code, and asset URLs.
```bash
curl -X GET "https://api.sproutvideo.com/v1/playlists/:id" \
-H "Authorization: Bearer YOUR_API_TOKEN"
```
--------------------------------
### Get Play Counts by Date Range (API)
Source: https://sproutvideo.com/docs/api
Fetches play and impression counts for videos within a specified date range. Accepts optional start and end dates to filter the data. The response is an array of daily statistics.
```bash
curl "https://api.sproutvideo.com/v1/stats/counts?start_date=2013-04-15&end_date=2013-04-15"
```
--------------------------------
### Create Playlist
Source: https://sproutvideo.com/docs/api
Creates a new video playlist with specified details and videos.
```APIDOC
## POST /websites/sproutvideo/playlists
### Description
Creates a new video playlist.
### Method
POST
### Endpoint
/playlists
### Parameters
#### Request Body
- **title** (String) - Required - The title of the playlist
- **description** (String) - Optional - The description of the playlist
- **requires_signed_embeds** (Boolean) - Optional - Indicates if signed embed codes are required for this playlist.
- **prefers_embed_password** (Boolean) - Optional - Determines if a password is required for playlist viewing.
- **privacy** (Integer) - Optional - The privacy level for this playlist (0, 1, or 2).
- **password** (String) - Optional - The password for the playlist if privacy is set to 1.
- **videos** (Array of Strings) - Optional - An array of video IDs to include in the playlist.
### Request Example
```json
{
"title": "New Playlist",
"videos": [
"21a0c9b6ec18ed6815",
"8b19c6e1560e8da1c2",
"5ce81a011d6b9286ce",
"081c261c1d5b6e9ae8"
]
}
```
### Response
#### Success Response (200)
- **created_at** (String) - The creation timestamp of the playlist.
- **updated_at** (String) - The last updated timestamp of the playlist.
- **privacy** (Integer) - The privacy level of the playlist.
- **password** (String) - The password for the playlist.
- **title** (String) - The title of the playlist.
- **description** (String) - The description of the playlist.
- **requires_signed_embeds** (Boolean) - Indicates if signed embed codes are required.
- **prefers_embed_password** (Boolean) - Indicates if embed password is preferred.
- **security_token** (String) - A security token for the playlist.
- **videos** (Array of Strings) - An array of video IDs in the playlist.
- **id** (String) - The unique identifier for the playlist.
- **embed_code** (String) - The embed code for the playlist.
- **assets** (Object) - Asset information, such as poster frames.
#### Response Example
```json
{
"created_at": "2012-02-03T19:02:28Z",
"updated_at": "2012-02-03T19:02:28Z",
"privacy": 0,
"password": "",
"title": "New Playlist",
"description": null,
"requires_signed_embeds": null,
"prefers_embed_password": false,
"security_token": "9c4afc572c2af416",
"videos": [
"21a0c9b6ec18ed6815",
"8b19c6e1560e8da1c2",
"5ce81a011d6b9286ce",
"081c261c1d5b6e9ae8"
],
"id": "e210c6ad6b1ec88591",
"embed_code": "",
"assets": {
"poster_frames": []
}
}
```
```
--------------------------------
### Get Geo Stats by Date (City)
Source: https://sproutvideo.com/docs/api
Retrieves daily video play statistics aggregated by city. Accepts optional start and end dates for filtering the data range. The response includes the date and an array of city play counts.
```json
[
{
"date": "2012-12-31",
"geo": [
{
"city": "New York, NY",
"play_count": 41
},
{
"city": "Chicago, IL",
"play_count": 35
},
...
]
},
{
"date": "2013-01-01",
"geo": [
{
"city": "New York, NY",
"play_count": 36
},
{
"city": "Allston, MA",
"play_count": 22
},
...
]
}
]
```
--------------------------------
### Get Geo Stats by Date (Country)
Source: https://sproutvideo.com/docs/api
Retrieves daily video play statistics aggregated by country. Accepts optional start and end dates for filtering the data range. The response includes the date and an array of country play counts.
```json
[
{
"date": "2012-12-31",
"geo": [
{
"play_count": 787,
"country": "US"
},
{
"play_count": 95,
"country": "CA"
},
...
]
},
{
"date": "2013-01-01",
"geo": [
{
"play_count": 696,
"country": "US"
},
{
"play_count": 92,
"country": "CA"
},
...
]
}
]
```
--------------------------------
### Get Overall Domain Play Counts By Date
Source: https://sproutvideo.com/docs/api
Retrieves daily play counts aggregated by domain. This endpoint allows for optional start and end dates to filter the data. The response is an array of objects, each representing a date and containing an array of domain-specific play counts for that day.
```json
[
{
"domains": [
{
"play_count": 11,
"domain": "example1.com"
},
{
"play_count": 5,
"domain": "example2.com"
}
],
"date": "2012-12-31"
},
{
"domains": [
{
"play_count": 21,
"domain": "example1.com"
},
{
"play_count": 14,
"domain": "example2.com"
},
],
"date": "2013-01-01"
},
...
]
```
--------------------------------
### Account Settings API Endpoint (GET /v1/account)
Source: https://sproutvideo.com/docs/api
This section describes the GET request to the /v1/account endpoint, which retrieves account-wide settings and usage information. The response includes details about the account holder, plan, and current billing period usage for bandwidth and storage.
```http
URL | Method
---|---
https://api.sproutvideo.com/v1/account | GET
```
--------------------------------
### Get Overall Geographic Play Counts By Date
Source: https://sproutvideo.com/docs/api
Retrieves daily geographic play data, filterable by country. This endpoint allows for optional start and end dates. The response provides play counts per country for each date within the specified range. It can also be used to fetch city-level data by providing a country code.
```json
[
{
"date": "2013-01-01",
"countries": [
{
"play_count": 100,
"country": "US"
},
{
"play_count": 50,
"country": "CA"
}
]
},
...
]
```
--------------------------------
### Account Settings JSON Structure
Source: https://sproutvideo.com/docs/api
This is an example of the JSON structure representing SproutVideo account information. It includes user details, account settings, plan information, and usage data. The 'settings' object contains configurable options for video playback and distribution.
```json
{
"email": "account@example.com",
"company": "Example Company",
"first_name": "Example",
"last_name": "Person",
"utc_offset": -28800,
"settings": {
"download_sd": false,
"download_hd": false,
"download_source": false,
"allowed_domains": "",
"allowed_ips": "",
"notification_url": null,
"player_social_sharing": false,
"player_embed_sharing": false,
"requires_signed_embeds": false,
"airplay_support": false,
"session_watermarks": false,
"direct_file_access": false
},
"plan": {
"name": "Tree Plan",
"monthly_price": 100,
"bandwidth": 644245094400,
"storage": 1717986918400
},
"usage": {
"billing_period_start": "2016-11-23T17:58:20Z",
"billing_period_end": "2016-12-23T17:58:20Z",
"bandwidth": 54672751464,
"storage": 2854811214
}
}
```
--------------------------------
### Live Stream Creation/Update Request Example (JSON)
Source: https://sproutvideo.com/docs/api
This JSON object represents a sample request payload for creating or updating a live stream. It includes optional parameters like title, description, latency, and archive_folder_id.
```json
{
"title": "My First Live Stream",
"description": "My Live Stream Description",
"latency": "low",
"archive_folder_id": "1d6c66d8b9e8bd15"
}
```
--------------------------------
### Edit Folder Request Example
Source: https://sproutvideo.com/docs/api
Example JSON request to edit an existing folder. Accepts optional 'name' and 'parent_id' for updates.
```json
{
"name": "My Other Folder"
}
```