Introduction
Welcome to K2S API Guide.
This Guide is supposed to clarify the way how you can work with K2S Cloud Storage.
Using the following documentation you can automate the most often actions with K2S Cloud Storage such as
- Create an automation scripts
and et cetera
Before you start
Please make sure you the following tools installed:
- CURL https://curl.haxx.se/
- php-curl
- SDK PHP Keep2ShareAPI.php . You can download it here
Examples run in a *nix environment.
Authorization
To start using Keep2Share API you have to use authorization process, which is available as several options:
- Access_token with using permanent key is available for partners. See details by the following link
- For users without additional validation – username and password.
- For users with Goggle Captcha validation.
Authorization by permanent token
You can get a permanent token when you click “Create new token” button located on a page. Now we’re going to request one of K2S API methods, for instance
CURL:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
-d '{"access_token":"yourtoken"}' \
https://keep2share.cc/api/v2/accountInfo
Response:
{
"status":"success",
"code":200,
"available_traffic":53687091200,
"account_expires":"2022-04-24T00:00:00.000Z"
}
Authorization by login and password
We request an auth_token from the server.
CURL:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
-d '{"username":"yourbox@gmail.com","password":"yourpassword"}' \
https://keep2share.cc/api/v2/login
You will receive auth_token
in server response if your login and password are correct.
Response:
{
"status":"success",
"code":200,
"auth_token":"flmuf4o3uo59s105546dmvmq60",
"message":"success"
}
PHP:
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
$result = $api->login();
var_dump($result);
/*
bool(true)
*/
var_dump($api->getAuthToken());
/*
string(flmuf4o3uo59s105546dmvmq60)
*/
Authorization by login and password with ReCaptcha
This option is a bit complicated but it is worth using it due to we are concerned about the security of your account
CURL:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
-d '{"username":"yourbox@gmail.com","password":"yourpassword"}' \
https://keep2share.cc/api/v2/login
Response:
{
"message":"Please verify your request via re captcha challenge",
"status":"error",
"code":406,
"errorCode":33
}
At first, you should get a unique page with Google captcha.
Request:
$ curl -X POST -H "Content-type: application/json" \
http://keep2share.cc/api/v2/requestReCaptcha
Response:
{
"status":"success",
"code":200,
"challenge":"9c726b3ce8b34",
"captcha_url":"http://keep2share.cc/api/v2/reCaptcha.html?id=9c726b3ce8b34"
}
Open captcha_url
in your browser and proceed verification. After you receive a link to a unique page with Google captcha and re_captcha_challenge
you should open this link, pass captcha, and get unique code re_captcha_response
.
All received data you should add to your authorization request do not forget to provide correct user login and password for authorization:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
-d '{"username":"yourbox@gmail.com","password":"yourpassword" \
"re_captcha_challenge":"9c726b3ce8b34", \
"re_captcha_response":"9c726b3ce8b349c726b3ce8b349c726b3ce8b34"}' \
https://keep2share.cc/api/v2/login
Response:
{
"status":"success",
"code":200,
"auth_token":"flmuf4o3uo59s105546dmvmq60"
}
PHP:
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
$result = $api->login();
var_dump($result);
/*
bool(false)
*/
var_dump($api->request('requestReCaptcha'));
/*
array(4) {
["status"]=>
string(7) "success"
["code"]=>
int(200)
["challenge"]=>
string(13) "807a330502f04"
["captcha_url"]=>
string(59) "http://keep2share.cc/api/v2/reCaptcha.html?id=807a330502f04"
}
*/
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
$result = $api->login(null, null, "807a330502f04", "807a330502f04807a330502f04");
var_dump($result);
/*
bool(true)
*/
var_dump($api->getAuthToken());
/*
string(flmuf4o3uo59s105546dmvmq60)
*/
Upload
You need authorization.
Please make sure you the following tools installed:
Save the following into a file called upload.sh:
Bash script:
#!/bin/bash
cmd=$(curl -s -H 'Content-Type: application/json' -d '{"access_token": "your_token"}' "https://keep2share.cc/api/v2/getUploadFormData" | jq -r .)
echo "$cmd"
FullFileName="/yourFile.txt"
Form_Action=$(echo "$cmd" | jq -r ".form_action")
FileField=$(echo "$cmd" | jq -r ".file_field")
Ajax=$(echo "$cmd" | jq -r ".form_data.ajax")
Params=$(echo "$cmd" | jq -r ".form_data.params")
Sig=$(echo "$cmd" | jq -r ".form_data.signature")
cmd2=$(curl -F "$FileField=@$FullFileName" -F "ajax=$Ajax" -F "signature=$Sig" -F "params=$Params" "$Form_Action")
Save and close the file. You can run the script as follows:
sudo apt-get install jq
sudo chmod +x upload.sh
$ ./upload.sh
OR
PHP:
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
$result = $api->login();
if ($result === true) {
$uploadResult = $api->uploadFile('somefile.txt');
var_dump($uploadResult);
/*
array(5) {
["status"]=>
string(7) "success"
["success"]=>
bool(true)
["status_code"]=>
int(200)
["user_file_id"]=>
string(13) "a4b8776255952"
["link"]=>
string(32) "http://k2s.cc/file/a4b8776255578"
}
*/
}
We developed easy handling application for uploading files which suits to our partners.
Download
You don't need authorization to download files.
CURL:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
'{"auth_token":"<your_auth_token>","file_id":"<your_file_id>"}' \
https://keep2share.cc/api/v2/getUrl
Response:
{
"status":"success",
"code":200,
"url":"https://prx-214.keep2share.cc/6b50f2add0ba8/a8db134b2b824/12bb6331eaf8e?temp_url_sig=cd2cb4d790632999d2623adfba6683a86e4294e439f4f927afc78744cceae28629c7119345093b8f30109725063d7cc2536d586ac2bd56554bc1101c9356e84f&temp_url_expires=1569891870&id=dba7c1fa58ef0&ip=any&node_id=214&countable=1&project=k2s&user_id=1&uf=a4b8776255352&tags=legacy-api%2Cdownload%2Ck2s&name=sometfile.txt"
}
PHP:
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
$result = $api->login();
var_dump($result);
/*
bool(true)
*/
var_dump($api->getUrl('<your_file_id>'));
/*
array(3) {
["status"]=>
string(7) "success"
["code"]=>
int(200)
["url"]=>
string(391) "https://prx-214.keep2share.cc/6b50f2add0ba8/a8db134b2b824/12bb6331eaf8e?temp_url_sig=cd2cb4d790632999d2623adfba6683a86e4294e439f4f927afc78744cceae28629c7119345093b8f30109725063d7cc2536d586ac2bd56554bc1101c9356e84f&temp_url_expires=1569891870&id=dba7c1fa58ef0&ip=any&node_id=214&countable=1&project=k2s&user_id=1&uf=a4b8776255352&tags=legacy-api%2Cdownload%2Ck2s&name=sometfile.txt"
}
*/
Check link
This method returns information about a file or file list if you set a folder ID. You don't need authorization to check files.
Example:
Request:
$ curl -X POST \
-H "Content-type: application/json" \
-d '{"id":"96a9d7445484c"}' \
https://keep2share.cc/api/v2/getFileStatus
Response:
{
"status":"success",
"code":200,
"name":"video.mp4",
"is_available":true,
"is_folder":false,
"size":4734920,
"access":"public",
"video_info":
{
"duration":18.446,
"width":1280,
"height":720,
"format":"MPEG-4"
}
}
Keep2shareAPI.php
You can use the PHP SDK.
Example:
<?php
include "Keep2ShareAPI.php";
$api = new Keep2ShareAPI("yourbox@gmail.com", "yourpassword");
/** login **/
$login = $api->login();
/** getFiles **/
$getFiles = $api->getFilesList('/', 10, 0, ['date_created'=>-1], 'files');
/** upload **/
$upload = $api->uploadFile('PATH-TO-LOCAL-FILE');
/** getUrl **/
$getUrl = $api->GetUrl('ID-FILE');
/** createFolder **/
$createFolder = $api->createFolder('Any name');
/** getBalance **/
$getBalance = $api->getBalance();
You can see more examples here
Resources
post /login
This method allows you to recieve auth_token
for a user. All requests to resources which requere authentication must be with query
parameter auth_token
.
For more details proceed to Security in resource documentation.
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/login
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
username* | string | example: test@test.test |
password* | string | example: password |
re_captcha_challenge | string | example: 3fe7f38bba329 |
re_captcha_response | string | example: 3fe7f38bba329asdasasd |
Request Body
{
"username":"test",
"password":"pass",
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
Response Body
{
"status":"success",
"code":200,
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | example: Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | example: Network banned |
Response Body
{
"status":"error",
"code":403,
"errorCode":77,
"message":"Network banned"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | example: Please verify your request via re captcha challenge |
Response Body
{
"status":"error",
"code":406,
"errorCode":33,
"message":"Please verify your request via re captcha challenge"
}
post /requestReCaptcha
This method returns re_captcha_challenge
and link on a page with Google recaptcha.
If you perform authorization from doubtful IP addresses you have to pass verification
curl -X POST \
https://keep2share.cc/api/v2/requestReCaptcha
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | int | 200 |
challenge* | string | example: 3fe7f38bba329 |
captcha_url* | string |
Response Body
{
"status":"success",
"code":200,
"challenge":"3fe7f38bba329",
"captcha_url":"https://keep2share.cc/api/v2/reCaptcha.html?id=3fe7f38bba329"
}
get /reCaptcha
This method returns an html page with Google captcha.
Parameters chevron_right expand_more
Parameter | Type | Description |
---|---|---|
Query | ||
id* | string | example: 3fe7f38bba329 |
curl -X GET \
https://keep2share.cc/api/v2/reCaptcha?id=<value>
200 OK chevron_right expand_more
text/html
text/html
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
message* | string |
Response Body
{
"status":"error",
"code":400,
"message":"Id not found"
}
post /test
This is method that lets you check that you have access to the API
, that the API
is working.
curl -X POST \
https://keep2share.cc/api/v2/test
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
message* | string | Test was successful! |
Response Body
{
"status":"success",
"code":200,
"message":"Test was successful!"
}
post /accountInfo
This method is to recieve account information - it returns amount of avalable traffic on the current date and end of subscription Premium
or Premium Pro
(if a user has a subscription) in timestamp
.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/accountInfo
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
available_traffic* | integer | in bytes |
account_expires* | integer | timestamp |
Response Body
{
"status":"success",
"code":200,
"available_traffic":53687091200,
"account_expires":"2022-04-24T00:00:00.000Z"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are need authorized |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /getBalance
This method returns user, partner or reseller balance.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getBalance
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
balance* | float | example: 0.20 |
Response Body
{
"status":"success",
"code":200,
"balance":0.20
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /getDomainsList
This method returns a list of available domains for a partner. It is necessary for file upload.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getDomainsList
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
domains* | array | example: ['k2s.cc'] |
Response Body
{
"status":"success",
"code":200,
"domains":['k2s.cc']
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /resellerGetCode
This method allows to recieve previously created reseller code or create a new one.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/resellerGetCode
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
days* | integer | example: 7 |
useExist | boolean | default: true |
autoBuy | boolean | default: true |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"days":7,
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
code_id* | integer | example: 1 |
reseller_code* | string | example: mt2dr45tlnev |
balance* | float | example: 0.10 |
Response Body
{
"status":"success",
"code":200,
"code_id":1,
"reseller_code":"mt2dr45tlnev",
"code_id":0.10
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | example: No available reseller codes |
Response Body
{
"status":"error",
"code":406,
"errorCode":50,
"message":"No available reseller codes"
}
post /getFoldersList
This method returns User's/Partner's list of folders.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getFoldersList
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
parent_id | string | get sub folders by folder id |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
foldersList* | array | names in order example: [ '/test', '/simple' ] |
foldersIds* | array | ids in order example: [ '5432a01230d2b', '1632a04bb0d2a' ] |
parentFoldersList* | array | parent names in order example: [ '/k2s', '/custom' ] |
parentFoldersIds* | array | parent ids in order example: [ '6432b01230d2b', '9432d01230d2c' ] |
Response Body
{
"status":"success",
"code":200,
"foldersList":['test','simple'],
"foldersIds":['5432a01230d2b','1632a04bb0d2a']
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /createFolder
This method allows create folders.
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/createFolder
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
name* | string | example: test |
parent* | string | parent_id or set default '/' |
access* | string | Enum:
|
is_public | boolean | default: false |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"name":"test",
"parent":"/",
"access":"public"
}
201 Created chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 201 |
id* | string | example: mt2dr45tlnev |
Response Body
{
"status":"success",
"code":200,
"id":"0632a04bb0d21"
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | Error create folder |
Response Body
{
"status":"error",
"code":406,
"errorCode":60,
"message":"Error create folder"
}
post /getFilesList
This method allows you to recieve File list by its ID or from root folder in user space.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getFilesList
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
parent | string | default '/' |
limit | integer | total number of files to receive, default 100, max 10000 |
offset | integer | sampling start from N file with current order, default 0 |
sort | array | examples: { name: 1 }, { name: -1 }, { date_created: 1 }, { date_created: -1 } |
only_available | boolean | default false |
extended_info | boolean | default false
|
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":200,
"files": [
{
"id":"4632a04bb0d2b",
"name":"test",
"is_available":false,
"is_folder":false,
"date_created":"2019-01-01 00:00:01",
"size":1024,
"md5":"a457f1dd3623a399d78a9672d225ddd5",
"extended_info": {
"abuses":[{
"type": "hash",
"projects": ["k2s"],
"blocked_to": "2020-01-01 00:00:01"
}],
"storage_object":"available",
"size":1024,
"date_download_last":"2019-01-01 00:00:01",
"downloads":1,
"access":"public",
"content_type":"text"
}
}
]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /getFilesInfo
This method allows receiving file information using files ID.
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getFilesInfo
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
ids* | array | example: ["358b6aa520a72", "96a9d7445484c"] |
extended_info | boolean | default false
|
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"ids":["358b6aa520a72"],
"extended_info":true
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":200,
"files": [
{
"id":"4632a04bb0d2b",
"name":"test",
"is_available":false,
"is_folder":false,
"date_created":"2019-01-01 00:00:01",
"size":1024,
"md5":"a457f1dd3623a399d78a9672d225ddd5",
"extended_info": {
"abuses":[{
"type": "hash",
"projects": ["k2s"],
"blocked_to": "2020-01-01 00:00:01"
}],
"storage_object":"available",
"size":1024,
"date_download_last":"2019-01-01 00:00:01",
"downloads":1,
"access":"public",
"content_type":"text"
}
}
]
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /updateFiles
This method allows to change properties of files. Important! When moving files, there is a limit on the number of files in a folder of 50,000 items.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/updateFiles
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
ids* | array | example: ['83f09624b61db', '83f09624b61ds'] |
new_name | string | example: test |
new_parent | integer | parent_id or default '/' |
new_access | string | Enum:
|
new_is_public | boolean | default false |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"ids":["83f09624b61db","83f09624b61ds"]
"new_name":"test"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":200,
"files": [
{
"id":"0632a04bb0d21",
"status":"success",
"errors":[]
}
]
}
{
"status":"success",
"code":200,
"files": [
{
"id":"0632a04bb0d21",
"status":"success",
"errors":["Limit files in specified folder reached"]
}
]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /deleteFiles
This method allows user files deletion.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/deleteFiles
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
ids* | array | example: ['83f09624b61db', '83f09624b61ds'] |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"ids":["83f09624b61db","83f09624b61ds"]
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
deleted* | integer | count of deleted files |
Response Body
{
"status":"success",
"code":200,
"deleted":2
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /findFile
This method allows to check file presence in our cloud storage using hash sum (md5).
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/findFile
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
md5* | string | example: 'a457f1dd3623a399d78a9672d225ddd1' |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"md5":"a457f1dd3623a399d78a9672d225ddd1"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
found* | boolean |
Response Body
{
"status":"success",
"code":200,
"found":true
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /createFileByHash
This method allows you to create a file based on a hash sum (md5). If our project already has a file with this hash sum (md5). Speeds up the upload time file.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/createFileByHash
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
hash* | string | example: 'a457f1dd3623a399d78a9672d225ddd1' |
name* | string | example: 'test2' |
parent | string | parent_id or set default '/' |
access | string | Enum:
|
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"hash":"a457f1dd3623a399d78a9672d225ddd1",
"name":"test2"
}
201 Created chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 201 |
id* | string | example: 0632a04bb0d21 |
Response Body
{
"status":"success",
"code":200,
"id":"0632a04bb0d21"
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | Error create file |
Response Body
{
"status":"error",
"code":406,
"errorCode":62,
"message":"Error copy file",
"errors":[
"Destination directory was not found",
"Name is too short (minimum is 3 characters).",
"Access is not in the list."
]
}
post /getFileStatus
This method returns information about a file or file list if you set a folder ID.
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getFileStatus
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
id* | string | default '96a9d7445484c' |
limit | integer | default 100 |
offset | integer | default 0 |
Request Body
{
"id":"96a9d7445484c"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":200,
"files": [
{
"id":"1632a04bb0d2b",
"name":"test.mp4",
"is_available":true,
"is_folder":false,
"date_created":"2019-01-01 00:00:01",
"size":1024,
"video_info":{
"duration":848.901,
"width":1920,
"height":1080,
"format":"MPEG-4"
}
}
]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /updateFile
This method allows to change file properties. Important! When moving files, there is a limit on the number of files in a folder of 50,000 items.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/updateFile
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
id* | string | example: '83f09624b61db' |
new_name | string | example: test |
new_parent | integer | parent_id or default '/' |
new_access | string | Enum:
|
new_is_public | boolean | default false |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"id":"83f09624b61db"
"new_name":"test"
}
202 Accepted chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":202,
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | Error update file |
Response Body
{
"status":"error",
"code":406,
"errorCode":63,
"message":"Error update file"
}
post /getUploadFormData
This method allows to recieve file uploading form. Important! There is a limit on the number of files in a folder of 50,000 items.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getUploadFormData
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
parent_id* | string | parent_id or set default '/' |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"parent_id":"/"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
form_action* | string | [object Object] |
file_field* | string | file |
form_data* | array | example: mt2dr45tlnev |
Response Body
{
"status":"success",
"code":200,
"form_action":"http://file-api-26.keep2share.cc:8000/upload",
"file_field":"file",
"form_data":{
"ajax":true,
"params":"{}",
"signature":"264567c43b813fce606d5a390b71"
}
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | No available nodes |
Response Body
{
"status":"error",
"code":406,
"errorCode":63,
"message":"No available nodes"
}
post /remoteUploadAdd
This method allows to add links for remote upload. Return url and remote upload ID for checking download status in method remoteUploadStatus.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/remoteUploadAdd
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
urls* | array | example: ['http://google.com'] |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"urls":['http://google.com']
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
acceptedUrls* | array | example: [{"url":"http://google.com", id:"46564421"}] |
rejectedUrls* | array | example: [] |
Response Body
{
"status":"success",
"code":200,
"acceptedUrls":[{
"url":"http://google.com",
"id":"46564421"
}],
"rejectedUrls":[]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /remoteUploadStatus
This method allows to check status of recently added file links.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/remoteUploadStatus
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
ids* | array | example: ['46564421'] |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"ids":["46564421"]
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
uploads* | array |
Response Body
{
"status":"success",
"code":200,
"uploads":[
{
"status":3,
"progress":100,
"file_id":"27dddcb772fec"
}
]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
post /getUrl
This method is for recieveing a link to download file.
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getUrl
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
file_id* | string | example: 3fe7f38bba329 |
auth_token | string | example: 3fe7f38bba329asdasasd |
free_download_key | string | example: 3fe7f38bba329 |
captcha_challenge | string | example: 3fe7f38bba329asdasasd |
captcha_response | string | example: 3fe7 |
url_referrer | string | example: http://google.com |
Request Body
{
"file_id":"3fe7f38bba329"
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
url* | string | example: https://prx-214.keep2share.cc/6b50f2add0ba8/... |
Response Body
{
"status":"success",
"code":200,
"url":"https://prx-214.keep2share.cc/6b50f2add0ba8/name=sometfile.txt"
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
406 Not Acceptable chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 406 |
errorCode* | integer |
|
message* | string | example: Captcha required |
Response Body
{
"status":"error",
"code":406,
"errorCode":30,
"message":"Captcha required"
}
or
{
"status":"error",
"code":406,
"errorCode":21,
"message":"File is not available"
"errors": [{
"code":1,
"message": "Download count files exceed"
}]
}
post /requestCaptcha
This method returns captcha_challenge
and link to a page with Google captcha. When you download under non-authorised user you have to pass verification.
curl -X POST \
https://keep2share.cc/api/v2/requestCaptcha
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | int | 200 |
challenge* | string | example: 3fe7f38bba329 |
captcha_url* | string |
Response Body
{
"status":"success",
"code":200,
"challenge":"3fe7f38bba329",
"captcha_url":"https://keep2share.cc/api/v2/reCaptcha.html?id=3fe7f38bba329"
}
get /captcha
This method returns an image with a code.
Parameters chevron_right expand_more
Parameter | Type | Description |
---|---|---|
Query | ||
id* | string | example: 3fe7f38bba329 |
curl -X GET \
https://keep2share.cc/api/v2/captcha?id=<value>
200 OK chevron_right expand_more
image/jpg
image/jpg
post /getSubscriptions
This method returns subscriptions by domain name.
Secured By chevron_right expand_more
curl -X POST \
-H "Content-type: application/json"
-d @body.json \
https://keep2share.cc/api/v2/getSubscriptions
Request Body chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
auth_token* | string | example: cb9tg4rt9lom9gb5i6tudgqlse |
domainName* | sring | example: "test.test" |
limit | integer | default 20 |
offset | integer | default 0 |
Request Body
{
"auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
"domainName":"test.test",
"limit":1
}
200 OK chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | success |
code* | integer | 200 |
files* | array |
Response Body
{
"status":"success",
"code":200,
"total":10,
"items": [
{
"userEmail":"user1@test.test",
"domainName":"test.test",
"expiresAt":"2021-08-25T15:23:15.000Z",
}
]
}
400 Bad Request chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 400 |
errorCode* | integer |
|
message* | string | Invalid request params |
Response Body
{
"status":"error",
"code":400,
"errorCode":2,
"message":"Invalid request params"
}
403 Forbidden chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 403 |
errorCode* | integer |
|
message* | string | You are not authorized for this action |
Response Body
{
"status":"error",
"code":403,
"errorCode":10,
"message":"You are not authorized for this action"
}
404 Not Found chevron_right expand_more
application/json
application/json
Parameter | Type | Description |
---|---|---|
status* | string | error |
code* | integer | 404 |
message* | string | Domain not found |
Response Body
{
"status":"error",
"code":400,
"message":"Domain not found"
}
Security Schemes
Security Scheme custom_scheme
curl -X <method> \
https://keep2share.cc/api/v2/<path>