What is DART API?

Dart api provided the ability to external system to connect with the Dart.By using api, user can create and manage the dart's users externally.In here bearer token use to identify the api users.

logo

API Url: https://api.dart.cash/api

Authentication

As below after create API token using for authenticate with the API, simply append the bearer token GET parameter to the API's base URL:

                                
1$request->setHeader(array(
2 'Authorization' => 'Bearer <token>'
3));

Get external customer

In order to get customer details an HTTP GET request containing a series of parameters and objects to the API's customer/get endpoint is required. All parameters and objects are specified below:

Name Description
dart_user_name This parameter is used in order to specify a customer user name.

API Request

1$request = new HTTP_Request2();
2$request->setUrl('https://api.dart.cash/api/customer/get?dart_user_name=billyjoel');
3$request->setMethod(HTTP_Request2::METHOD_GET);
4$request->setConfig(array(
5 'follow_redirects' => TRUE
6));
7$request->setHeader(array(
8 'Accept' => 'application/json',
9 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT'
10));

API Response

1{
2 "first_name": "Billy",
3 "last_name": "Joel",
4 "dart_user_name": "billyjoel",
5 "email": "billy@gmail.com"
6}

Create external customer

In order to create external customer an HTTP POST request containing a series of parameters and objects to the API's customer/create endpoint is required. All parameters and objects are specified below:

Name Description
first_name This parameter is used in order to specify a customer first name.
last_name This parameter is used in order to specify a customer last name.
user_name This parameter is used in order to specify a customer user name.
email This parameter is used in order to specify a customer email.
password This parameter is used in order to specify a customer password.

API Request

1$request = new HTTP_Request2();
2$request->setUrl('https://api.dart.cash/api/customer/create');
3$request->setMethod(HTTP_Request2::METHOD_POST);
4$request->setConfig(array(
5 'follow_redirects' => TRUE
6));
7$request->setHeader(array(
8 'Accept' => 'application/json',
9 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT'
10));
11$request->addPostParameter(array(
12 'first_name' => 'Billy ',
13 'last_name' => 'Joel',
14 'user_name' => 'billyjoel',
15 'email' => 'billy@gmail.com',
16 'password' => 'billy@123#'
17));

API Response

1"Customer Created Successfully."

Edit external customer

In order to edit external customer an HTTP POST request containing a series of parameters and objects to the API's customer/update endpoint is required. All parameters and objects are specified below:

Name Description
dart_user_name This parameter is used in order to specify a customer user name.
first_name This parameter is used in order to specify a customer first name.
last_name This parameter is used in order to specify a customer last name.
email This parameter is used in order to specify a customer email.
password This parameter is used in order to specify a customer password.

API Request

1$request = new HTTP_Request2();
2$request->setUrl('https://api.dart.cash/api/customer/update');
3$request->setMethod(HTTP_Request2::METHOD_POST);
4$request->setConfig(array(
5 'follow_redirects' => TRUE
6));
7$request->setHeader(array(
8 'Accept' => 'application/json',
9 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT'
10));
11$request->addPostParameter(array(
12 'dart_user_name' => 'billyjoel',
13 'first_name' => 'Billy',
14 'last_name' => 'Joel',
15 'email' => 'billy@gmail.com',
16 'password' => 'billy@123'
17));

API Response

1"Customer Updated Successfully."

Restriction for trade scripts

In order to restrict for trade scripts an HTTP POST request containing a series of parameters and objects to the API's customer/update-tsp-status endpoint is required. All parameters and objects are specified below:

Name Description
dart_user_name This parameter is used in order to specify a customer user name.
external_tsp_status Set to false in order to restrict for trade scripts.

API Request

1$request = new HTTP_Request2();
2$request->setUrl('https://api.dart.cash/api/customer/update-tsp-status');
3$request->setMethod(HTTP_Request2::METHOD_POST);
4$request->setConfig(array(
5 'follow_redirects' => TRUE
6));
7$request->setHeader(array(
8 'Accept' => 'application/json',
9 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT'
10));
11$request->addPostParameter(array(
12 'dart_user_name' => 'billyjoel',
13 'external_tsp_status' => 'false'
14));

API Response

1"Customer Tsp Access Disabled"

Customer trade script details

In order to get customer trade script details an HTTP GET request containing a series of parameters and objects to the API's customer/trade-script-details endpoint is required. All parameters and objects are specified below:

Name Description
dart_user_name This parameter is used in order to specify a customer user name.

API Request

1$request = new HTTP_Request2();
2$request->setUrl('https://api.dart.cash/api/customer/trade-script-details?dart_user_name=billyjoel');
3$request->setMethod(HTTP_Request2::METHOD_GET);
4$request->setConfig(array(
5 'follow_redirects' => TRUE
6));
7$request->setHeader(array(
8 'Accept' => 'application/json',
9 'Authorization' => 'Bearer 2|BtyCiKlUQ8wSDlhCAXYVMljlFudQKb5AqWhLOmTT'
10));

API Response

1{
2"data": [
3{
4"trade_script_name": "Full Velocity Members Only",
5"initial_amount": "49.25",
6"current_amount": "49.2500",
7"status": 5,
8"total_deposit": "50.0000",
9"activate_date": "2022-06-08"
10}
11]
12}

Webhook

Customer activate

After activating your customer from the Dart system you will receive a Webhook HTTP POST response from this your-domain/webhook/customer-activate endpoint.

Webhook Response

1{
2 "message" : "External customer activated.",
3 "old_dart_user_name" : "billyjoel",
4 "new_dart_user_name" : "billyjoel"
5}

Customer update

After updating your customer details from the Dart system you will receive a Webhook HTTP POST response from this your-domain/webhook/customer-update endpoint.

Webhook Response

1{
2 "message" : "External customer information updated",
3 "old_dart_user_name" : "billyjoel",
4 "new_dart_user_name" : "billy"
5}

Customer deactivate

After deactivating your customer from the Dart system you will receive a Webhook HTTP POST response from this your-domain/webhook/customer-deactivate endpoint.

Webhook Response

1{
2 "message" : "External customer deactivated."
3 "old_dart_user_name" : "billyjoel",
4 "new_dart_user_name" : "billyjoel"
5}