Filespot API v 1.0

API is under development. All changes and new features will be captured in this documentation as soon as they will be deployed. All requests should be sent to URL

https://api.platformcraft.ru/1

Access

For each request following parameters are mandatory:

  1. apiuserid - id provided by your personal manager in Platformcraft
  2. timestamp - current time in UNIX format
  3. hash - APIUserKey (HMAC hash-sum in hexadecimalс format using SHA-256 and user key)

Request example to get the HMAC hash-sum to authentication

APIUserKey:

APIUserKey

Request:

GET+api.platformcraft.ru/1/objects?apiuserid=test&timestamp=1450342665

Response:

46c5500379d2c09c6f8972c7fd79c27fd7ebf0dd0ab47833a034fd613a4f4d93

Endpoints

/objects

Description Method to uploading of file into container
Endpoint https://api.platformcraft.ru/1/objects
Method POST
Body content type multipart/form-data
Response Information about the file to upload
Parameters
file The file to upload. Mandatory.
name To create the name of the file to upload and determination of path of it "/folder/folder2/filename.ext". Optional.
private Specifying the privacy of a file(private=true, The file is private). Optional.
Parameters for autocoding and autoplayer
autoencoding Automatic transcoding of video file (possible values: true, false). Optional, for video files only. The parameter is ignored for users who are not subscribed to the video file transcoding service.
presets Preset IDs for autocoding, separated by ",". Optional, counted only when autoencoding = true. Example: presets=566b0fbf044dfe64f2000002,566b0fbf044dfe64f2000003
del_original Delete the original file after autocoding (possible values: true, false). Optional, counted only when autoencoding = true.
autoplayer Automatic creation of the videoplayer (possible values: true, false). Optional, for video files only. If autoencoding = false, the player will be created from one original file. If autoencoding = true, then the videoplayer will be created from the transcoded video files.

A basic example of a file uploader using this method.

    https://api.platformcraft.ru/1/objects?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Example of response

{
    "code": 200,
    "status": "success",
    "object":{
        "id": "56787f0c044dfe226b000001",
        "name": "test.mp4",
        "path": "/test.mp4",
        "is_dir": false,
        "size": 985781,
        "content_type": "video/mp4",
        "create_date": "22.12.2015T01:37:00",
        "latest_update": "",
        "resource_url": "api.platformcraft.ru/objects/56787f0c044dfe226b000001",
        "cdn_url": "cdn.platformcraft.ru/billy/test.mp4",
        "vod_hls": "customer.cdn.ru/customer-vod/_definst_/mp4:billy/test.mp4/playlist.m3u8",
        "video": "video.platformcraft.ru/56787f0c044dfe226b000001",
        "private": false,
        "status": "ok"
    },
    "storage": {
        "used": 97537237,
        "limit": 107374182
    }
}
Description Method to getting list of all objects (files) in container
Endpoint https://api.platformcraft.ru/1/objects
Method GET
Response The list of all objects (files) in container
Filter parameters
folder Target folder to getting files. Examle: "/test".If the parameter is not specified, the files will be search across all the directories of the account. Optional.
name Name of file. Example: "test.mp4". Optional.
ext Extantion of file. Example: "mp4". Optional.
private Privacy of file (private=true - show only private files, private=false - show only public files). Optional.
show_folders Show folders (show_folders=true - show folders with files). Optional.
Pagination parameters
limit Number of objects on one page. Optional. If there is no parameter "limit" in the request, all user objects are returned.
start How many objects in the list need to be skipped. Optional, only counted with a positive parameter "limit".
pagingts Unix-timestamp. Only those objects whose creation time is less than or equal to the time corresponding to "pagingts" parameter are returned. Optional, only counted with a positive limit.
    https://api.platformcraft.ru/1/objects?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571&limit=2

Example of response

{
    "code": 200,
    "status": "success",
    "count": 10,
    "count_on_page": 2,
    "paging": {
        "next": "api.platformcraft.ru/1/objects?pagingts=1516189378&limit=2&start=2", # link to the next page. null if the current page is the last one. Important: do not forget to sign the "next" request when sending to the server (см. https://doc.platformcraft.ru/filespot/api/#_1)
        "prev": null                                                                  # link to the previous page. null if the current page is the first. Important: do not forget to sign the "prev" request when sending to the server (см. https://doc.platformcraft.ru/filespot/api/#_1)
    },
    "objects": [
        {
            "id": "56787f0c044dfe226b000001",
            "name": "test.mp4",
            "path": "/test.mp4",
            "is_dir": false,
            "size": 985781,
            "content_type": "video/mp4",
            "create_date": "22.12.2015T01:37:00",
            "latest_update": "",
            "resource_url": "api.platformcraft.ru/objects/56787f0c044dfe226b000001",
            "cdn_url": "cdn.platformcraft.ru/billy/test.mp4",
            "vod_hls": "customer.cdn.ru/customer-vod/_definst_/mp4:billy/test.mp4/playlist.m3u8",
            "video": "video.platformcraft.ru/56787f0c044dfe226b000001",
            "private": true,
            "status": "ok"
        },
        {
            "id": "56787f0c044dfe226b000002",
            "name": "test1.mp4",
            "path": "/test1.mp4",
            "is_dir": false,
            "size": 985781,
            "content_type": "video/mp4",
            "create_date": "22.12.2015T01:37:00",
            "latest_update": "",
            "resource_url": "api.platformcraft.ru/objects/56787f0c044dfe226b000002",
            "cdn_url": "cdn.platformcraft.ru/billy/test1.mp4",
            "vod_hls": "customer.cdn.ru/customer-vod/_definst_/mp4:billy/test1.mp4/playlist.m3u8",
            "video": "video.platformcraft.ru/56787f0c044dfe226b000001",
            "private": false,
            "status": "ok"
        }
    ],
}
Description Method to getting detailed information about the object (file)
Структура URL https://api.platformcraft.ru/1/objects/{:object_id}
Method GET
Response Detailed information about the object with the selected id
https://api.platformcraft.ru/1/objects/56787f0c044dfe226b000001?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Example of response

