undefined
undefined
curl

Introduction and About

Welcome to Digital Ticks API documentation.

Login API'S

Get Login API Details

curl -X POST --header 'Content-Type: application/json'
'https://login.dtx.trade/Authonticate.svc/mobilesecure/Login'

REQUEST DATA :

{
      "loginrequest":{  
        "CaptchaCapture":null,
        "Exchange":null,
        "IsAutoLogin":false,
        "credential":{  
            "API":"www.digitalticks.com",
            "ClientType":1,
            "ClientVersion":"3.0.0.0(0)",
            "DeviceManufacture":"Microsoft",
            "DeviceModel":"Windows Server 2012",
            "DeviceType":1,
            "IsAcceptedAggrement":true,
            "Location":"10.10.3.142",
            "MacID":"0050569A7F5C",
            "Password":"VQYvnnuEeYsn7khClhhR3jaSmWFLJIi4vgJ80pkEjHI=",
            "UserID":"8921",
            "UserOSVersion":"6.2.9200.0",
            "UserType":"CL"
        }
    }
}

RESPONSE :

{
     "IsSuccess":true,
    "Message":"Successfully logged in",
    "Access Type":"19",
    "EmailID":"test@gmail.com",
    "ExpiringPackages":[  

    ],
    "IcoData":{  
        "data":null,
        "message":"login failed",
        "success":true
    },
    "InActivedPackages":[  

    ],
    "IsgoogleAuthEnabled":false,
    "Level":2,
    "PackageInfo":null,
    "RemainTime":"",
    "SessionToken":"uboiTe9RzQg+39mjnqTPRnN92Grg+bTKqz3ROOvaA\/oPOTQvB3K\/sLLQGrerd7SAO0vsWhwTqrrvG51Zu3WzAQ==",
    "TwoFacAuthCode":0,
    "UpdatePriority":null,
    "UpdateScrips":{  
        " Contracts":[  
            {  
                "CrCoinID":0,
                "Description":"INRM:BTC,  ",
                "DrCoinID":10,
                "ExchangeID":59,
                "ExchangeName":"INRM",
                "ExpireDate":null,
                "ID":1407,
                "IsActive":true,
                "IsSelectable":false,
                "Location":"",
                "Name":"BTC",
                "OneIncrement":"1E-05",
                "OrderIndex":0,
                "Position":"NEAR",
                "QuantityRoundOffValue":3,
                "RoundOffValue":5,
                "SecondIncrement":"",
                "SymbolID":419
            }
        ],
        " Exchanges":[  
            {  
                "Action":"New",
                "ExchangeID":56,
                "ExchangeName":"BTC",
                "IsDefault":false,
                "LastRefreshTime":" 19-02-2019 15:55:24",
                "Srno":1,
                "TimeZone":"Pacific/Honolulu"
            }
        ],
        " Fields":[  
            {  
                "Header":"Exchange",
                "ID":70,
                "IsCompare":false,
                "Name":"Exchange",
                "OrderIndex":1,
                "UpdatedOn":"2/17/2015 3:02:50 PM",
                "ValueType":"String"
            }
        ],
        "IsSuccess":true,
        "Message":[  

        ],
        "TotalExchange":5,
        "TotalContracts":19,
        "TotalFields":19
    },
    "UserName":"8921"
 }

AUTHENTICATION REQUEST :

{
   "AccessType":18,
   "ClientID":"32448",
   "ClientVersion":"1.0.28(29)",
   "ContractList":[  

   ],
   "DeviceType":2,
   "Order":{  
      "OrderType":0
   },
   "OrderType":0,
   "RequestedSymbolList":[  

   ],
   "Requesttype":"AUTHENTICATE",
   "SessionID":"EXXc3rYKefCgLJuycyIDasiP5/DYfude3FGUfnd3OvReDtICrFsL9WWW/xfNlB2X",
   "SubscribedCoins":[  

   ]
}

Login Api Description:

This is API is used for login into Digital Ticks application, whenever user logs into application, there are several different parameter returned in the responses by API. First is Session Token, which is used for authentication process means whenever user wants to access any API they have to pass this token value into request format.

Request Description:

1. Client Type: It's used for identify client type i.e. 1 for Mobile, 2 for Windows, 3 for WEB

2. Device Type: It's used for identified user device like Android, I-phone, Windows PC, Web server

3. User Id: for login you have to pass your valid user id

