Retrieve Play Page
From KickApps Documentation
Contents |
Overview
Retrieves information for a full media play page. You can use a GET or a POST request when making this call. You can also work with the individual components of a play page, using the following calls:
- Retrieve Media Meta Data
- Email Media
- Add Tags To Media, Members and Groups
- Retrieve Media Ratings
- Rate Media
- Retrieve External Media
- Search
Your request will look something like the following.
http://api.kickapps.com/rest/pp/{mediaType}/{mediaId}/{as}
Note:The comments array will only contain the first 1000 comments. You should refer to the Retrieve Comments call for accessing the full comment list.
Parameters
As shown above, your call will include the following parameters:
- mediaType. The media type. audio, photo , blog, video. KIT Cloud Social's sample applications use mediaType to check for the Flash player to use. Note that for this call, user is not a valid value.
- mediaId. The id of the media to play. This value is specific to both the as and the type.
- as. The site to search. as is unique for each of the affiliate's sites.
Post Parameters
- t. String. Required. Your access permissions.
- callback. String. Optional. The name of your JavaScript callback function.
- clientIP. String. Optional. Use the clientIP parameter to pass the IP address of the user making the call. If the IP has been blocked by the webmaster under the Affiliate Center -> Manage Members section, an error message will be returned starting with "status":"-1","error":"This IP address has been banned".
Example Requests
The following requests show an application's call to the REST API, see the relevant sample application code for more details.
Java
NameValuePair[] tokenParams = { new NameValuePair("t", ka_token.getToken()) };
if (ka_token != null) {
JSONObject playPageObject = KickAppsHttpClient.doRestCall(KickAppsHttpClient.PLAY_PAGE_URL + mediaType + "/" + mediaId + "/" + as, "POST", tokenParams);if (ka_token != null) {
JSONObject playPageObject = KickAppsHttpClient.doRestCall(KickAppsHttpClient.PLAY_PAGE_URL + mediaType + "/" + mediaId + "/" + as,
"POST", tokenParams);
C#
The C# sample app uses af as the value for as (affiliate site id).
objclsRestClient = new clsRestClient();
RestUrl = clsRestClient.PLAY_PAGE_URL;
NameValueCollection parameters = new NameValueCollection(); parameters.Add("t", objToken.TOKEN); result = objclsRestClient.doRestCall(RestUrl + mediaType + "/" + mediaId + "/" + af, "POST", parameters); objToken.PAYLOAD = result;
PHP
$as = $ka_token->getAs();
$mediaType = $_REQUEST['mediaType'];
$mediaId = $_REQUEST['mediaId'];
$rest_url = PLAY_PAGE_URL .$mediaType ."/". $mediaId."/".$as;
$ch = curl_init($rest_url); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, 't='.$ka_token->getToken()); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $buf=curl_exec ($ch); curl_close ($ch);
JSON Payload
On success, a payload that begins with status":"1","error":""
{"status":"1","error":"",
"comments":[{}],
"latest":[{}],
"media":{},
"mostViewed":[{}],
"topRated":[{}],
"contest":[{}]
}
- comments. A nested object that contains the following for each comment.
| body | The text for the member's comment. |
| createdAt | A nested object stating when the media was created in the following format. All times are returned as Greenwich Mean Time (GMT).dayOfMonth month hour:minute:second GMT This would appear as follows:
|
| fromUserId | The member who posted the comment. |
| commentId | The unique id for the comment. |
| pathToPhoto | The path to the photo displayed in the list. |
| pathToIcon | The path to the stored thumbnail for this media. |
| updatedByUserId | The numeric Id of the member who made the update. |
| updateAt | A nested object stating when the media was created in the following format. All times are returned as Greenwich Mean Time (GMT).
This would appear as follows:
|
| userId | The numeric id for the member who posted the comment. |
| username | The username of the member who uploaded the comment. |
- latest/topRated/mostViewed. A nested object that lists the following information for the 25 most recent, top rated, or frequently viewed files uploaded for the media type.
| adminTags | A comma-separated list of tags added by administrators or webmasters. |
| averageRating | The average rating calculated using all the ratings issued for this media. |
| categories | Zero or more descriptive categories (for example, categories that were specified by the affiliate). Passed back in the payload as a comma-separated list.
Categories can be created by the affiliate and can contain up to three levels of subcategories. The play page should contain any categories and subcategories (displaying the category name and URL) that are associated with the media. String. Added by administrators in the Affiliate Center, under the Media Management settings. Members can choose from these categories when working with media. |
| createdAt | A nested object stating when the media was created in the following format. All times are returned as Greenwich Mean Time (GMT).
This would appear as follows:
|
| description | A text description of this media. This description is entered by the owner when the media is uploaded. Text can be no longer than 500 characters. |
| emailedToFriendsCount | The total number of times this media item was emailed. |
| favoriteCount | The number of members who have marked this media as one of their favorites. |
| id | The id of the given media. |
| isDisabled | true or false. Default is false. In the Affiliate Center's Member Management area, affiliates can see and manage member status (pending/approved/disabled). If a member or media is disabled or pending, then the member or media is not searchable and does not appear to other members, only in the Affiliate Center. |
| name | Name given to the media by member when media was uploaded. |
| numComments | The number of comments associated with this media item. |
| pathToIcon | The path to the stored thumbnail for this media. |
| pathtoMedia | The path to the stored media. |
| pathToPhoto | The path to the photo displayed in the list. |
| pathToPreview | The path to the media preview:
|
| tags | Zero or more searchable, descriptive keywords entered by members. Appears as a comma-separated list. |
| type | The media type. audio, photo or video. KIT Cloud Social's sample applications use type to check for the Flash player to use to display the file to members. |
| uploadedBy | The username for the member who uploaded the media. |
| userId | The id of the member who uploaded the media. |
| views | The number of times this media item was viewed. views increments each time the media item is viewed. |
| votes | The number of votes made for this media item. |
- media. The media file and related information associated with the given play page.
| adminTags | A comma-separated list of tags added by administrators or webmasters. |
| averageRating | The average rating calculated using all the ratings issued for this media. |
| categories | Zero or more descriptive categories (for example, categories that were specified by the affiliate). Passed back in the payload as a comma-separated list.
Categories can be created by the affiliate and can contain up to three levels of subcategories. The play page should contain any categories and subcategories (displaying the category name and URL) that are associated with the media. Added by administrators in the Affiliate Center, under the Media management settings. Members can choose from these categories when working with media. |
| city | The member's home city. |
| country | The member's country of residence. |
| createdAt | A nested object stating when the media was created in the following format. All times are returned as Greenwich Mean Time (GMT).
This would appear as follows:
|
| description | A text description of this media. This description is entered by the owner when the media is uploaded. The text can be no longer than 500 characters. |
| id | The id of the media to play. |
| groups | A nested element containing the groups with which this media is associated. |
| isAdultContent | true or false. Default is false. |
| inappropriateFlagCount | The number of inappropriate flags that members have issued for this media. |
| isPublicCommentingAllowed | true or false. Default is true. Members can comment as long as they are logged and the item is not disabled. |
| isPublicTaggingAllowed | true or false. Default is true. The member who owns the item can specify whether others can tag it. |
| isTranscoded | Videos and audio files that are MP3s are transcoded and formatted. Files that are not transcoded will not appear in play lists. |
| isRatedByMe | true or false. Default is false. Whether or not the member has already rated this media Id. |
| isVisible | true or false. Default is true. |
| name | The name given to the media when it was uploaded. |
| pathtoMedia | The path to the stored media. |
| pathtoPreview | The path to the media preview:
|
| postalCode | The member's postal or zip code. |
| reviewed | true or false. Default is false. Whether or not an admin or webmaster has reviewed the media item on behalf of the community. |
| stateOrProvinceName | The U.S. state or Canadian province of the member who uploaded this media. |
| tags | Zero or more searchable, descriptive keywords entered by members. Appears as a comma-separated list. |
| type | The media type. audio, photo or video. KIT Cloud Social's sample applications use type to check for the Flash player to use to display the file to members. |
| updatedAt | A nested object stating when the media was created in the following format. All times are returned as Greenwich Mean Time (GMT).
This would appear as follows:
|
| uploadedByPhoto | The path to the profile photo of the member who uploaded the media. |
| uploadedByName | The username of the member who uploaded the media. |
| uploadToAkamai | Date and timestamp of upload to CDN that KIT Cloud Social uses for storing video files. |
| uploadToLimelight | Date and timestamp of upload to CDN that KIT Cloud Social uses for storing video files. |
| userId | The numeric ID of the person who uploaded the media. |
| views | The number of times this media item was viewed. views increments each time the media item is viewed. |
| votes | The number of votes made for this media item. |
| numOfTimesRated1 | The number of times this media item was rated 1. (In scope of Contests release.) |
| numOfTimesRated2 | The number of times this media item was rated 2. (In scope of Contests release.) |
| numOfTimesRated3 | The number of times this media item was rated 3. (In scope of Contests release.) |
| numOfTimesRated4 | The number of times this media item was rated 4. (In scope of Contests release.) |
| numOfTimesRated5 | The number of times this media item was rated 5. (In scope of Contests release.) |
| isPrivacyEnabled | True or False. True if the media is private. False if media is public. |
| isAddToMediaSetAllowed | Boolean. True or False. Indicates if the media contributor has restricted the media from being added to sets that belong to other members. True if its restricted. False if not restricted. |
- contest. A nested object that contains the following for the contest this media object is entered in. This will be empty if the media object is not a contest entry.
| id | Id of the contest this media is associated with. (5.2.1) Note: If this is 0, no other contest fields will be returned. |
| entryId | Id of the contest entry this media is associated with. (5.2.1) |
| communityRank | The rank of this entry based on community voting and the Bayesian Ranking. (5.2.1) |
| rank | The rank of this entry as selected by the site administrator. (5.2.1) |
| votingStartDate | The date on which the voting period starts for the contest. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time. (5.2.1) |
| votingEndDate | The date on which voting will be closed for the currently running contest. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time. (5.2.1) |
| votingEnabled | Is community voting enabled for this contest? true or false(5.2.1) |
| votingType | The type of voting that will be used. The available options are: thumbs, stars and votes.(5.2.1) |
| winnerAnnounceDate | The date on which the contest will announce its winner. Formatted as POSIX time: http://en.wikipedia.org/wiki/Unix_time.(5.2.1) |
| timeZone | Time zone the contest dates apply to expressed as an offset from UTC – See: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones . (5.2.1) |
List of Kit Cloud Social API Calls
Note: Occasionally (and without advanced warning) we modify our API calls by adding new parameters in the response payload. Please keep this in mind when designing your strategy for parsing our responses.
Favorites