{
    "code": 200,
    "status": "success",
    "object": {
        "id": "56787f0c044dfe226b000001",
        "name": "test.mp4",
        "path": "/test.mp4",
        "is_dir": false,
        "size": 985781,
        "content_type": "video/mp4",
        "create_date": "22.12.2015T01:37:00",
        "latest_update": "",
        "resource_url": "api.platformcraft.ru/objects/56787f0c044dfe226b000001",
        "cdn_url": "cdn.platformcraft.ru/billy/test.mp4",
        "vod_hls": "customer.cdn.ru/customer-vod/_definst_/mp4:billy/test.mp4/playlist.m3u8",
        "video": "video.platformcraft.ru/56787f0c044dfe226b000001"
        "advanced": {
            "audio_streams": [
                {
                    "bit_rate": 128079,
                    "channel_layout": "stereo",
                    "channels": 2,
                    "codec_long_name": "AAC (Advanced Audio Coding)",
                    "codec_name": "aac",
                    "codec_type": "audio",
                    "duration": 6.61712,
                    "index": 0,
                    "sample_rate": 44100
                }
            ],
            "format": {
                "bit_rate": 24756,
                "duration": 6.618,
                "format_long_name": "QuickTime / MOV",
                "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
                "nb_streams": 2
            },
            "video_streams": [
                {
                    "bit_rate": 1062457,
                    "codec_name": "h264",
                    "codec_type": "video",
                    "codeclongname": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "display_aspect_ratio": "16:9",
                    "duration": 6.573233,
                    "fps": 29.97002997002997,
                    "height": 360,
                    "index": 1,
                    "width": 640
                }
            ]
        },
        "previews":[
            "cdn.platformcraft.ru/billy/.previews/preview-569fa828534b446996058b6d",
            "cdn.platformcraft.ru/billy/.previews/preview-569fa828534b446996058b70",
            "cdn.platformcraft.ru/billy/.previews/preview-569fa828534b446996058b73"
        ],
        "description": "test file description",
        "private": false,
        "status":"ok"
    },
}
Description Method to deleting object (file) with the selected id
Endpoint https://api.platformcraft.ru/1/objects/:id
Method DELETE
Response Status
https://api.platformcraft.ru/1/objects/56787f0c044dfe226b000001?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Example of response

{
    "code": 200,
    "status": "success",
}
Description Method to changing object with selected id
Endpoint https://api.platformcraft.ru/1/objects/:id
Method PUT
Body content type JSON
Response Status
Comments Expect additions

Request body format

{
    "name": "String",        # new name of object(file)
    "folder": "String",      # new folder for the file, example: "/test". The parameter is ignored when the value is empty
    "description": "String", # description of file (maximum quantity of symbol: 1500)
    "max_height": Int,       # maximum height (it is used only for generation of images on the fly, permissible values are not more than 2160)
    "max_width": Int,        # maximum width (it is used only for generation of images on the fly, permissible values are not more than 3840)
    "private": Bool          # privacy of file
}

Example of response

{
    "code": 200,
    "status": "success",
}

/temp

Description Method to adding temporary ulr for object
Endpoint https://api.platformcraft.ru/1/temp
Method POST
Request body content JSON
Response Information about temporary url

Request body format

{

    "object_id": "String",  # object id
    "endless":   Bool,      # true – endless url, false – expiration is limited by parametre "exp"
    "exp":       Int,       # timestamp - expiration (if endless = false)
    "secure":    Bool       # enable protection for temporary url (hmac-sha256)
    "geo":       map["String"]map["String"]Bool # geo limitations

}

geo format

geo: dictionary map[continent]map[country]true, where continent, country - ISO codes, e.g. EU and RU respectively. If country == "ALL", then access to all countries within the continent is allowed.
Examples
geo = null {allow all countries}
geo = {"EU":{"ALL": true}, "NA":{"ALL": true}} { allow all countries inside Europe and North America }
geo = {"EU": {"RU": true}} { allow only Russia }

Note: all continent and country codes must be in capital letters.

Example of request

https://api.platformcraft.ru/1/temp?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

{
    "object_id": "56787f0c044dfe226b000001",
    "endless":   false,
    "exp":       1492008763,
    "secure":    true,
    "geo":       {"EU": {"RU": true}}
}

Response format

{
    "code": Int,                # http code (200)
    "status": "String",         # status (success)
    "link": {
        "id":        "String",  # url id
        "object_id": "String",  # object id
        "href":      "String",  # cdn url of object
        "secure":     Bool,     # protected url or not
        "exp":        Int,      # timestamp - expiration time (0 - endless)
        "for_sale":   Bool,     # url is for sale or not
        "geo":        map["String"]map["String"]Bool # geo limitations
    }

}