4. Password: for login you have to pass your valid password

Response Description:

1. Client Type: It's session token generated by system and used for authentication of every API hits.

2. Update Scripts: Inside this payload , there are 3 measure payload are useful i.e.

Authenticate Request:

After successfull login, User have to send one Authentication request for performing next operation. as per request json format whhich is shown under "AUTHENTICATION REQUEST" payload, user have pass Access Type, Client Id , Request Type as "AUTHENTICATE" and Session Id which is generated by after login.

Master API'S

Get Master API Details



curl -X POST --header 'Content-Type: application/json' 
'https://links.dtx.trade/API/GetAPILinks'

REQUEST DATA :

{
          "API":"DT"
}

RESPONSE :

{
       "IsSuccess":true,
    "AllApiLinks":[  
        {  
            "ServiceName":"Login",
            "ServiceURL":"https://login.dtx.trade/Authonticate.svc/mobilesecure/Login"
        },
        {  
            "ServiceName":"UploadPhoneBook",
            "ServiceURL":"https://login.dtx.trade/Authonticate.svc/mobilesecure/UploadPhoneBook"
        }
    ]
}

Master Api Description:

This is API used for getting all API's list which is used into our DT application, with help of this user don't want to store API link on his database, if any API link will be change by admin side then it doesn't affect any API call, because user calling API from this master Link.

Coin API

Get Coin API Details

curl -X POST --header 'Content-Type: application/json' 
             -ServiceName 'WalletCoins_v1'
             -ServiceURLs 'https://register.dtx.trade/api/Wallet1/GetAllCoins'

RESPONSE :

{
    "success":1,
    "error":0,
    "UserID":null,
    "msg":null,
    "data":[  
        {  
            "CoinID":0,
            "CoinName":"Bitcoin",
            "CoinAlias":"BTC",
            "IsActive":true,
            "IsWalletActive":true,
            "FilePath":"https://register.dtx.trade/CoinIcons/i_btc.png",
            "Basepriceroundoff":8,
            "TargetPriceRoundoff":2,
            "ERCContractAddr":null,
            "CurrencyModel":"Bcp",
            "IsERCcontract":false,
            "Conformation_Required":6,
            "MinWithdrawalAmount":2,
            "WithdrawalFee":0,
            "StartDate":"2019-02-07T18:30:00Z",
            "StartTime":"16:16:00",
            "EndDate":"2019-02-14T18:30:00Z",
            "EndTime":"05:20:00"
        }
    ]
}

Response Description:

As per above response this is all COIN data response, in which "data" payload is useful for collection coin data from response. Coin data have Coin Id, Coin Name, Image path, Coin alias and round off value. For getting coin data there is no need pass any request payload to API , it will generate response which shown above

RATES API

Get Rates API Details

 --ServiceName 'Rates' 
 -SOCKET  'wss://rates.dtx.trade?SUBSCRIBER=0&test=0'

For getting Socket URL for rates use above key from Master API list.:

{
     "AccessType":19,
    "ClientID":"8850",
    "ClientVersion":"1.0.24(25)",
    "DeviceType":2,
    "RequestedSymbolList":[  
        {  
            "ContractID":921,
            "ExchangeID":55,
            "contractName":"BTC",
            "symbolID":385
        },
        {  
            "ContractID":1383,
            "ExchangeID":55,
            "contractName":"DOGE",
            "symbolID":386
        },
        {  
            "ContractID":1405,
            "ExchangeID":55,
            "contractName":"DTX",
            "symbolID":403
        },
        {  
            "ContractID":949,
            "ExchangeID":55,
            "contractName":"ETH",
            "symbolID":384
        },
        {  
            "ContractID":1382,
            "ExchangeID":55,
            "contractName":"LTC",
            "symbolID":387
        }
    ],
    "Requesttype":"RATE",
    "SessionID":"Axhi1AqvK+CjJgb3dkavPCU3kD+H4i+KCtX7uvZ9zzqNa307NS4xbyzpMxt6zpPXZJLxH+PI3q5UHmVBNDNxcQ\u003d\u003d"
}

Request Description:

For getting rate for every symbol user have to pass symbol id in request payload. Request payload details:

1. ClientId: Pass your User id into this key.

2. DeviceType: pass you device id to this key which is 1 for mobile, 2 for web and so on.

3. RequestSymbolList: It is list of symbols which used for getting rates for those symbols

