TRADE360 - Getting started with API

Modified on Sun, 10 Sep 2023 at 12:08 PM

TABLE OF CONTENTS

General API requests information


Most of the API requests that are available for you are of HTTP POST type. which means that you expected to send a request with URL and body (as explained for each request type). It's recommended to test your request via an external tool (such as POSTMAN) before you're using it inside your code. In order to verify your requests and make sure that you know how to manage the responses. The Request body will have to be in JSON format.

JSON data type syntax

String - Is a sequence of zero or more Unicode characters, enclosed between " and " (double quotes). Strings wrapped in single quotes ' are not valid
For example "string"

Number - Is a regular number with digits between 0 and 9. Can be a positive, negative, fraction or exponent of 10.
For example: 12345, -123, 12.45

Boolean - Can be either true or false. Boolean values are not surrounded within quotes and will be treated as string values.
For example: true, false

Array/List - An ordered collection of values. It begins with [ (left bracket) and ends with ] (right bracket), Its values are separated by ',' (comma).
For example: [1,2,3,4]

Object - A set of name/value pairs inserted between {} (curly brackets). One or more name/value pairs are separated by a , (comma).
For example: {"Name": "John", "Age": 55}


Start/Stop Distribution

Package control

You can control your package's status (enable/disable) by sending a request to the following URL

Method - POST

Urls:
https://stm-api.lsports.eu/Distribution/Start - Enable Distribution
https://stm-api.lsports.eu/Distribution/Stop - Disable Distribution

Body Scheme

{
    "PackageId": YourPackageId,
    "UserName": "YourUserName",
    "Password": "YourPassword"
}

Parameter breakdown

ParameterDescriptionMandatory Field
UsernameUsername as it apparrs in the package
PasswordPassword as it appears in the package
PackageIdID of the package

GetDistributionStatus

Distribution Status

You can request a distribution status from our API service via the following URL:

Method - POST
URL - https://stm-api.lsports.eu/Package/GetDistributionStatus

Body Scheme

{
    "PackageId": YourPackageId,
    "UserName": "YourUserName",
    "Password": "YourPassword"
}

Parameter breakdown

ParameterDescriptionMandatory Field
UsernameUsername as it apparrs in the package
PasswordPassword as it appears the package
PackageIdPackageId as it provide by LSports

Response Scheme

{
    "Header": {
        "HttpStatusCode": 200
    },
    "Body": {
        "IsDistributionOn": true,
        "Consumers": [
            "\"connection_name\": \"172.20.1.58:62902 -> 172.20.2.59:5672\"ConsumerTag : amq.ctag-zPlqoPYV76okJD6PjV-Jrg"
        ],
        "NumberMessagesInQueue": 0,
        "MessagesPerSecond": 0
    }
}

Response Description

ParameterValueDescription
IsDistributionOnbooleanIndicates if your distribution status (online/offline).
ConsumersType : List <string>Consumers of the queue.
NumberMessagesInQueuedoubleIndicates the number of messages in the queue.
MessagesPerSeconddoubleIndicates message per seconds in the queue.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article