Getting Started

Important! Please note, that downloading and installing any of the DarkMindFx indicator packages and/or libraries you are accepting the terms of use described on this page - Terms Of Use. Please read them carefully before downloading.
All information and data provided as well as trademarks, service marks, trade names or any other marks are the property of the corresponding agencies. We don't own them and provide it for informational purposes only.

Common API Parts


Getting Started


Before using the API first you need to obtain the API Key. You can find it in your account details either by logging in or (if you don't have an account yet) by Registering

Once you've got the API Key the first call you should perform is InitSession and speciffy the key as a parameter of the command. In response in case if the key is valid the Session Token will be returned. This Session Token then should be provided to all the other commands.

Use the menu of the left to get the detailed specification on each API command

When you're done with you work - close the session with CloseSession call.

Request Structure


Typically request is represened as JSON and has following structure
                    {
                        "SessionToken": "Your-Session-Token",
                        "RequestID" : "Unique-Identifier",                        
                        ....
                        [List-of-Request-Specific-Fields]
                        ....
                    }

Parameters:

SessionToken - string value obtained using InitSession command. In general almost all commands require the session to be initialized first.

RequestID - this field holds the unique string identifier which can be used by client to check which responses correspond to which request. We recommend to assing a newly generated GUID value to this field for each request. When responding server will be copying the values passed to the proper response object.

Response Structure


The response is always having the following format
                    {
                        "SessionToken": "{Your-Session-Token}",
                        "RequestID" : "{Unique-Identifier}",
                        "Success": "{True/Falce}",
                        "Errors": [{List-of-Errors-If-Any}],
                        "Payload": 
                        {   
                            ....
                            [Payload-Content]
                            ....
                        }                   
                       
                    }

Parameters:

SessionToken - session token used in the request.

RequestID - value obtained from the request.

Success - Boolean field which flags whether the request was processed successfully. The values can be either TRUE or FALSE

Errors - this array can contain any additional information related to errors, warnings or information messages generated during request processing. Check the Error Handling section to familiarize yourself with the format of the objects in this array.

Payload -in case if response contains the data, it will be placed here in form of the JSON object. The format of the payload depends on the type of the command

Session Initialization


Command:

InitSession


This is the first command to call in order to beging working with the API. It initializes the session and returns the token which will be used in all the subsequent calls. In order to initialize the session you need to provide your Account Key. You can easily obtain one by just registering here.

URI
                    /api/accounts/InitSession
POST Request:
                    {
                        "RequestID" : "Unique-Identifier"
                        "AccountKey": "Your-Account-Key"
                    }
Response:
                    {
                        "RequestID"   : "Unique-Identifier",
                        "Success"     : true,
                        "Errors"      : [],
                        "SessionToken": "New-Session-Token"
                    }

GET request:
                    /api/accounts/InitSession/{You-Account-Key}

Closing Session


Command:

CloseSession


When you're done please use this command to finalize the session.

URI
                    /api/accounts/CloseSession
POST Request:
                    {
                        "RequestID"    : "Unique-Identifier",
                        "SessionToken" : "Session-Token"
                    }
Response:
                    {
                        "RequestID"    : "Unique-Identifier",
                        "Success"      : true,
                        "Errors"       : [],
                        "SessionToken" : "Session-Token"
                    }

GET request:
                    /api/accounts/CloseSession/{Session-Token}

Error Handling


Each response contains two mandatory fields - Success and Errors. Success is the Boolean flag which can be used to quickly identify whether the request was successfully processed or not. Under normal circumstances this flag should always be "true".
Optionally there can be the case when command was executed successfully but Errors array contains some information messages or warnings. In case if any error has occured this flag will be set to "false" and Errors array will be populated with list of errors occured. Please note, that's its possible to have more than one error in the list.
Each error has the following format:
                    {
                        "Code"      : "Error-Code",
                        "Type"      : "Info/Warning/Error",
                        "Message"   : "Error-Message-Text",
                        "Timestamp" : "Date-Time-Error-Occured"
                    }