4. Requesttype: for getting rates data user has to specify "RATE" value to this key.

5. SessionId: for validating socket request user has to specify his session id to this key which is generated after successful login.

Fields Table Data:

This is list fields which are received after successful login.

Header ID IsCompare Name OrderIndex UpdatedOn ValueType
Exchange 70 False Exchange 1 "02/072015" String
Symbol 24 False Symbol 2 "02/072015" String
Time 91 False Time 3 "02/072015" String
Bid Qty 5 True BIDQty 4 "02/072015" Numeric
Bid 4 True BID 5 "02/072015" Numeric
Ask 1 True ASK 6 "02/072015" Numeric
Ask Qty 2 True ASKQty 7 "02/072015" Numeric
LTP 15 True LTP 8 Numeric
Net Change 54 False NetChange 9 Numeric
% Change 19 True PChange 10 Numeric
Volume 28 True Volume 11 Numeric
Open Interest 83 False OpInt 12 Numeric
Open 18 False OPEN 13 Numeric
High 10 False HIGH 14 Numeric
Low 14 False LOW 15 Numeric
Close 6 False CLOSE 16 Numeric
BTC Price 13 False TargetPrice 17 Numeric
PQU 20 False PQU 18 String
Exp 9 False EXP 19 String

As per rates response which is coming in Pipe separator, below describing for same.

USDM|test|1551882282314.48|1|55.09|55.11|1|55.1:0|3.730000000000000000:1| 7.2610473038738563363831029800:1|4267996.000000000000000000:0|| 0|55.20|51.550000000000000000|0|55.1||

When we split above output by pipe(|) we will get this type of output : As per some output It is again separated by colon (:) like in LTP, Net Change, PChange and Volume. so second part represents increment, decrement and no change part

1: for Increment value

-1: for decrement value

0: for no change

Split Output Field Details With Order Id Description Rates for Increase and decrease points
USDM Exchange -1 First order index contains exchange
name.
test Exchange -1 2nd order index contains Symbol Name
1551882282314.48 Time -3 3rd order index contains Time
1 Bid Qty -4 4th order index contains bid quantity
and it comparable field
55.09 Bid - 5 5th order index contains bid value and
it comparable field
55.11 Ask - 6 6th order index contains ask value and
it comparable field
1 Ask Qty - 7 7th order index contains ask quantity
and it comparable field
55.1:0 LTP - 8 8th order index contains LTP value
and it comparable field 0 : not change
3.730000000000000000:1 Net Change - 9 9th order index contains net changes
value and it is not comparable field 1 : increase
7.2610473038738563363831029800:1 % Change -10 10th order index have change value in
percentage and it is comparable field. 1 : increase
4267996.000000000000000000:0 Volume - 11 11th order index have Volume value and
it is comparable field. 0 : not change
0 Open Interest - 12 12 order index have open interest
55.2 Open - 13 13 order index have Open value
51.55 High - 14 14 order index have High value
0 Low - 15 15 order index have Low value
55.1 Close - 16 16 order index have Close value
BTC Price - 17 17 order index have BTC price value
PQU - 18 18 order index have PQU value
Exp - 19 19 order index have Exp value

Response Description:

When will get response from socket link it is another format not in Json format, This is string with pipe(|) delimiter separate format, every response have "=>" this type of symbol which is define 2 types of data separation.

  1. On left side of this("=>") symbol represents response type i.e. "RATEDATA"
  2. On right side of this("=>") symbol will get list of data which is in pipe separator , again its representation of 2 types data i.e. separated by "^"(caret)
  3. When we separate data by "^"(caret) will get 2 types spitted data.
  4. First part represents Contract Id which means this rates coming for this respective contract id, which is passed into request payload.
  5. Second part represent string data separated by pipe.

Dom API - Socket

Get DOM API - Socket Details

curl -X POST --ServiceName 'Rates'
             -ServiceURL 'wss://rates.dtx.trade?SUBSCRIBER=0&test=0'

For getting DOM data from DT app, this is again socket connection pattern data, for getting socket link of DOM use above key from Master API list:

{
    "ClientID":8850,
    "ContractID":"1382",
    "deviceType":2,
    "RequestType":"DOM"
}

Request payload description:

Response payload description:

It is similar response like RATE.

  1. ("=>") this separator first part represent "DOMDATA" and second part have data.
  2. Second part data again represents 2 parts data, which is separated by "^"(caret)
  3. First part given Contract Id and second part list data of DOM in pipe separated format.

