Skip to content

Commit fdf3098

Browse files
authored
Merge pull request #23 from zype/doc-updates-video-favorites
add updated Video Favorites doc
2 parents d8e79ef + da7a75f commit fdf3098

File tree

1 file changed

+109
-24
lines changed

1 file changed

+109
-24
lines changed

api_docs/video_favorites.md

Lines changed: 109 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,134 @@ title: Zype Developer Portal | Video Favorites
44
permalink: /api_docs/video_favorites/
55
---
66

7-
## Video Favorites
8-
<hr />
9-
### List Video Favorite Objects
10-
<pre>
11-
<b>GET</b> https://api.zype.com/consumers/[consumer_id]/video_favorites
12-
</pre>
7+
# Video Favorites
138

14-
#### Macros
9+
---
10+
11+
## Overview
12+
The Video Favorites API is used to query, create, and delete Video Favorites for [authenticated Consumers](http://dev.zype.com/api_docs/oauth).
13+
14+
A Video Favorite is a collection of videos designated by a Consumer as "favorites". Much like bookmarking a web page, Video Favorites allow a Consumer to add and remove bookmarks for videos within an app for easy access at a later time.
15+
16+
A Consumer's Video Favorites are stored in the Zype platform and are accessible from any endpoint the functionality has been implemented on. Currently, Video Favorites functionality can be found in the following Zype SDKs: iOS, Android, Roku, Amazon Fire TV, and Apple TV (local, on-device support only).
17+
18+
Developers may implement Video Favorites on their endpoint of choice if they wish to allow Consumers to bookmark videos for easy access across all app endpoints.
19+
20+
* [List Video Favorite Objects](#list-video-favorite-objects)
21+
* [Create a Video Favorite Object](#create-a-video-favorite-object)
22+
* [Delete a Video Favorite Object](#delete-a-video-favorite-object)
23+
* [Video Favorite Object (Example Response)](#video-favorite-object)
24+
25+
## List Video Favorite Objects
26+
27+
```
28+
GET https://api.zype.com/consumers/[consumer_id]/video_favorites
29+
```
30+
### Overview
31+
Get an **array** of Video Favorite Objects for the specified Consumer.
32+
33+
### Use Case
34+
Use this endpoint to retrieve and/or display a Consumer's Video Favorites.
35+
36+
**Example 1**
37+
List a Consumer's Video Favorites in one area of an app for convenient access.
38+
39+
```
40+
/**
41+
* List Consumer's Video Favorites
42+
*
43+
* @NOTE Pseudocode
44+
*/
45+
46+
// Get Video Favorites
47+
var video_favorites = GET https://api.zype.com/consumers/[consumer_id]/video_favorites;
48+
49+
// Get Video Details for each Video Favorite
50+
for (var i = 0; i < video_favorites.length; i++) {
51+
// Get the Video Favorite video_id
52+
var video_id = video_favorites[i].video_id;
53+
54+
// Get Video by ID
55+
var video = GET https://api.zype.com/videos/[video_id]
56+
57+
// Do something with retrieved video
58+
}
59+
```
60+
**Example 2**
61+
Visually designate a Consumer's Video Favorites inline with a [List Videos](http://dev.zype.com/api_docs/videos/#list-videos) query.
62+
63+
```
64+
/**
65+
* Display Video Favorites Inline
66+
*
67+
* @NOTE Pseudocode
68+
*/
69+
70+
// Get Video Favorites
71+
GET https://api.zype.com/consumers/[consumer_id]/video_favorites
72+
73+
// Get Videos
74+
GET https://api.zype.com/videos
75+
76+
// Map Video Favorites IDs with Video IDs
77+
```
78+
79+
80+
### Macros
1581

1682
Macro | Function | Type
1783
--------- | -------- | ----
18-
[consumer_id] | ID of the customer object (Example: 5389321e69702d401b120000) | String
84+
[consumer_id] | ID of the customer object (Example: `5389321e69702d401b120000`) | String
85+
86+
---
1987

20-
### Create a Video Favorite Object
21-
<pre><b>POST</b> https://api.zype.com/consumers/[consumer_id]/video_favorites
22-
</pre>
88+
## Create a Video Favorite Object
89+
```
90+
POST https://api.zype.com/consumers/[consumer_id]/video_favorites
91+
```
2392

24-
#### Macros
93+
### Macros
2594

2695
Macro | Function | Type
2796
--------- | -------- | ----
28-
[consumer_id] | ID of the customer object (Example: 5389321e69702d401b120000) | String
97+
[consumer_id] | ID of the customer object (Example: `5389321e69702d401b120000`) | String
2998

30-
#### Parameters
99+
### Parameters
31100

32101
Parameter | Function | Type
33102
--------- | -------- | ----
34-
video_id | ID of the video object (Example: 56d7594a0f8asd081208e4) | String
103+
video_id | ID of the video object (Example: `56d7594a0f8asd081208e4`) | String
35104

36-
### Delete a Video Favorite Object
37-
<pre><b>DELETE</b> https://api.zype.com/consumers/[consumer_id]/video_favorites/[video_favorite_id]
38-
</pre>
105+
---
106+
## Delete a Video Favorite Object
107+
```
108+
DELETE https://api.zype.com/consumers/[consumer_id]/video_favorites/[video_favorite_id]
109+
110+
/**
111+
* @NOTE Some client-side languages / libraries (JavaScript, jQuery, etc.)
112+
* must use POST with `_method=delete` parameter and value specifed.
113+
*/
114+
115+
POST https://api.zype.com/consumers/[consumer_id]/video_favorites/[video_favorite_id]?_method=delete
116+
```
39117

40-
#### Macros
118+
### Macros
41119

42120
Macro | Function | Type
43121
--------- | -------- | ----
44-
[consumer_id] | ID of the customer object (Example: 5389321e69702d401b120000) | String
45-
[video_favorite_id] | ID of the video favorite object (Example: 57cbb0a375jf9asd87011259) | String
122+
[consumer_id] | ID of the customer object (Example: `5389321e69702d401b120000`) | String
123+
[video_favorite_id] | ID of the video favorite object (Example: `57cbb0a375jf9asd87011259`) | String
46124

47-
### Video Favorite Object
125+
### Parameters (Optional: Client-Side Languages)
126+
127+
Parameter | Function | Type
128+
--------- | -------- | ----
129+
_method | Passes delete command via parameter (Example: `_method=delete`)| String
130+
131+
---
132+
## Video Favorite Object
48133

49-
<pre>
134+
```
50135
{
51136
"_id": "57cbb1231c4f960kj2015812",
52137
"consumer_id": "57cbg120e43f9aa981018199",
@@ -55,4 +140,4 @@ Macro | Function | Type
55140
"updated_at": "2016-09-04T01:26:59.480-04:00",
56141
"video_id": "56d7594a8f7aca08aabbc8e3"
57142
}
58-
</pre>
143+
```

0 commit comments

Comments
 (0)