OTT API V6
All parameters and it’s values are case-sensitive. token parameter is required for every request. This API only accept GET method.
Get Content List –
End Point – https://api2.plansinfo.com/v6/ott/content/list
Request Parameters –
- addedAfter (optional)- It will list contents which are added in database after this date-time. Supported Format – 2017-07-19T18:30:00.000Z
- source (optional)- It filter list with given OTT.
- releaseYear (optional)- It will filter list with given release year.
- contentType (optional)- It will filter MOVIE or SHOW.
- term (optional) – It will search for a show or movie.
Response Object –
- id – A unique identifier for content.
- title – title of content.
- contentType – Content type MOVIE or SHOW.
Get content Details –
End Point – https://api2.plansinfo.com/v6/ott/content/details
Request Parameters –
- id (required)- Id of content.
Response Object –
- title (VARCHAR)- Title of content.
- id (INT) – Id of content.
- releaseYear (SMALLINT)- Release Year of content.
- releaseDate (DATETIME) – Release Date of content.
- duration (SMALLINT)- Duration of movie in seconds. For shows it will be null.
- contentType (VARCHAR)- Type of content (MOVIE/SHOW) .
- originalLanguage New (VARCHAR) – Original Languages of content.
- languages (array) – All languages in which content is available.
- seasons New (array) – name, number and releaseDate of season.
- genres (array) – All genres of content.
- description (TEXT) – Description of content.
- poster (URL) – A poster of content of size 400X578.
- images (array) – All images available for content.
- active (bool) – Some times invalid movies/shows are added in database. If this parameter is false then it means content should be removed/replaced.
- cast (array) – An array of actors/actress.
- imdb (object) – titleId, rating, votes will be available here.
- youtube (object) – trailerLink will be available here.
- addedAt (DATETIME) – Date time when content was added in our database.
Songs API-
End Point – https://api2.plansinfo.com/v6/ott/songs
Request Parameters–
- contentId (Integer) – Id of the movie.
Response Object –
- songs [array]- List of songs.
- name (string) – Name of song.
- duration (int) – Duration of song in seconds.
- link (URL) – Spotify link of song.
Crew API
End Point – https://api2.plansinfo.com/v6/ott/crew
Example– https://api2.plansinfo.com/v6/ott/crew?id=6629&token=jjhhh
Request Parameters–
- id (integer) – id of crew.
Response Object –
- name (varchar) – name of person.
- realName (varchar) – Original name of person.
- gender (varchar) – gender of person.
- primaryDepartment (varchar) – Primary profession of person.
- height (int)- height in centimeter.
- weight (int) – weight in kilogram.
- zodiacSign (varchar) – zodiac sign of person.
- netWorth (varchar) – net worth of person.
- religion (varchar) – religion of person.
- nationality (varchar) – nationality of person.
- birthDate (DATETIME) – Birth date of person.
- birthPlace (varchar)- Birth place of person.’
- maritalStatus (varchar) – Current marital status of person.
- education (varchar)- Highest educational qualification of person.
- debut (array) – category wise debut movies or show of person.
- relations (array) – Wife, Husband, Son, Daughter and other relations.
Episodes API –
End Point – https://api2.plansinfo.com/v6/ott/episodes
Example– https://api2.plansinfo.com/v6/ott/episodes?contentId=21133&token=jjhhh
Request Parameters–
- contentId (Integer) – Id of the show.
Response Object –
- episodes (array) – Array of episodes.
- seasonNumber (int)- Number of season.
- episodeNumber (int) – Number of episode.
- duration (int) – Episode duration in seconds
- episodeName (varchar) – Name of episode.
- releaseDate (DateTime)- Release date of episode.
- description (Text) – Description of episode.
- crew (array) – Array of Crew . Crew object is similar as content details API.
Webhook –
You can set up a webhook to receive real-time updates when contents are added or modified.
Our server will post a JSON payload at URL provided by you.
Payload Objects-
- service (VARCHAR)- Its value will be OTT always (reserved for future).
- event (VARCHAR)- It’s value can be INSERT, UPDATE, DELETE or SYNC. (For now, please ignore this parameter and use a common logic to handle all events)
- entityType (VARCHAR)- It’s value will be CONTENT, (For now there is a single endpoint to get rating and content details, so please ignore this parameter)
- entityId (INT)- An unique identifier of content.
Sample Webhook data-
{
"event": "INSERT",
"service": "OTT",
"entityType": "CONTENT",
"entityId": 26372
}
Sample PHP code to read webhook response –
<?php
//read posted JSON data
$data=json_decode(file_get_contents('php://input'),false);
//get entitId from data
$contentId=$data->entityId;
//call content details API to get details and update content in your database
//if update is success
echo "success"; //display any text like success or done .
//in case of failure
//http_response_code(500); //500 or any response code not equal to 200 are treated as //failure.
//echo "failed"; //display any text like failed or error message .
?>
Once you receive a webhook request from our server, please call our API to get content details and update data in your database. Please send HTTP Code 200 if your update is done, all other HTTP codes will be treated as an error. Our server will try maximum 3 times for a single webhook in case of error.