TAS API - SOCKET

Get TAS API Details



curl -X POST --ServiceName 'Rates' 
             -SOCKET  'wss://rates.dtx.trade?SUBSCRIBER=0&test=0'

REQUEST DATA :

{
   "AccessType":19,
    "ClientID":8850,
    "ClientVersion":"1.0.11(2)",
    "ContractID":"1382",
    "deviceType":2,
    "RequestType":"TAS",
    "SessionID":"AMAud7Zvnkng8QRVm0gPNMOI1eMIbCwe5Cgu9nmb8hiTmWAjLil6coJqE3EQFrOgJALIhbAiUDii/MheDoIFOg== "
}

TAS API Description:

For getting TAS data from DT app, this is again socket connection pattern data, for getting socket link of TAS use below key from Master API list

RESPONSE :

TAS=>[{B: 2, P: 3868, QT: 7, SC: 921, TT: "2019-03-07T05:57:18.9690000Z"},{B: 2, P: 3868, QT: 7, SC: 921, TT: "2019-03-07T05:57:18.9690000Z"}]

Request payload description:

Response payload description:

It is similar response like RATE.

  1. ("=>") this separator first part represents "TAS" and second part has data.
  2. This output 2nd part is deferent from previous socket API's, it contain list JSON value format data.
    1. B: Type of buy/sell. 1 for Buy and 2 for Sell 2. P: price of symbol 3. OT: quantity of symbol 4. SC: it is symbol name
    2. TT: It is time of buy/sell action

Order Management

Get Order Management Details

--ServiceName 'Oms' 
-SOCKET  'wss://oms.dtx.trade?SUBSCRIBER=0&test=0'

REQUEST DATA :

{      
    "AccessType":19,
    "ClientID":"8852",
    "ClientVersion":"1.0.24(25)",
    "ContractList":[  

    ],
    "DeviceType":2,
    "Order":{  
        "OrderType":0,
        "BookType":"1",
        "BuySell":"1",
        "IntOrderNo":"88521551943300274",
        "Price":"0.2274",
        "Qty":"1.00",
        "TokenNo":"1405",
        "TriggerPrice":"0",
        "UserRemarks":"",
        "ValidityType":"1"
    },
    "OrderType":0,
    "RequestedSymbolList":[  

    ],
    "Requesttype":"ORDER",
    "SessionID":"hiMfBqpP64c0pQCNn88iy1K1H3Rx/Z2fSJMxsEHY9KtncEsMVzSJ6+gCxmwvJz24STVJ2UcZcF6GPVcKtNjNHw\u003d\u003d",
    "SubscribedCoins":[  

    ]
}

1. Buy/Sell API (Socket):

For Buy sell any contract user has to connect our socket connection, getting this API link use below key from Master API list.

RESPONSE :

ORDERDATA=>1|88521551943300274|1.00|0.2274|1|0|1551943305865.05| 1.00|0|0|1|1405|2019-03-07T07:21:45.8650000Z

Request payload description:

For processing request for buy/sell user has to specify below values to particular key's.

  1. ClientId: user id of system
  2. Order: this payload have important payload key's.
    1. OrderType: It defines buy/sell or cancel order request type.
    2. BookType: For Buy request 1 and for sell 2
    3. BuySell: For Buy request 1 and for sell 2
    4. IntOrderNo:
    5. Price: this is price of contract.
    6. Qty: this is quantity of contract.
    7. TokenNo: this is contract id.
  3. SessionId : this is session token generated after successful login.

Response payload description:

It is similar response like RATE.

  1. ("=>") this separator first part represent "ORDERDATA" and second part have data.
  2. Order: this payload have important payload key's.
    1. Book Type- This is same value returned which was passed while putting order.
    2. ORder ID = ORder ID identifies the unique order number of trade.
    3. Order quantity
    4. Order Price
    5. Order status, possible values : 1- Confirmed , 3- Partially filled ,7- cancelled, 9- Executed/Fully filled -7- order cancel Failed.
    6. Trade price
    7. Modified Time - (Not used as of now)
    8. Quantity Remaining
    9. Quanity Traded
    10. Quantity Traded Total
    11. BUYSELL - possible values : 1- Buy , 2- Sell
    12. TOKEN NO-- contract no
    13. Trade Time/Modified Time