Example of response

{
    "code": 200,
    "status": "success",
    "link": {
        "id":"58ee48ca534b4409844c8f7a",
        "object_id":"56787f0c044dfe226b000001",
        "href":"cdn.platformcraft.ru/temp/58ee48ca534b4409844c8f7a",
        "secure":true,
        "exp":1492008763,
        "for_sale":false,
        "geo": {"EU": {"RU": true}}
    }
}
Description Method to getting list of temporary urls
Endpoint https://api.platformcraft.ru/1/temp
Method GET
Response List of temporary urls
Query string parameters
object_id Filter by object id. Optional.
for_sale Filter by using for_sale parameter (for_sale = true - show only urls for sale , for_sale = false - do not show urls for sale). Optional.
secure Filter by using paramter secure (secure = true - show only secure urls, secure = false - do not show secure urls). Optional.

Example of request

https://api.platformcraft.ru/1/temp?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571&secure=true

Response format

{
    "code": Int,                     # http code (200)
    "status": "String",              # status (success)
    "count": Int,                    # quantity of urls
    "links":[
        {
            "id":        "String",  # url id
            "object_id": "String",  # object id
            "href":      "String",  # cdn url of object
            "secure":     Bool,     # protected url or not
            "exp":        Int,      # timestamp of expiration time (0 - endless)
            "for_sale":   Bool,     # url for sale or not
            "geo":        map["String"]map["String"]Bool # geo limitations
        }
    ]
}

Example of response

{
    "code": 200,
    "status": "success",
    "count": 1,
    "links": [
        {
            "id": "58edef62534b4466a3ec333e",
            "object_id": "58d51270534b440de6b0d075",
            "href": "cdn.platformcraft.ru/temp/58edef62534b4466a3ec333e",
            "secure": true,
            "exp": 0,
            "for_sale": false,
            "geo": {"EU": {"RU": true}}
        }
    ],
}
Description Method to getting information about temporary url
Endpoint https://api.platformcraft.ru/1/temp/{:link_id}
Method GET
Response Information about temporary url

Example of request

https://api.platformcraft.ru/1/temp/58edef62534b4466a3ec333e?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,                # http code (200)
    "status": "String",         # status (success)
    "link": {
        "id":        "String",  # url id
        "object_id": "String",  # object id
        "href":      "String",  # cdn url of object
        "secure":     Bool,     # protected url or not
        "exp":        Int,      # timestamp of expiration time (0 - endless)
        "for_sale":   Bool,     # url for sale or not
        "geo":        map["String"]map["String"]Bool # geo limitations
    }

}

Example of response

{
    "code": 200,
    "status": "success",
    "link": {
        "id":"58edef62534b4466a3ec333e",
        "object_id":"56787f0c044dfe226b000001",
        "href":"cdn.platformcraft.ru/temp/58ee48ca534b4409844c8f7a",
        "secure":true,
        "exp":1492008763,
        "for_sale":false,
        "geo": {"EU": {"RU": true}}
    }
}
Description To delete the temporary url with selected ID
Endpoint https://api.platformcraft.ru/1/temp/{:link_id}
Method DELETE
Response Status

Example of request

https://api.platformcraft.ru/1/temp/58edef62534b4466a3ec333e?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Example of response

{
    "code": 200,
    "status": "success",
}

/streams

Description Method for adding mediastream
Endpoint https://api.platformcraft.ru/1/streams
Method POST
Body content type JSON
Response Information about created media stream

Request body format

{
        "name": "String", # mediastream name (mandatory)
        "url" : "String"  # rtmp or hls URL of mediastream (mandatory)
}

Example of request

https://api.platformcraft.ru/1/streams?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

{
    "name": "example",
    "url" : "rtmp://example.ru/example/example.sdp"
}

Response format

{
    "code": Int,                     # http code (200)
    "status": "String",              # status (success)
    "stream": {                      # information about media stream
        "id": "String",              # media stream ID
        "user": "String",            # user ID
        "name": "String",            # media stream name
        "url": "String",             # media strean URL
        "is_instant_recording": Bool # parameter indicating whether or not an instantaneous video stream recording is on
    }
}

Example of response

{
    "code": 200,
    "status": "success",
    "stream": {
        "id": "56edc536534b4478d3a83b7f",
        "user": "56bdf4a53f4f716301b09ba3",
        "name": "example",
        "url": "rtmp://example.ru/example/example.sdp",
        "is_instant_recording": false
    }
}
Description Method of getting information about all media streams
Endpoint https://api.platformcraft.ru/1/streams
Method GET
Response Information about all media streams
https://api.platformcraft.ru/1/streams?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,                         # http code (200)
    "status": "String",                  # status (success)
    "streams": [                         # array with information about all media streams
        {
            "id": "String",              # media stream ID
            "user": "String",            # user ID
            "name": "String",            # media stream name
            "url": "String",             # media stream URL
            "is_instant_recording": Bool # parameter indicating whether or not an instantaneous video stream recording is on
        },
        ...
    ]
}

Example of response

