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

and et cetera

Before you start

Please make sure you the following tools installed:

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" '{"acess_token":"yourtoken"}'\ 
https://keep2share.cc/api/v2/test
Response:
{
"status":"success",
"code":200
}

Authorization by login and password

We request an auth_token from the server.

CURL:

Request:
$ curl -X POST\
-H "Content-type: application/json"\
'{"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"
}

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.

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:

$ ./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":"flmuf4o3uo59s105546dmvmq60","file_id":"a4b8776255352"}'\ 
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('a4b8776255352'));
/*
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"
}
*/

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

Console Uploader

The application allows automated and quickly upload files to your account and receive links.

There are things it can do for you:

  • Upload a specific file from your computer
  • Upload files from specific folder from your computer
  • Create the CSV file with operetion's result.

Quick start

Usage

$ partnercli upload

Options

-a, --access-token=access-token              (required) access token from your profile
-c, --path-to-csv=path-to-csv                [default: upload_log.csv] local path to generated result file
-d, --destination-folder=destination-folder  folder Id on server
-j, --stdout-json=stdout-json                stdout in json format
-n, --domain-name=k2s|fb|p2m|tz              [default: k2s] domain name for generated URLs
-s, --source-folder=source-folder            (required) path to local folder

Aliases

$ partnercli u
$ partnercli upl

Examples

\partnercli-win.exe upload 
-a 23ffbcbacb549ae531a45d04b32880bc8560a34a -n k2s -s .\

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

ParameterTypeDescription
username*string
password*string

example: password

re_captcha_challengestring

example: 3fe7f38bba329

re_captcha_responsestring

example: 3fe7f38bba329asdasasd

Request Body

{
    "username":"test",
    "password":"pass",
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 71 - Login attempts exceeded
  • 72 - Account banned
  • 73 - No allow access from network
  • 74 - Unknown login error
  • 75 - Illegal session IP
  • 76 - Account stolen
  • 77 - Network banned
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 33 - ReCaptcha required
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

ParameterTypeDescription
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"
}

403 Forbidden chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 71 - Login attempts exceeded
  • 72 - Account banned
  • 73 - No allow access from network
  • 74 - Unknown login error
  • 75 - Illegal session IP
  • 76 - Account stolen
  • 77 - Network banned
message*string

example: Network banned

Response Body

{
    "status":"error",
    "code":403,
    "errorCode":77,
    "message":"Network banned"
}

get /reCaptcha

 

This method returns an html page with Google captcha.

Parameters chevron_right expand_more

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

message*string

Response Body

{
    "status":"error",
    "code":400,
    "message":"Id not found"
}

post /test

 lock

This method allows to check auth-token lifetime.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
curl -X POST \
  -H "Content-type: application/json"
  -d @body.json \
  https://keep2share.cc/api/v2/test

Request Body chevron_right expand_more

application/json

application/json

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

message*string

Test was successful!

Response Body

{
    "status":"success",
    "code":200,
    "message":"Test was successful!"
}

403 Forbidden chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer

10

message*string

You are need authorized

Response Body

{
    "status":"error",
    "code":403,
    "errorCode":10,
    "message":"You are not authorized for this action"
}

post /accountInfo

 lock

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

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

available_traffic*integer

in bytes

account_expires*integer

timestamp

Response Body

{
    "status":"success",
    "code":200,
    "available_traffic":0,
    "account_expires":1232243
}

403 Forbidden chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
message*string

You are need authorized

Response Body

{
    "status":"error",
    "code":403,
    "errorCode":10,
    "message":"You are not authorized for this action"
}

post /getBalance

 lock

This method returns user/partner balance.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method returns a list of available domains for a partner. It is necessary for file upload.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to recieve previously created reseller code or create a new one.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

days*integer

example: 7

useExistboolean

default: true

autoBuyboolean

default: true

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "days":7,
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 50 - No available reseller codes
  • 51 - Error buy reseller codes
message*string

example: No available reseller codes

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":50,
    "message":"No available reseller codes"
}

post /getFoldersList

 lock

This method returns User's/Partner's list of folders.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

foldersList*array

example: [ 'test', 'simple' ]

foldersIds*array

