This endpoint allows you to work with folders in the buto platform to organise your videos

Collection /folder

Working with folders

GET /folder/{organisation_id}

Get all the folders for your organisation

item value
Access user
Full url https://api.buto.tv/v2/folder/{organisation_id}
verb GET
params string:organisation_id

Example usage

#get all folders in org
    api_key=<your api key>
    organisation_id="Bbgwg"
    curl -X GET -u ${api_key}:x https://api.buto.tv/v2/folder/${organisation_id}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

[
    {
        "frwrcG5": {
            "created_by_user_id": "h17nt",
            "description": "videos about water",
            "folder_id": "frfrcG5",
            "last_modified_by_user_id": "h17nt",
            "name": "water folder",
            "organisation_id": "Bbgwg",
            "time_created": "2012-05-04 15:33:38",
            "time_last_modified": "2012-05-04 15:33:38"
        },
        ...
        "frxD8c4": {
            "created_by_user_id": "5143b",
            "description": "our test folder",
            "folder_id": "frdD8c4",
            "last_modified_by_user_id": "5143b",
            "name": "Testing 123",
            "organisation_id": "Bbgwg",
            "time_created": "2010-03-03 11:10:30",
            "time_last_modified": "2010-03-03 11:10:30"
        }
    }
]


POST /v2/folder

Create a new folder for an organisation

NB you must supply an organisation_id

item value
Access user
Full url https://api.buto.tv/v2/folder
verb POST
params string:organisation_id, `string:name

Example usage

#create a new folder
    api_key=<your api key>
    organisation_id="Bbgwg"
    data="name=Aloo_Kheti&description=PotatoFarmingInTheMidlands&organisation_id=${organisation_id}"
    curl -X POST -u ${api_key}:x --data ${data} https://api.buto.tv/v2/folder

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "created": "m2d3SM3rMf",
    "data": {
        "created_by_user_id": "bWHbd",
        "description": "PotatoFarmingInTheMidlands,
        "last_modified_by_user_id": "bWHbd",
        "name": "Aloo_Kheti",
        "organisation_id": "Bbgwg",
        "time_created": "2015-07-24 15:45:35",
        "time_last_modified": "2015-07-24 15:45:35"
    }
}

PUT /v2/folder/${folder_id}/update

Update an existing folder for an organisation

NB you must supply an organisation_id

item value
Access user
Full url https://api.buto.tv/v2/folder/${folder_id}/update
verb PUT
params string:organisation_id, string:organisation_id, `string:name

Example usage

#update and existing folder
    folder_id="m2d3SM3rMf"
    api_key=<your api key>
    organisation_id="Bbgwg"
    data="name=Updated%20name&organisation_id=${organisation_id}"
    curl -X PUT -u ${api_key}:x --data ${data} https://api/buto.tv/v2/folder/${folder_id}/update

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "updated_data": {
        "folder_id": "m2d3SM3rMf",
        "last_modified_by_user_id": "yccbM",
        "name": "Updated name",
        "time_last_modified": "2015-07-24 16:05:44"
    },
    "old_data": {
        "created_by_user_id": "yWHbM",
        "description": "potaoesaregoodForYou",
        "folder_id": "m2d3SM3rMf",
        "last_modified_by_user_id": "yccbM",
        "name": "Updated name",
        "organisation_id": "Bbgwg",
        "time_created": "2015-07-24 15:45:35",
        "time_last_modified": "2015-07-24 16:05:39"
    },
    "updated": "m2d3SM3rMf"
}


DELETE https://api/buto.tv/v2/folder/${folder_id}/delete/{$organisation_id}

Delete a folder for an organisation

NB you must supply an organisation_id

item value
Access user
Full url https://api.buto.tv/v2/folder/${folder_id}/delete/{$organisation_id}
verb PUT
params string:folder_id, string:organisation_id

Example usage

#update and existing folder
    folder_id="kYM4tqX3qX"
    api_key=<your api key>
    organisation_id="Bbgwg"
    curl -X PUT -u ${api_key}:x --data ${data} https://api/buto.tv/v2/folder/${folder_id}/delete/{$organisation_id}

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "deleted": true,
    "old_data": {
        "created_by_user_id": "1233",
        "description": "potaoesaregoodForYou",
        "folder_id": "kYM4tqX3qX",
        "last_modified_by_user_id": "1233",
        "name": "aloo",
        "organisation_id": "Bbgwg",
        "time_created": "2015-07-24 15:44:57",
        "time_last_modified": "2015-07-24 15:44:57"
    }
}
-



Collection /folder/{folder_id}/video

Working with items in folders

GET /folder/{folder_id}/video

Get all the videos in a particular folder

item value
Access user
Full url https://api.buto.tv/v2/folder/${folder_id}/video
verb GET
params string:folder_id

Example usage

#get folder items
    api_key=<your api key>
    folder_id="fr2LvGx"
    curl -X GET -u ${api_key}:x https://api.buto.tv/v2/folder/${folder_id}/video

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "contents": [
        "6v36X",
         ...
        "12355"
    ],
    "folder_id": "fr2LvGx"
}



POST /folder/{folder_id}/video

Add a video to a folder

item value
Access user
Full url https://api.buto.tv/v2/folder/${folder_id}/video/${video_id}/add
verb POST
params string:folder_id, string:video_id

Example usage

#add folder items
    api_key=<your api key>
    folder_id="fr2LvGx"
    video_id="6v36X"
    curl -X POST -u ${api_key}:x https://api.buto.tv/v2/folder/${folder_id}/video/${video_id}/add

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "folder_id": "fr2LvGx",
    "added": [
        "6v36X"
    ]
}

DELETE /folder/{folder_id}/video

Remove a video from a folder

item value
Access user
Full url https://api.buto.tv/v2/folder/${folder_id}/video/${video_id}/delete
verb DELETE
params string:folder_id, string:video_id

Example usage

#remove folder items
    api_key=<your api key>
    folder_id="fr2LvGx"
    video_id="6v36X"
    curl -X POST -u ${api_key}:x https://api.buto.tv/v2/folder/${folder_id}/video/${video_id}/delete

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "folder_id": "fr2LvGx",
    "removed": [
        "6v36X"
    ]
}