{
    "code": 200,
    "status": "success",
    "streams": [
        {
            "id": "56edc536534b4478d3a83b7f",
            "user": "56bdf4a53f4f716301b09ba3",
            "name": "example",
            "url": "rtmp://example.ru/example/example.sdp",
            "is_instant_recording": false
        }
    ]
}
Description Method to getting information about media stream
Endpoint https://api.platformcraft.ru/1/streams/{:stream_id}
Method GET
Response Information about media stream
https://api.platformcraft.ru/1/streams/56cec7e2fa63afd0f843567d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,                     # http code (200)
    "status": "String",              # status (success)
    "stream": {                      # information about media stream
        "id": "String",              # media stream ID
        "user": "String",            # user ID
        "name": "String",            # media stream name
        "url": "String",             # media strean URL
        "is_instant_recording": Bool # parameter indicating whether or not an instantaneous video stream recording is on
    }
}

Example of response

{
    "code": 200,
    "status": "success",
    "stream": {
        "id": "56edc536534b4478d3a83b7f",
        "user": "56bdf4a53f4f716301b09ba3",
        "name": "example",
        "url": "rtmp://example.ru/example/example.sdp",
        "is_instant_recording": false
    }
}
Description Method to delete media stream
Endpoint https://api.platformcraft.ru/1/streams/{:stream_id}
Method DELETE
Response Status
https://api.platformcraft.ru/1/streams/56cec7e2fa63afd0f843567d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,        # http code (200)
    "status": "String"  # status (success)
}

Example of response

{
    "code": 200,
    "status": "success"
}
Description Method to start instantaneous video stream recording
Endpoint https://api.platformcraft.ru/1/streams/rec/instant/start/{:stream_id}
Method POST
Response Status
https://api.platformcraft.ru/1/streams/rec/instant/start/56cec7e2fa63afd0f843567d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,        # http code (200)
    "status": "String"  # status (success)
}

Example of response

{
    "code": 200,
    "status": "success"
}
Description Method to stop instantaneous video stream recording
Структура URL https://api.platformcraft.ru/1/streams/rec/instant/stop/{:stream_id}
Method POST
Response Status
https://api.platformcraft.ru/1/streams/rec/instant/stop/56cec7e2fa63afd0f843567d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code":   Int,      # http code (200)
    "status": "String", # status (success)
    "files":[           # array with information about recorded files
        {
            "id":           "String", # object ID
            "name":         "String", # filename
            "path":         "String", # path to file
            "size":         Int,      # size of file (bytes)
            "content_type": "String", # file content type
            "create_date":  "String", # date of file creation
            "latest_update":"String", # date of last file modification
            "resource_url": "String", # URL to getting of detail information for file
            "video":        "String", # videoplayer url
            "cdn_url":      "String", # file url
            "status":       "String"  # file status
        },
        ...
    ]
}

Example of response

{
    "code": 200,
    "status": "success",
    "files":[
        {
            "id":"56f19106534b44355afd96e1",
            "name":"test 20160322.mp4",
            "path":"/records/test 20160322.mp4",
            "size":610768,
            "content_type":"video/mp4",
            "create_date":"22.03.2016T21:37:58",
            "latest_update":"",
            "resource_url":"api.platformcraft.ru/objects/56f19106534b44355afd96e1",
            "video":"video.platformcraft.ru/56f19106534b44355afd96e1",
            "cdn_url":"cdn.platformcraft.ru/test/records/test%2020160322.mp4",
            "status":"ok"
        }
    ]
}
Description Method to create a media stream recording by schedule
Структура URL https://api.platformcraft.ru/1/streams/rec/schedule/new/{:stream_id}
Method POST
Body content type JSON
Response Status

Requst body format

{
    "name": "String",       # record name
    "start_time": "String", # start time of the recording in the format DD.MM.YYYYTHH:mm:ss
    "stop_time": "String"   # stop time of the recording in the format DD.MM.YYYYTHH:mm:ss
}

Example of request

https://api.platformcraft.ru/1/streams/rec/schedule/new/56cec7e2fa63afd0f843567d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

{
    "name": "example",
    "start_time": "19.03.2016T23:43:55",
    "stop_time": "19.03.2016T23:44:55"
}

Response format

{
    "code": Int,          # http code (200)
    "status": "String",   # status (success)
    "record_id": "String" # record ID
}

Example of response

{
    "code": 200,
    "status": "success",
    "record_id": "5624cd5ac9a492f8b979b63f"
}
Description Method to delete a media stream recording by schedule
Endpoint https://api.platformcraft.ru/1/streams/rec/schedule/del/{:stream_id}/{:record_id}
Method DELETE
Response Status
https://api.platformcraft.ru/1/streams/rec/schedule/del/56cec7e2fa63afd0f843567d/5624cd5ac9a492f8b979b63f?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,        # http code (200)
    "status": "String"  # status (success)
}

Example of response

{
    "code": 200,
    "status": "success"
}

/players

Description Method to create videoplayer
Endpoint https://api.platformcraft.ru/1/players
Method POST
Body content type JSON
Response Information about created videoplayer

Request body format

{
        "name":             "String", # player name (mandatory)
        "folder":           "String", # player directory (optional)
        "videos": {                   # dictionary of videos(mandatory)
            "String": "String",       # video name in the Player: Object id of video (mandatory)
            ...
        },
        "screen_shot_id":   "String",         # screen_shot_id (optional)
        "vast_ad_tag_url" : "String",         # VAST ad tag url (optional)
        "description": "String",              # Player description (optional, not more 1500 символов)
        "tags": ["String",...],               # list of tags (optional)
        "geo": map["String"]map["String"]Bool # geo limitations
}