example: [ 'r3r3454', 'sgertgertert' ]

Response Body

{
    "status":"success",
    "code":200,
    "foldersList":['test','simple'],
    "foldersIds":['r3r3454','sgertgertert']
}

403 Forbidden chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

name*string

example: test

parent*string

parent_id or set default '/'

access*string
Enum:
  • public
  • private
  • premium
is_publicboolean

default: false

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "name":"test",
    "parent":"/",
    "access":"public"
}

201 Created chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

201

id*string

example: mt2dr45tlnev

Response Body

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

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 60 - Error create folder
message*string

Error create folder

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":60,
    "message":"Error create folder"
}

post /getFilesList

 lock

This method allows you to recieve File list by its ID or from root folder in user space.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

parentstring

default '/'

limitinteger

default 100

offsetinteger

default 0

sortarray

examples:

{ id: -1 },

{ id: -1 },

{ name: 1 },

{ name: -1 },

{ date_created: 1 },

{ date_created: -1 }

only_availableboolean

default false

extended_infoboolean

default false

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

files*array

Response Body

{
    "status":"success",
    "code":200,
    "files": [
        {
            "id":1,
            "name":"test",
            "is_available":true,
            "is_folder":false,
            "date_created":"2019-01-01 00:00:01",
            "size":1024,
            "md5":"sdfsfsdfsdfsdfsdf",
            "extended_info": {
                "abuses":{},
                "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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to recieve file information usin files ID.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

ids*array

example: {'358b6aa520a72', '96a9d7445484c'}

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "ids":{"358b6aa520a72"}
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

files*array

Response Body

{
   "status":"success",
   "code":200,
   "files": [
       {
           "id":1,
           "name":"test",
           "is_available":true,
           "is_folder":false,
           "date_created":"2019-01-01 00:00:01",
           "size":1024,
           "md5":"sdfsfsdfsdfsdfsdf",
           "extended_info":{
               "abuses":{},
               "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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to change properties of files.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

ids*array

example: {'83f09624b61db', '83f09624b61ds'}

new_namestring

example: test

new_parentinteger

parent_id or default '/'

new_accessstring
Enum:
  • public
  • private
  • premium
new_is_publicboolean

default false

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "ids":["83f09624b61db","83f09624b61ds"]
    "new_name":"test"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

files*array

Response Body

{
    "status":"success",
    "code":200,
    "files": [
        {
            "id":"sdfsdfsdfsdfd",
            "status":"success",
            "errors":[]
        }
    ]
}

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows user files deletion.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
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

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to check file presence in our cloud storage using hash sum (md5).

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

md5*string

example: 'c49tg4rt9ldk9gb5i6tudgqlse'

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "md5":"c49tg4rt9ldk9gb5i6tudgqlse"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to create a file by hash sum (md5)

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

hash*string

example: 'c49tg4rt9ldk9gb5i6tudgqlse'

name*string

example: 'test2'

parentstring

parent_id or set default '/'

accessstring
Enum:
  • public
  • private
  • premium

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "hash":"c49tg4rt9ldk9gb5i6tudgqlse",
    "name":"test2"
}

201 Created chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

201

id*string

example: mt2dr45tlnev

Response Body

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

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 61 - Error create file
message*string

Error create file

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":61,
    "message":"Error create file"
}

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

ParameterTypeDescription
id*string

default '96a9d7445484c'

limitinteger

default 100

offsetinteger

default 0

Request Body

{
    "id":"96a9d7445484c"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

files*array

Response Body

{
    "status":"success",
    "code":200,
    "files": [
        {
            "id":1,
            "name":"test",
            "is_available":true,
            "is_folder":false,
            "date_created":"2019-01-01 00:00:01",
            "size":1024,
            "md5":"sdfsfsdfsdfsdfsdf"
        }
    ]
}

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

 lock

This method allows to change file properties.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

id*string

example: '83f09624b61db'

new_namestring

example: test

new_parentinteger

parent_id or default '/'

new_accessstring
Enum:
  • public
  • private
  • premium
new_is_publicboolean

default false

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "id":"83f09624b61db"
    "new_name":"test"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

files*array

Response Body

{
    "status":"success",
    "code":200,
    "files": [
        {
            "id":"83f09624b61db",
            "status":"success",
            "errors":[]
        }
    ]
}

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 61 - Error update file
message*string

Error update file

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":61,
    "message":"Error update file"
}

post /getUploadFormData

 lock

This method allows to recieve file uploading form.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

parent_id*string

parent_id or set default '/'

preferred_nodestring

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "parent_id":"/"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 63 - No available nodes
message*string

No available nodes

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":63,
    "message":"No available nodes"
}

post /remoteUploadAdd

 lock

This method allows to add links for remote upload.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

urls*array

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "urls":['http://google.com']
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

acceptedUrls*array
rejectedUrls*array

example: []

Response Body

{
    "status":"success",
    "code":200,
    "acceptedUrls":['http://google.com'],
    "rejectedUrls":[]
}

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 63 - No available nodes
message*string

No available nodes

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":63,
    "message":"No available nodes"
}

post /remoteUploadStatus

 lock

This method allows to check status of recently added file links.

Secured By chevron_right expand_more

Custom Scheme custom_scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
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

ParameterTypeDescription
auth_token*string

example: cb9tg4rt9lom9gb5i6tudgqlse

ids*array

example: ['27dddcb772fec']

Request Body

{
    "auth_token":"cb9tg4rt9lom9gb5i6tudgqlse",
    "ids":['27dddcb772fec']
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

uploads*array

Response Body

{
    "status":"success",
    "code":200,
    "uploadss":[
      {
        "status":"new",
        "progress":50,
        "file_id":"27dddcb772fec"
      }
    ]
}

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 10 - You are need authorized
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

ParameterTypeDescription
file_id*string

example: 3fe7f38bba329

auth_tokenstring

example: 3fe7f38bba329asdasasd

free_download_keystring

example: 3fe7f38bba329

captcha_challengestring

example: 3fe7f38bba329asdasasd

captcha_responsestring

example: 3fe7

url_referrerstring

Request Body

{
    "file_id":"3fe7f38bba329"
}

200 OK chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

success

code*integer

200

url*string

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

ParameterTypeDescription
status*string

error

code*integer

400

errorCode*integer
  • 3 - Incorrect param value
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

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 71 - Login attempts exceeded
  • 72 - Account banned
  • 73 - No allow access from network
  • 74 - Unknown login error
  • 75 - Illegal session IP
  • 76 - Account stolen
  • 77 - Network banned
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

ParameterTypeDescription
status*string

error

code*integer

406

errorCode*integer
  • 1 - Download count exceeded
  • 2 - Download traffic exceeded
  • 3 - Download file size exceeded
  • 20 - File not found
  • 21 - File is not available
  • 22 - File is blocked
  • 30 - Captcha required
  • 31 - Invalid captcha
  • 40 - Wrong free download key
  • 41 - Need wait for free
  • 42 - Download is not available
message*string

example: Captcha required

Response Body

{
    "status":"error",
    "code":406,
    "errorCode":30,
    "message":"Captcha required"
}

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

ParameterTypeDescription
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"
}

403 Forbidden chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

403

errorCode*integer
  • 71 - Login attempts exceeded
  • 72 - Account banned
  • 73 - No allow access from network
  • 74 - Unknown login error
  • 75 - Illegal session IP
  • 76 - Account stolen
  • 77 - Network banned
message*string

example: Network banned

Response Body

{
    "status":"error",
    "code":403,
    "errorCode":77,
    "message":"Network banned"
}

get /captcha

 

This method returns an image with a code.

Parameters chevron_right expand_more

ParameterTypeDescription
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

400 Bad Request chevron_right expand_more

application/json

application/json

ParameterTypeDescription
status*string

error

code*integer

400

message*string

Response Body

{
    "status":"error",
    "code":400,
    "message":"Id not found"
}

Security Schemes

Security Scheme custom_scheme

Custom Scheme

To start using API you need to have Keep2Share user account or Partner Account:

  • For Partner Account you can set access_token parameter while running any methods from this API. You can find the access_token on this page
  • For Keep2Share user account you need to login to the API
curl -X <method> \
  https://keep2share.cc/api/v2/<path>