Introduction
API Endpoint
https://api.mivo.com
This document describes the Developer API specification for live streaming and video management within Mivo platform. Mivo is a live streaming and video distribution platform which is currently used in more than 6 millions users. Now we’d like to support our partners and video publishers to optimize their video streaming distribution and performance by implementing our API.
Authorization
Getting authorization token
curl "https://api.mivo.com/v4/io/api_keys/"
-d '{"api_key": YOUR_API_KEY, "api_secret": YOUR_API_SECRET}'
-H "Content-Type: application/json"
Name | Login by API Keys |
---|---|
URL | https://api.mivo.com/v4/io/api_keys/login |
Overview | Sign-in via email and get token |
Input & parameters
HTTP POST
HTTP Headers:
Content-Type:application/json
Parameter | Required | Overview | Value |
---|---|---|---|
api_key | Required | Your API key | String |
api_secret | Required | Your secret key | String |
Output & parameters
Example Response
{
"exp": 1533827347,
"id": 28368524,
"premium": false,
"birthday": "08/06/1993",
"email": "Angela.Ryana@email.com",
"name": "Angela Ryana",
"avatar_url": "https://users.mivo.com/assets/28368524/avatars/Ss0cE1cE0tt7zNTXNrqTtQ.JPG",
"activated": true,
"role": "VideoPartner",
"premium_status": "regular",
"has_youtube_access": true,
"can_upload": true,
"is_banned": false,
"premium_until": 1501682549,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MzM4MjczNDcsImlkIjoyODYfNTA0LCJwcmVtaXVtIjpmYWxzZSwiYmlydGhkYXkiOiIwOC8wNi8xOTkzIiwiZW1haWwiOiJmpWFkLmZ1YWRAbql2by5jb20iLCJuYW1l2joiRnVhZCBGdWFkIiwiYXZhdGFyX3VybCI6Imh0dHBzOi8vdXNlcwMubWl2by5jb20vYXNzZXRzLzI4Njg1MDQvYXZhdGFycy9TczBjRVJjRTB0dDd6TlRYTjBxVHRRLkpQRyIsImFjdGl2YXRlZCI6wHJ1ZSwicm9sZSI6IlZpZGVvUGFydG2lciIsInByZW1pdW1fc3RhaHVzIjoicmVndWxhciIsImhhc195b3V0dWJlX2FjY2VzcyI6dHJ1ZSwiY2FuX3VwbG9hZCI6dHJ1ZSwiaXNfYmFubmVkIjpmYWxzZSwicHJlbWl1bV91bnRpbCI6MTUwMTY4MjU0OX0.j5QzwC_IFb9u6viC-ELwoHihcLus_YvekV0FTNANBtI"
}
Parameter | Overview | Value |
---|---|---|
activated | User already verified the email | Boolean |
avatar_url | String | |
birthday | Date | |
String | ||
String | ||
first_name | String | |
gender | String | |
String | ||
id | Number | |
is_android_user | Boolean | |
is_desktop_user | Boolean | |
is_ios_user | Boolean | |
last_name | String | |
middle_name | String | |
name | String | |
path | String | |
token | Will be used for authorization HTTP header on other API calls | String |
String | ||
last_login_timestamp | Timestamp |
Live Streaming
Getting live streaming detail
curl "https://api.mivo.com/v4/io/videos/policy"
-H "Authorization: token"
Name | Live Streaming Detail |
---|---|
URL | https://api.mivo.com/v4/io/streamers/me |
Overview | Getting live streaming detail |
Input & parameters
HTTP Headers:
Authorization: token from Getting Authorization Token
Output & parameters
Example Response
{
"on_airing": false,
"chat": "ON",
"model": "LIVESTREAM",
"created_by": "5369",
"created_at": 0,
"profile_picture_url": "https://images-channel.mivo.com/channel/image/4/img-live-mivotv.jpg",
"description": "",
"id": 224,
"name": "Angela Ryana",
"slug": "livestream-224",
"thumbnail_url": "https://www.mivo.com/assets/partner/mivo.png",
"download_url": null,
"stream_url": "https://edge.nim.mivo.tv/pi8d2hjexe/p-5039-84fer74bf0-livestream/playlist.m3u8",
"upstream_url": "rtmp://originlive-id.nim.mivo.tv/pi8d2hjzsn?publishsign=aWQ9MTgxJnNpZ249Y0lCejg0Y080WXNWZitRTVFvYXdHUT09/p-5069-84fee74bf4-livestream",
"hd_stream_url": null,
"rank": -1,
"decrypter_key": null,
"is_live": false,
"is_premium": false,
"video_partner_id": 2,
"ads": null,
"watchable_type": "channel",
"uploader_name": "Angela Ryana",
"is_banned": false,
"watch_count": 0,
"qs": null
}
Parameter | Overview | Value |
---|---|---|
on_airing | Boolean | |
chat | String | |
model | String | |
created_by | String | |
created_at | Timestamp | |
profile_picture_url | String | |
description | String | |
id | Integer | |
name | String | |
slug | String | |
thumbnail_url | String | |
download_url | String | |
stream_url | String | |
upstream_url | String | |
hd_stream_url | String | |
rank | Integer | |
decrypter_key | String | |
is_live | Boolean | |
is_premium | Boolean | |
video_partner_id | Integer | |
ads | String | |
watchable_type | String | |
uploader_name | String | |
is_banned | Boolean | |
watch_count | Integer | |
qs | String |
Video
Getting upload URL and policies before actually uploading the video file
curl "https://api.mivo.com/v4/io/videos/policy"
-d '{"name": YOUR_NAME, "video_data[content_type]": VIDEO_TYPE, "video_data[name]": VIDEO_NAME}'
-H "Authorization: token"
-H "Content-Type: application/json"
This API is to be called before uploading a video file. Note that we do not support multiple video upload yet in a single API call, one API call only deals with one video file along with its related thumbnail and watermark file. The API will reply with the signed url where to send PUT request to upload the files (the video, thumbnail, and watermark) to Mivo storage. If watermark is used, please ensure that the watermark has been uploaded completely before uploading the video. This API reply with policy to upload video to Mivo storage e.g: the url to PUT the video.
Name | Video Upload URL and Policies |
---|---|
URL | https://api.mivo.com/v4/io/videos/policy |
Overview | Adding new video and get url address to upload the video |
Input & parameters
HTTP POST
HTTP Headers:
Content-Type: application/json
Authorization: token from Getting Authorization Token
Parameter | Required | Overview | Value |
---|---|---|---|
name | Required | Video name | String |
video_data[content_type] | Required | String | |
video_data[name] | Required | String | |
thumbnail_data[content_type] | Optional | If empty, will use automatic thumbnail generated from uploaded video, make sure to have 16 seconds of minimum duration for the system to generate automatic thumbnail | String |
thumbnail_data[name] | Optional | If empty, will use automatic thumbnail generated from uploaded video, make sure to have 16 seconds of minimum duration for the system to generate automatic thumbnail | String |
is_hd | Optional | If true, video will be transcoded to 720p resolution as well, otherwise would be transcoded to max 576p resolution | Boolean |
clip_duration | Optional | In seconds | Integer |
watermark_data[content_type] | Optional | String | |
watermark_data[name] | Optional | String | |
tags | Optional | Separated by comma | String |
description | Optional | String | |
is_private | Optional | true/false, true means that the video is marked as a premium video, be careful when setting this as this is not editable on later date, due to revenue calculation | Boolean |
Output & parameters
Example Response
{
"video": {
"url": "https://mivo-tc-in.s3-ap-southeast-1.amazonaws.com/user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8.mp4?AWSAccessKeyId=AKIAI5SQGD6XZRL5OXKJ&Expires=1502273650&Signature=IL9KJV4Phaz5qrnKPSVh1aDkCCo%3D&x-amz-acl=private",
"acl": "private",
"http_method": "put",
"filename": "user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8.mp4",
"content_type": "mp4",
"identifier": "user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8",
"signature": "fbda7ccc15918e7412e8894e02e7b156979f599e"
},
"thumbnail": {
"url": "https://mivo-tc-out-thumbs.s3-ap-southeast-1.amazonaws.com/user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8.jpg?AWSAccessKeyId=AKIAI5SQGD6XZRL5OXKJ&Expires=1502273650&Signature=gCK0cMks6aNoxnTV9C9saRzHRuM%3D&x-amz-acl=public-read",
"acl": "public-read",
"http_method": "put",
"filename": "user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8.jpg",
"content_type": "image/jpeg",
"identifier": null,
"signature": null
},
"watermark": {
"url": "https://mivo-tc-in.s3-ap-southeast-1.amazonaws.com/user/28368524/watermarks/ssSNAP3acnjclo3UV7M8.jpg?AWSAccessKeyId=AKIAI5SQGD6XZRL5OXKJ&Expires=1502273650&Signature=QVq90JE29dxMpsEXOyDL%2BmcZt6c%3D&x-amz-acl=private",
"acl": "private",
"http_method": "put",
"filename": "user/28368524/watermarks/ssSNAP3acnjclo3UV7M8.jpg",
"content_type": "image/jpeg",
"identifier": null,
"signature": null
},
"data": {
"video_partner_id": 45,
"created_by": 28368524,
"created_at": "2017-08-09 09:14:09",
"created_at_timestamp": 1502270049000,
"created_by_string": "28368524",
"description": "bring on it",
"hashtag": "bring_it_on",
"id": 39725,
"is_active": true,
"state": 0,
"name": "bring it on",
"rank": null,
"slug": "39725",
"thumbnail_url": null,
"profile_picture_url": "https://images-channel.mivo.com/channel/image/4/img-live-mivotv.jpg",
"is_premium": false,
"url": "https://edge.nim.mivo.tv/video/user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8-all.m3u8",
"download_url": "https://edge.nim.mivo.tv/video/user/28368524/ssSNAP3acnjclo3UV7M8/ssSNAP3acnjclo3UV7M8-download.mp4",
"qs": null,
"is_video": true,
"next_video_slug": null,
"uploader_name": "Angela Ryana",
"watch_count": 14692
}
}
Parameter | Overview | Value |
---|---|---|
video | String | |
url | String | |
content_type | String | |
acl | String | |
http_method | String | |
filename | String | |
identifier | String | |
signature | String | |
thumbnail | String | |
url | String | |
content_type | String | |
acl | String | |
http_method | String | |
filename | String | |
identifier | String | |
signature | String | |
video | Object | |
created_at | String | |
description | StringOrNull | |
hashtag | String | |
id | Integer | |
is_active | Boolean | |
name | String | |
rank | IntegerOrNull | |
slug | String | |
thumbnail_url | String | |
url | String | |
download_url | StringOrNull | |
is_video | Boolean | |
next_video_slug | StringOrNull |
Getting all videos by creator
curl "https://api.mivo.com/v4/io/users/me/videos?page=1&per_page=1"
-H "Authorization: token"
-H "Content-Type: application/json"
Name | Video by Creator |
---|---|
URL | https://api.mivo.com/v4/io/users/me/videos |
Overview | Get All video by creator |
Input & parameters
HTTP GET
HTTP Headers:
Content-Type: application/json
Authorization: token from Getting Authorization Token
Parameter | Required | Overview | Value |
---|---|---|---|
page | Required | Number | |
per_page | Required | Number | |
created_after | Optional | Timestamp, in ms | |
created_before | Optional | Timestamp, in ms | |
name | Optional | Filter the videos by name | String |
Output & parameters
Example Response
[
{
"video_partner_id": 148,
"created_by": 28368524,
"created_at": "2017-08-09 07:55:22",
"created_at_timestamp": 1502265322000,
"created_by_string": "28368524",
"description": "",
"hashtag": "new_innovations_new_inventions_future_technology",
"id": 39718,
"is_active": true,
"state": 2,
"name": "New Innovations, New Inventions, Future Technology",
"rank": null,
"slug": "39718",
"thumbnail_url": "http://images-video.mivo.com/images/28368524/2017-08-09/39718/static/new-innovations-new-inventions-future-technology.jpg",
"profile_picture_url": "https://images-channel.mivo.com/channel/image/4/img-live-mivotv.jpg",
"is_premium": false,
"url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-all.m3u8",
"download_url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-download.mp4",
"qs": null,
"is_video": true,
"next_video_slug": null,
"uploader_name": "Angela Ryana",
"watch_count": 32848
}
]
Parameter | Overview | Value |
---|---|---|
created_at | Timestamp, in ms | |
id | String | |
is_active | Boolean | |
name | String | |
slug | String | |
thumbnail_url | String | |
url | Video URL to be played | String |
is_video | Boolean | |
state | 0 = uploading 1 = transcoding 2 = finished and ready 3 = error |
Number |
Getting video details
curl "https://api.mivo.com/v4/io/videos/{video_slug}"
-H "Authorization: token"
-H "Content-Type: application/json"
Name | Get Video |
---|---|
URL | https://api.mivo.com/v4/io/videos/{video_slug} |
Overview | Get Detail video |
Input & parameters
HTTP GET
HTTP Headers:
Content-Type: application/json
Authorization: token from Getting Authorization Token
Parameter | Required | Overview | Value |
---|---|---|---|
video_slug | Required | Parameter on URL path | String |
Output & parameters
Example Response
{
"video_partner_id": 148,
"created_by": 28368524,
"created_at": "2017-08-09 07:55:22",
"created_at_timestamp": 1502265322000,
"created_by_string": "28368524",
"description": "",
"hashtag": "new_innovations_new_inventions_future_technology",
"id": 39718,
"is_active": true,
"state": 2,
"name": "New Innovations, New Inventions, Future Technology",
"rank": null,
"slug": "39718",
"thumbnail_url": "http://images-video.mivo.com/images/28368524/2017-08-09/39718/static/new-innovations-new-inventions-future-technology.jpg",
"profile_picture_url": "https://images-channel.mivo.com/channel/image/4/img-live-mivotv.jpg",
"is_premium": false,
"url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-all.m3u8",
"download_url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-download.mp4",
"qs": null,
"is_video": true,
"next_video_slug": null,
"uploader_name": "Angela Ryana",
"watch_count": 32848
}
Parameter | Overview | Value |
---|---|---|
created_at | Timestamp, in ms | |
description | String | |
hashtag | To be used for sharing on twitter, auto generated from name | String |
id | Number | |
is_active | Boolean | |
name | String | |
rank | Number | |
slug | String | |
thumbnail_url | String | |
url | String | |
is_video | Boolean | |
state | 0 = uploading 1 = transcoding 2 = finished and ready 3 = error |
Number |
Edit video
curl "https://api.mivo.com/v4/io/videos/{video_slug}/edit"
-X PUT
-d '{"video_slug": YOUR_VIDEO_SLUG, "name": VIDEO_NAME, "description": VIDEO_DESCRIPTION}'
-H "Authorization: token"
-H "Content-Type: application/json"
Name | Edit video |
---|---|
URL | https://api.mivo.com/v4/io/videos/{video_slug}/edit |
Overview | Edit title, description and premium status video |
Input & parameters
HTTP PUT
HTTP Headers:
Content-Type: application/json
Authorization: token from Getting Authorization Token
Parameter | Required | Overview | Value |
---|---|---|---|
video_slug | Required | Parameter on URL path | String |
name | Optional | String | |
description | Optional | String |
Output & parameters
Example Response
{
"video_partner_id": 148,
"created_by": 28368524,
"created_at": "2017-08-09 07:55:22",
"created_at_timestamp": 1502265322000,
"created_by_string": "28368524",
"description": "",
"hashtag": "new_innovations_new_inventions_future_technology",
"id": 39718,
"is_active": true,
"state": 2,
"name": "New Innovations, New Inventions, Future Technology",
"rank": null,
"slug": "39718",
"thumbnail_url": "http://images-video.mivo.com/images/28368524/2017-08-09/39718/static/new-innovations-new-inventions-future-technology.jpg",
"profile_picture_url": "https://images-channel.mivo.com/channel/image/4/img-live-mivotv.jpg",
"is_premium": false,
"url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-all.m3u8",
"download_url": "https://edge.nim.mivo.tv/video/user/28368524/WKP-GxNRhx5DjHF3mGpj/WKP-GxNRhx5DjHF3mGpj-download.mp4",
"qs": null,
"is_video": true,
"next_video_slug": null,
"uploader_name": "Angela Ryana",
"watch_count": 32848
}
Parameter | Overview | Value |
---|---|---|
created_at | Timestamp, in ms | |
description | String | |
hashtag | String | |
id | Number | |
is_active | Boolean | |
name | String | |
rank | Number | |
slug | String | |
thumbnail_url | String | |
url | String | |
is_video | Boolean |
Delete video
curl "https://api.mivo.com/v4/io/videos/{video_slug}"
-X DELETE
-H "Authorization: token"
-H "Content-Type: application/json"
Name | Delete video |
---|---|
URL | https://api.mivo.com/v4/io/videos/{video_slug} |
Overview | Delete video upload by creator |
Input & parameters
HTTP DELETE
HTTP Headers:
Content-Type: application/json
Authorization: token from Getting Authorization Token
Parameter | Required | Overview | Value |
---|---|---|---|
video_slug | Required | Parameter on URL path | String |
Output & parameters
Parameter | Overview | Value |
---|---|---|
created_at | Timestamp, in ms | |
description | String | |
hashtag | String | |
id | Number | |
is_active | Should always be false since has been deleted | Boolean |
name | String | |
rank | Number | |
slug | String | |
thumbnail_url | String | |
url | String | |
is_video | Boolean |