Response Error payload description:

Response Description when an error occured : 1.It is similar response like ORder Data.

  1. ("=>") this separator first part represent "ORDERERROR" and second part have data.
  2. Order: this payload have important payload key's.
    1. Book Type- This is same value returned which was passed while putting order.
    2. ORder ID = ORder ID identifies the unique order number of trade.
    3. Order quantity
    4. Order Price
    5. Order status, possible values : 1- Confirmed , 3- Partially filled ,7- cancelled, 9- Executed/Fully filled -7- order cancel Failed.
    6. Trade price
    7. Modified Time - (Not used as of now)
    8. Quantity Remaining
    9. Quanity Traded
    10. Quantity Traded Total
    11. BUYSELL - possible values : 1- Buy , 2- Sell
    12. TOKEN NO-- contract no
    13. Trade Time/Modified Time
    14. Error Message

Cancel Order API:

-SOCKET  'wss://oms.dtx.trade?SUBSCRIBER=0&test=0'

REQUEST DATA :

{      

    "ClientID":"8852",
    "CancelRequest":{  
        "OrderId":["88521551943300274"],
        "Contractlist":[],
        "Coinlist":[],
        "BuySell":"1"}
    "Requesttype":"CANCELORDER",
    "SessionID":"hiMfBqpP64c0pQCNn88iy1K1H3Rx/Z2fSJMxsEHY9KtncEsMVzSJ6+gCxmwvJz24STVJ2UcZcF6GPVcKtNjNHw\u003d\u003d",

}

Request payload description:

For processing request for buy/sell user has to specify below values to particular key's.

  1. ClientId: user id of system
  2. CancelRequest: this payload have important payload key's.

    1. OrderID: this accepts as array of orderid , if this key is passed none of the order criterias will be accepted and it will superceed all.
    2. Contractlist: this is an array of contract IDs , for cancelling all the requests belonging to the given contractid- if this array is combined with ORderid it has no significance , but if passed along with buysell then it will cancel all the orders belonging the given contract.
    3. Coinid: Fthis is an array of CoinIDs , for cancelling all the requests belonging to the given Coin ( either Buy side or sell side as per next parameter )-- This is not used as of now.
    4. BuySell: this accepts either of 3 values: 1- for cancelling requests belong to buy, 2, For cancelling requests belongint to sell, 3 - For cancelling reqeust belonging to both buy and sell. if This key is not combined with any of the above key , it will cancel all the orders belonging to client across all the contract and coin
  3. SessionId : this is session token generated after successful login.

RESPONSE :

ORDERDATA=>1|88521551943300274|1.00|0.2274|7|0|1551943305865.05| 1.00|0|0|1|1405|2019-03-07T07:21:45.8650000Z

Response payload description:

It is same response as in order data

  1. ("=>") this separator first part represent "ORDERDATA" and second part have data.
  2. Order: this payload have important payload key's.
    1. Book Type- This is same value returned which was passed while putting order.
    2. ORder ID = ORder ID identifies the unique order number of trade.
    3. Order quantity
    4. Order Price
    5. Order status, possible values : 1- Confirmed , 3- Partially filled ,7- cancelled, 9- Executed/Fully filled -7- order cancel Failed.
    6. Trade price
    7. Modified Time - (Not used as of now)
    8. Quantity Remaining
    9. Quanity Traded
    10. Quantity Traded Total
    11. BUYSELL - possible values : 1- Buy , 2- Sell
    12. TOKEN NO-- contract no
    13. Trade Time/Modified Time

Response Error payload description:

Response Description when an error occured : 1.It is similar response like ORder Data.

  1. ("=>") this separator first part represent "ORDERERROR" and second part have data.
  2. Order: this payload have important payload key's.
    1. Book Type- This is same value returned which was passed while putting order.
    2. ORder ID = ORder ID identifies the unique order number of trade.
    3. Order quantity
    4. Order Price
    5. Order status, possible values : 1- Confirmed , 3- Partially filled ,7- cancelled, 9- Executed/Fully filled -7- order cancel Failed.
    6. Trade price
    7. Modified Time - (Not used as of now)
    8. Quantity Remaining
    9. Quanity Traded
    10. Quantity Traded Total
    11. BUYSELL - possible values : 1- Buy , 2- Sell
    12. TOKEN NO-- contract no
    13. Trade Time/Modified Time
    14. Error Message