NAV Navbar
shell javascript

Introduction

Tokenest Open API Introduction Related Documents

By understanding the following information, you can easily access the Tokenest fund platform using the API provided by Tokenest

Authentication

restriction of visit

The current access frequency is 100 times / 10 seconds per user, and the frequency limit will be accessed according to the service in the future.

API verification

To authorize, use this code:

curl -X POST \
  https://fund-api.tokenest.io/v1/open/authorization \
  -H 'Content-Type: application/json' \
  -d '{
    "apikey": "testApiKey",
    "timestamp": 1539422679422,
    "nonce": "xxxxxxxx",
    "sign": "textSign"
}'
var data = JSON.stringify({
  "apikey": "testApiKey",
  "timestamp": 1539422679422,
  "nonce": "xxxxxxxx",
  "sign": "textSign"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://fund-api.tokenest.io/v1/open/authorization");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

Make sure to replace testApiKey with your API key.

Tokenest uses API keys to allow access to the API. You can register a new Tokenest Open API key at our developer portal.

HTTP Request

Parameter Type Description
apikey string Tokenest API Key
timestamp integer Current timestamp (ms)
nonce string Random string
sign string signature

Signature method

All requested keys are sorted alphabetically, then url parameterized and connected with &. After the connection is completed, Base64 encoding is performed, HMAC-SHA1 is signed using the apisecret for the encoded data, and the signature is subjected to secondary Base64 encoding.

HTTP Response

Parameter Type Description
access_token string verification TOKEN

verification

# With shell, you can just pass the correct header with each request
curl --request GET \
  --url https://fund-api.tokenest.io/v1/open/*\
  --header 'Authorization: Bearer xxxxxxxxxxxx'
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://fund-api.tokenest.io/v1/open/authorization");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer xxxxxxxxxx");

xhr.send();

Make sure to replace xxxxxxxxxx with your Access Token.

Fund information

Fund List

Get all fund information

List of funds

curl --request GET \
  --url https://fund-api.tokenest.io/v1/open/list
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://fund-api.tokenest.io/v1/open/list");

xhr.send(data);

HTTP request response results are as follows:

{
    "msg": "success",
    "data": [
        {
            "fund_id": 6,
            "name": "Test fund 01",
            "time_line": null,
            "target_scale": "3.000000000000000000",
            "raise_amount": "0.000000000000000000",
            "raise_percent": "0.00000",
            "min_amount": null,
            "max_amount": null,
            "expected_return": "0.10000",
            "raise_start": 1541779200,
            "raise_end": 1542297599,
            "launch_start": 1542297600,
            "launch_end": 1543593599,
            "status": -99
        },
    ]
}

HTTP Request

GET https://fund-api.tokenest.io/v1/open/list

HTTP Response

Parameter Type Description
fund_id integer The ID of fund
name string fund name
time_line integer Fund cycle, unit: day
target_scale real Fund target size
raise_amount real Raising amount
raise_percent real Fundraising completion percentage %
min_amount real The minimum investment amount of the fund
max_amount real The maximum investment amount of the fund
expected_return real Fund Expected Return Rate %
raise_start string Fund raising start time
raise_end string Fund raising end time
launch_start string Fund run start time
launch_end string End of fund run time
status integer Fund Status

Fund status description:

Parameter Description
-99 Has been removed
-50 Suspended
0 To be online
10 Fundraising
20 Running
30 In settlement

Fund details

Get fund details

curl --request GET \
  --url https://fund-api.tokenest.io/v1/open/detail?id=6 \
  --header 'cache-control: no-cache'
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://fund-api.tokenest.io/v1/open/detail?id=6");

xhr.send(data);

HTTP request response results are as follows:

{
    "msg": "success",
    "data": {
        "fund_id": 6,
        "name": "Test fund 01",
        "time_line": null,
        "target_scale": "3.000000000000000000",
        "raise_amount": "0.000000000000000000",
        "raise_percent": "0.00000",
        "min_amount": null,
        "max_amount": null,
        "expected_return": "0.10000",
        "raise_start": "2018-11-09T16:00:00.000Z",
        "raise_end": "2018-11-15T15:59:59.000Z",
        "launch_start": "2018-11-15T16:00:00.000Z",
        "launch_end": "2018-11-30T15:59:59.000Z",
        "status": -99
    }
}

HTTP Request

GET https://fund-api.tokenest.io/v1/open/detail?id=$fund_id

Parameter Type Description
fund_id integer The ID of fund

HTTP Response

Parameter Type Description
Fund_id integer The ID of fund
Name string fund name
Time_line integer Fund cycle, unit: day
Target_scale real Fund target size
Raise_amount real Raising amount
Raise_percent real Fundraising completion percentage %
Min_amount real The minimum investment amount of the fund
Max_amount real The maximum investment amount of the fund
Expected_return real Fund Expected Return Rate %
Raise_start string Fund raising start time
Raise_end string Fund raising end time
Launch_start string Fund run start time
Launch_end string End of fund run time
Status integer Fund Status

Fund status description:

Parameter Description
-99 Has been removed
-50 Suspended
0 To be online
10 Fundraising
20 Running
30 In settlement

Fund trading

Applying for funds

Investor submits fund subscription application

List of funds

curl -X POST \
  https://fund-api.tokenest.io/v1/open/apply \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "test@tokenest.io",
    "first_name": "Jack",
    "last_name": "White",
    "area": 86,
    "mobile": "13888888888",
    "passport": "EC0201256789",
    "file": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2==",
    "address": "0x12c3D7331D0f0fee20e448C7c2B940C840615b3A",
    "fund_id": 6
}'
var data = JSON.stringify({
  "email": "test@tokenest.io",
  "first_name": "Jack",
  "last_name": "White",
  "area": 86,
  "mobile": "13888888888",
  "passport": "EC0201256789",
  "file": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1Pe==",
  "address": "0x12c3D7331D0f0fee20e448C7c2B940C840615b3A",
  "fund_id": 6
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://fund-api.tokenest.io/v1/open/apply");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

HTTP request response results are as follows:

{
    "msg": "success",
    "data": {
        "address": "0xcab6adcc1b9565e324255cbe13a21f6cb65c6f4d"
    }
}

HTTP Request

POST https://fund-api.tokenest.io/v1/open/apply

Parameter Type Description
email string Email
first_name string First name
last_name string Last name
area integer area code
mobile string phone number
passport string passport
file string ID image Base64 encoding
address string Investment Address
fund_id integer Fund ID

HTTP Response

Parameter Type Description
address string Fund investment address

KYC Status Query

Investment application KYC status inquiry

List of funds

curl -X GET \
  'https://fund-api.tokenest.io/v1/open/kyc?address=0x1985a778a74A187e02CcE6f74a6C40215b9c4fFf' \
  -H 'Postman-Token: a7b497b0-0990-462e-8e36-5f0ea1b06d53' \
  -H 'cache-control: no-cache'
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://fund-api.tokenest.io/v1/open/kyc?address=0x1985a778a74A187e02CcE6f74a6C40215b9c4fFf");

xhr.send(data);

HTTP request response results are as follows:

{
    "msg": "success",
    "data": {
        "address": "0xcab6adcc1b9565e324255cbe13a21f6cb65c6f4d"
    }
}

HTTP Request

GET https://fund-api.tokenest.io/v1/open/kyc?address=$address

Parameter Type Description
address string investment address

HTTP Response

Parameter Type Description
address string Fund investment address

Errors

The Tokenest Open API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The resource requested is hidden for administrators only.
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many resources! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.