geo format

geo: dictionary map[continent]map[country]true, where continent, country - ISO codes, e.g. EU and RU respectively. If country == "ALL", then access to all countries within the continent is allowed.
Examples
geo = null {allow all countries}
geo = {"EU":{"ALL": true}, "NA":{"ALL": true}} { allow all countries inside Europe and North America }
geo = {"EU": {"RU": true}} { allow only Russia }

Note: all continent and country codes must be in capital letters.

Example of request

https://api.platformcraft.ru/1/players?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

{
    "name":"player_name",
    "folder": "/test",
    "videos":{
        "360":"566bf3e9534b447f07e2baef",
        "480":"5624cd5ac9a492f8b979b63f"
    },
    "screen_shot_id":"56238961c9a492f8b979b633",
    "vast_ad_tag_url":"http://example.com/example-vast.xml",
    "description": "test description",
    "tags": ["tag1","tag2"],
    "geo": {"EU": {"RU": true}}
}

Response format

{
    "code": Int,                     # http code (200)
    "status": "String",              # status (success)
    "player": {                      # information about player
        "id": "String",              # player id
        "name": "String",            # player name
        "path": "String",            # player path
        "is_dir": Bool,              # folder (true) or player (false)
        "videos": {                  # dictionary of videos
            "String": "String",      # video name in the Player: Object id of video
            ...
        },
        "screen_shot_url": "String",          # screenshot URL
        "vast_ad_tag_url": "String",          # VAST ad tag url
        "create_date": "String",              # date of Player creation
        "href": "String",                     # player url
        "frame_tag": "String",                # player embed code
        "description": "String",              # Player description
        "tags": ["String",...],               # list of tags
        "geo": map["String"]map["String"]Bool # geo limitations
    }
}

Example of response

{
    "code": 200,
    "status": "success",
    "player": {
        "id": "567d3643534b4474087c221d",
        "name": "player_name",
        "path": "/test/player_name",
        "is_dir": false,
        "videos": {
            360: "cdn.platformcraft.ru/alex/example_360.mp4"
            480: "cdn.platformcraft.ru/alex/example_480.mp4"
        },
        "screen_shot_url": "cdn.platformcraft.ru/alex/example.jpg",
        "vast_ad_tag_url": "http://example.com/example-vast.xml",
        "create_date": "25.12.2015T15:27:47"
        "href": "video.platformcraft.ru/embed/567d3643534b4474087c221d",
        "frame_tag": "<iframe width="558" height="264" src="video.platformcraft.ru/embed/567d3643534b4474087c221d" frameBorder="0" scrolling="no" allowFullScreen></iframe>",
        "description": "test description",
        "tags": ["tag1","tag2"],
        "geo": {"EU": {"RU": true}}
    }
}
Description Method to get list of all videoplayers
Endpoint https://api.platformcraft.ru/1/players
Method GET
Response List of all videoplayers
Filter parameters
folder Target folder to getting players. Examle: "/test".If the parameter is not specified, the players will be search across all the directories of the account. Optional.
name Name of player. Example: "test". Optional.
show_folders Show folders (show_folders=true - show folders with players). Optional.
Pagination parameters
limit Number of players on one page. Optional. If there is no parameter "limit" in the request, all user players are returned.
start How many players in the list need to be skipped. Optional, only counted with a positive parameter "limit".
pagingts Unix-timestamp. Only those players whose creation time is less than or equal to the time corresponding to "pagingts" parameter are returned. Optional, only counted with a positive limit.
https://api.platformcraft.ru/1/players?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571&limit=2

Response format

{
    "code": Int,                         # http code (200)
    "status": "String",                  # status (success)
    "count": "String",                   # quantity of Players
    "count_on_page": "String",           # quantity of Players on the page
    "players": [                         # list of all Players
        {                                # information about player
            "id": "String",              # player ID
            "name": "String",            # player name
            "path": "String",            # player path
            "is_dir": Bool,              # folder (true) or player (false)
            "videos": {                  # dictionary of video urls
                "String": "String",      # video name in Player: video URL
                ...
            },
            "screen_shot_url": "String",          # screen_shot URL
            "vast_ad_tag_url": "String",          # VAST ad tag url
            "create_date": "String",              # date of creation of the Player
            "href": "String",                     # player url
            "frame_tag": "String",                # player embed code
            "description": "String",              # player description
            "tags": ["String",...],               # tags array
            "geo": map["String"]map["String"]Bool # geo limitations
        }
    ],
    "paging": {
        "next": "String",                # link to the next page. null if the current page is the last one. Important: do not forget to sign the "next" request when sending to the server (см. https://doc.platformcraft.ru/filespot/api/#_1)
        "prev": "String"                 # link to the previous page. null if the current page is the first. Important: do not forget to sign the "prev" request when sending to the server (см. https://doc.platformcraft.ru/filespot/api/#_1)
    },
}

Example of response

{
    "code": 200,
    "status": "success",
    "count": 4,
    "count_on_page": 2,
    "players": [
        {
            "id": "567d3643534b4474087c221d",
            "name": "player_name",
            "path": "/test/player_name"
            "is_dir": false,
            "videos": {
                360: "cdn.platformcraft.ru/alex/example_360.mp4"
                480: "cdn.platformcraft.ru/alex/example_480.mp4"
            },
            "screen_shot_url": "cdn.platformcraft.ru/alex/example.jpg",
            "vast_ad_tag_url": "http://example.com/example-vast.xml",
            "create_date": "25.12.2015T15:27:47"
            "href": "video.platformcraft.ru/embed/567d3643534b4474087c221d",
            "frame_tag": "<iframe width="558" height="264" src="video.platformcraft.ru/embed/567d3643534b4474087c221d" frameBorder="0" scrolling="no" allowFullScreen></iframe>",
            "description": "test player",
            "tags": ["test"],
            "geo": {"EU": {"RU": true}}
        },
        {
            "id": "567d3643534b4474087c221e",
            "name": "player_name_1",
            "path": "/player_name_1"
            "is_dir": false,
            "videos": {
                360: "cdn.platformcraft.ru/alex/example_360.mp4"
                480: "cdn.platformcraft.ru/alex/example_480.mp4"
            },
            "screen_shot_url": "cdn.platformcraft.ru/alex/example.jpg",
            "vast_ad_tag_url": "http://example.com/example-vast.xml",
            "create_date": "25.12.2015T15:27:48"
            "href": "video.platformcraft.ru/embed/567d3643534b4474087c221e",
            "frame_tag": "<iframe width="558" height="264" src="video.platformcraft.ru/embed/567d3643534b4474087c221e" frameBorder="0" scrolling="no" allowFullScreen></iframe>",
            "description": "test player",
            "tags": [],
            "geo": null
        }
    ],
    "paging": {
        "next": "api.platformcraft.ru/1/players?pagingts=1525858519&limit=2&start=2",
        "prev": null
    }
}
Description Method to get information about videoplayer
Endpoint https://api.platformcraft.ru/1/players/{:player_id}
Method GET
Response Information about videoplayer
https://api.platformcraft.ru/1/players/567d3643534b4474087c221d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571

Response format

{
    "code": Int,                     # http code (200)
    "status": "String",              # status (success)
    "player": {                      # information about player
        "id": "String",              # player ID
        "name": "String",            # player name
        "path": "String",            # player path
        "is_dir": Bool,              # folder (true) or player (false)
        "videos": {                  # dictionary of video urls
            "String": "String",      # video name in Player: video URL
            ...
        },
        "screen_shot_url": "String",          # screenshot URL
        "vast_ad_tag_url": "String",          # VAST ad tag url
        "create_date": "String",              # date of creation of the Player
        "href": "String",                     # player url
        "frame_tag": "String",                # player embed code
        "description": "String",              # player description
        "tags": ["String",...],               # tags array
        "geo": map["String"]map["String"]Bool # geo limitations
    }
}

Example of response

{
    "code": 200,
    "status": "success",
    "player": {
        "id": "567d3643534b4474087c221d",
        "name": "player_name",
        "path": "/test/player_name",
        "is_dir": false,
        "videos": {
            360: "cdn.platformcraft.ru/alex/example_360.mp4"
            480: "cdn.platformcraft.ru/alex/example_480.mp4"
        },
        "screen_shot_url": "cdn.platformcraft.ru/alex/example.jpg",
        "vast_ad_tag_url": "http://example.com/example-vast.xml",
        "create_date": "25.12.2015T15:27:47"
        "href": "video.platformcraft.ru/embed/567d3643534b4474087c221d",
        "frame_tag": "<iframe width="558" height="264" src="video.platformcraft.ru/embed/567d3643534b4474087c221d" frameBorder="0" scrolling="no" allowFullScreen></iframe>",
        "description": "test player",
        "tags":["tag1","tag2"],
        "geo": {"EU": {"RU": true}}
    }
}
Description Method to delete videoplayer
Endpoint https://api.platformcraft.ru/1/players/{:player_id}
Method DELETE
Response Status

Additional parameters

delete_related - delete or not delete files associated with the player (true/false)

https://api.platformcraft.ru/1/players/567d3643534b4474087c221d?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571&delete_related=true

Response format

{
    "code": Int,       # http code (200)
    "status": "String" # status (success)
}

Example of response

{
    "code": 200,
    "status": "success"
}
Description To change Player with selected ID
Endpoint https://api.platformcraft.ru/1/players/:id
Method PUT
Body content type JSON
Response Status
Примечание Expect additions.

Request body format

{
    "name":           "String",   # new player name
    "folder": "String",           # new folder for the player, example: "/test". The parameter is ignored when the value is empty
    "videos": {                   # dictionary of videos
        "String": "String",       # video name in the Player: Object id of video
        ...
    },
    "screen_shot_id": "String",           # screenshot object ID
    "description": "String",              # player descriptions (up to 1500 symbols)
    "tags": ["String",...],               # list of tags
    "geo": map["String"]map["String"]Bool # geo limitations
}

Example of response

{
    "code": 200,
    "status": "success",
}

/download

Description Method to create task for downloading file by URL
Endpoint https://api.platformcraft.ru/1/download
Method POST
Response Status
Query string parameters
url URL of downloding file. Example: "http://test-domain.ru/test/test.mp4". Mandatory.
path Path to downloding file. Example: "/test". Default parameter is root path.
name File name. Example: "test.mp4". If parameter is not available, the file name is determined automatically.
Parameters for autocoding and autoplayer
autoencoding Automatic transcoding of video file (possible values: true, false). Optional, for video files only. The parameter is ignored for users who are not subscribed to the video file transcoding service.
presets Preset IDs for autocoding, separated by ",". Optional, counted only when autoencoding = true. Example: presets=566b0fbf044dfe64f2000002,566b0fbf044dfe64f2000003
del_original Delete the original file after autocoding (possible values: true, false). Optional, counted only when autoencoding = true.
autoplayer Automatic creation of the videoplayer (possible values: true, false). Optional, for video files only. If autoencoding = false, the player will be created from one original file. If autoencoding = true, then the videoplayer will be created from the transcoded video files.
    https://api.platformcraft.ru/1/download?apiuserid=test&timestamp=1450342665&hash=217ea22038abe3a16a2b0284e7b3d9a4487013ed9e832418befc49886a27d571&url=http://test-domain.ru/test/test.mp4&path=/test

Example of response

{
    "code":         200,
    "status":       "success",
    "message":      "Task create success.",
    "active_tasks": 1,
    "task_id":      "56ea79e2534b4423135ebfaa"
}

/download_tasks

Description Method to getting list of tasks for downloading files
Endpoint https://api.platformcraft.ru/1/download_tasks
Method GET
Response List of tasks

Example of response

{
    "code": 200,
    "status": "success",
    "count": 2,
    "tasks": [
        {
            "id": "56365b04044dfe6917000002",
            "category": "download",
            "title": "Download test1.mp4",
            "body": "Please wait.",
            "status": "Progress",
            "time_start": "01.11.2015T21:33:40",
            "time_finish": "",
            "lock": true
        },
        {
            "id": "57011e2a534b44741fc67880"
            "category": "download"
            "title": "Download abc.mp4"
            "body": "Download success."
            "status": "Completed"
            "time_start": "03.04.2016T16:44:10"
            "time_finish": "03.04.2016T16:44:11"
            "lock": false
        }
    ]
}
Description Method to getting information about task for downloading files
Endpoint https://api.platformcraft.ru/1/download_tasks/{:task_id}
Method GET
Response Information about task

Response format

{
    "code":   Int,        # http code (200)
    "files":  ["String"], # array with IDs of downloaded files
    "status": "String",   # status
    "task": {
        "id":          "String" # task ID
        "category":    "String" # task category
        "title":       "String" # task title
        "body":        "String" # information about task
        "status":      "String" # task status
        "time_start":  "String" # start time
        "time_finish": "String" # stop time
        "lock":        Bool     # blocking
    }
}

Example of response

{
    "code": 200,
    "files":["56ea7c4e534b44353536586c"],
    "status": "success",
    "task": {
        "id": "57011e2a534b44741fc67880"
        "category": "download"
        "title": "Download abc.mp4"
        "body": "Download success."
        "status": "Completed"
        "time_start": "03.04.2016T16:44:10"
        "time_finish": "03.04.2016T16:44:11"
        "lock": false
    }
}
Description Method to delete tasks from queue(You can only delete an unlocked/unblocked task)
Endpoint https://api.platformcraft.ru/1/download_tasks/{:task_id}
Method DELETE
Response Status

Example of response

{
    "code": 200,
    "message": "Task delete success.",
    "status": "success"
}

/transcoder/presets

Description Method to getting list of presets for transcoding
Endpoint https://api.platformcraft.ru/1/transcoder/presets
Method GET
Response List of presets

Example of response

{
    "code": 200,
    "count": 3,
    "presets": [
        {
            "id": "566b0fbf044dfe64f2000002",
            "name": "System preset: Generic 1080p",
            "container": "mp4",
            "video": {
                "codec": "H.264",
                "bit_rate": "5400",
                "fps": "29.97",
                "max_width": "1920",
                "max_height": "1080"
            },
            "audio": {
                "codec": "AAC",
                "bit_rate": "160",
                "sample_rate": "44100",
                "channels": "2"
            }
        },
        {
            "id": "566b0fbf044dfe64f2000003",
            "name": "System preset: Generic 720p",
            "container": "mp4",
            "video": {
                "codec": "H.264",
                "bit_rate": "2400",
                "fps": "29.97",
                "max_width": "1280",
                "max_height": "720"
            },
            "audio": {
                "codec": "AAC",
                "bit_rate": "160",
                "sample_rate": "44100",
                "channels": "2"
            }
        },
        {
            "id": "566b0fbf044dfe64f2000004",
            "name": "System preset: Generic 480p 16:9",
            "container": "mp4",
            "video": {
                "codec": "H.264",
                "bit_rate": "1200",
                "fps": "29.97",
                "max_width": "854",
                "max_height": "480"
            },
            "audio": {
                "codec": "AAC",
                "bit_rate": "128",
                "sample_rate": "44100",
                "channels": "2"
            }
        }
    ]
}

/transcoder

Description Method to create task for trascoding
Endpoint https://api.platformcraft.ru/1/transcoder/{:object_id}
Method POST
Body content type JSON
Response Status

Request body format

{
   "presets": ["presetID",...], # list of preset IDs for transcoding
   "path": "String"             # File download path. Optional. Default path is path of transcoding file.
}

Example of request body

{
   "presets": ["5676a27cf9cb101634000002","5676a27cf9cb101634000003"],
   "path": "/test"
}

Example of response

{
    "code":         200,
    "status":       "success",
    "message":      "Task create success.",
    "active_tasks": 2,
    "task_id":      "56ea79e2534b4423135ebfd3"
}
Description Method to create task for transcoding HLS
Endpoint https://api.platformcraft.ru/1/transcoder/hls/{:object_id}
Method POST
Body content type JSON
Response Status

Request body format

{
   "presets": ["presetID",...], # list of preset IDs for transcoding
   "segment_duration": Int      # video segment duration in sec. from 1 to 60
}

Example of request body

{
   "presets": ["5693b900534b440cd053f5a5","5693b900534b440cd053f5a3"],
   "segment_duration": 20
}

Example of response

{
    "code":         200,
    "status":       "success",
    "message":      "Task create success.",
    "active_tasks": 2,
    "task_id":      "56ea79e2534b4423135ebfd3"
}

/transcoder_tasks

Description Method to get list task for transcoding
Endpoint https://api.platformcraft.ru/1/transcoder_tasks
Method GET
Response List of tasks

Example of response

{
    "code": 200,
    "status": "success",
    "count": 3,
    "tasks": [
        {
            "id": "56365b04044dfe6917000002",
            "category": "encoding",
            "title": "Encoding Копия test.360p.mp4",
            "body": "Please wait.",
            "status": "Progress",
            "time_start": "01.11.2015T21:33:40",
            "time_finish": "",
            "lock": true
        },
        {
            "id": "566b3a9d044dfe7381000002",
            "category": "encoding",
            "title": "Encoding test (480p).mp4",
            "body": "Internal server error. Please try again later.",
            "status": "Error",
            "time_start": "12.12.2015T00:05:33",
            "time_finish": "12.12.2015T00:05:47",
            "lock": false
        },
        {
            "id": "566b4173044dfe771c000001",
            "category": "encoding",
            "title": "Encoding test (480p).mp4",
            "body": "Encoding video success.",
            "status": "Completed",
            "time_start": "12.12.2015T00:34:43",
            "time_finish": "12.12.2015T00:35:56",
            "lock": false
        }
    ]
}
Description Method to get information about task with selested ID
Endpoint https://api.platformcraft.ru/1/transcoder_tasks/{:task_id}
Method GET
Response Information about task

Example of response

{
    "code": 200,
    "files":["56ea7c4e534b44353536586c"],
    "status": "success",
    "task": {
        "id": "56365b04044dfe6917000002",
        "category": "encoding",
        "title": "Encoding Копия test.360p.mp4",
        "body": "Please wait.",
        "status": "Progress",
        "time_start": "01.11.2015T21:33:40",
        "time_finish": "",
        "lock": true
    }
}
Description Method to get information about HLS task with selected ID
Endpoint https://api.platformcraft.ru/1/transcoder_tasks/hls/{:task_id}
Method GET
Response Information about HLS task

Example of response

{
    "code":200,
    "files":{
        "master_playlist":"56ea7c4e534b44353536586c",
        "media":[
            {
                "playlist":"56ea7c4e534b44353536586d",
                "files":[
                    "56ea7c4f534b44353536586e",
                    "56ea7c50534b44353536586f",
                    "56ea7c50534b443535365870"
                ]
            },
            {
                "playlist":"56ea7c55534b443535365878",
                "files":[
                    "56ea7c55534b443535365879",
                    "56ea7c55534b44353536587a",
                    "56ea7c56534b44353536587b"
                ]
            }
        ]
    },
    "status":"success",
    "task":{
        "id":"56ea7c2f534b440c83fe85bc",
        "category":"encoding",
        "title":"Encoding abc.mp4",
        "body":"Encoding video success.",
        "status":"Completed",
        "time_start":"17.03.2016T12:43:11",
        "time_finish":"17.03.2016T12:43:53",
        "lock":false
    }
}
Description Method to delete task from queue (You can only delete an unlocked/unblocked task)
Endpoint https://api.platformcraft.ru/1/transcoder_tasks/{:task_id}
Method DELETE
Response Status

Example of response

{
    "code": 200,
    "message": "Task delete success.",
    "status": "success"
}

/storage

Description Method to get information about storage volume
Endpoint https://api.platformcraft.ru/1/storage
Method GET
Response Information about storage volume

Response format

{
    "code":     Int,       # http code (200)
    "status":   "String",  # status
    "storage": {
        "used": Int,       # used storage volume (bytes)
        "limit": Int       # storage capacity (bytes)
    }
}

Example of response

{
    "code": 200,
    "status": "success",
    "storage": {
        "used": 97537237,
        "limit": 107374182
    }
}

Errors

Response format

{
    "code":     Int,       # http code
    "status":   "String",  # status (fail)
    "msg_user": "String",  # error description
    "msg_dev":  "String",  # detailed description of error
    "doc":      "String",  # URL to documentation
    "advanced": "String"   # additional Information
}

HTTP codes

400 - Bad Request,
403 - Forbidden,
404 - Not Found.

Example of response

{
    "code": 400
    "status": "fail"
    "msg_user": "Api ID, timestamp and hash are required."
    "msg_dev": "Check Api id, timestamp and hash."
    "doc": "http://doc.platformcraft.ru/filespot/api/#access"
    "advanced": null
}

Libraries

platformcraft-filespot для Ruby