Data Services - General Feed

This path is about the data services of General Feed : TPILWebAPI/Api/V1/Data/GeneralFeed

URL

Example POST API Request

https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed

Request Data Information

The data based on Segment ID( sid ), Instrument Type(instId), Request Type(rType)

  • Http Method: must be a POST Request
  • Http Scheme: http
  • Hostname: https://uat.tickermarket.com
  • Path: TPILWebAPI/API/V1/Data/GeneralFeed (Data Services Endpoint path)
  • POST parameters:

Request

Key Required Value Discription
Segments TPIL_General_Feed 47 General Feed
Instrument TTPIL_General_Instrument 4,5,8 Instrument
Request Type TPIL_GENERAL_R 1-3 General Market
Otherinfo Optional 0 Timestamp-Seconds
                                                      
                            {
                              "sid":"47",
                              "instId":"5",
                              "rType":"3"
                                                                               }
                                                                              
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/json
                          
                                                      
    [
    {

    "Segment":"GENERALFEED",
    "Instrument":"LIBOR",
    "TPILCode":5629,
    "Description":"LIBOR AUD 10-MONTH",
    "Symbol":"AUD10M.LIBOR",
    "DateTime":"31-May-2013 21:30:42",
    "Underlying":"AUD",
    "LastTradedPrice":3.2280,
    "NetChange":-0.0100,
    "PercentChange":-0.31,
    "OpenPrice":3.2280,
    "HighPrice":3.2280,
    "LowPrice":3.2280,
    "ClosePrice":3.2380


   }
    ]

                                                      
                            {
                              "sid":"47",
                              "instId":"5",
                              "rType":"3"
                                                                               }
                                                                              
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/xml
                          
                                                      
    <GENERALFEED>
    <item>
    <Segment>GENERALFEED</Segment>
    <Instrument>LIBOR</Instrument>
    <TPILCode>5629</TPILCode>
    </item>
    </GENERALFEED>
                        
                        // Java Data Services - GeneralFeed
URL url = new
URL("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed");

//Open URL connection
HttpURLConnection http = (HttpURLConnection)url.openConnection();

//POST Request
http.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Accept", "application/json");
http.setRequestProperty("Content-Type", "application/json");
http.setRequestProperty("Authorization", "Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-");

//Create the Request Body
String data = "{\n  \"sid\": 47,\n  \"instId\": 5,\n  \"rType\": 3,\n  }";
byte[] out = data.getBytes(StandardCharsets.UTF_8);

// Response Data
OutputStream stream = http.getOutputStream();
stream.write(out);
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http.disconnect();
                        
                        // C# Data Services - GeneralFeed
                                var  url = "https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed");
                                var httpRequest= (HttpWebRequest) WebRequest.Create(url);



                        //POST Request
                                http.setRequestMethod("POST");

                                httpRequest.Accept("application/json");

                                http.Headers("Authorization", "Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-");
                                httpRequest.ContentType("application/json");

                        //Create the Request Body
                                var data = "{\n  \"sid\": 47,\n  \"instId\": 5,\n  \"rType\": 3,\n  }";
                                Using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
                                {
                                streamWriter.Write(data);
                                }


                        // Response Data

                                var httpResponse = (HttpWebResponse) httpRequest.GetResponse();
                                using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
                                {
                                Var result= streamReader.ReadToEnd();
                                }
                                Console.WriteLine(httpResponse.StatusCode);

                            
                        
                        //PHP Data Services - GeneralFeed

                              ?php

                                $url = ("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed");
                                $curl = (curl_init($url));
                                curl_seropt($curl, CURLOPT_URL, $url);
                                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);





                        //POST Request



                                $headers = array("Authorization":"Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-" , Content-Type : application/json);
                                Curl_setopt($curl ,, CURLOPT_HTTPHEADER, , $headers);


                        //Create the Request Body
                                $data= DATA{ {
                                "sid" : 47,
                                "instId" : 5,
                                "rType": 3
                                };




                        // Response Data

                                Curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
                                $resp=curl_exec($curl);
                                curl_close($curl);
                                var_dump($resp);
                                ?>

                            
                        
                        //Python Data Services - GeneralFeed
                                Import requests
                                From requests.structure import CaseInsensitiveDict

                                url = ("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed");
                                headers = CaseInsensitiveDict()





                        //POST Request


                                headers [ "Accept"] = "application/json"
                                headers["Authorization"] = " Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe- "
                                headers["Content-Type"] = "application/json"


                        //Create the Request Body
                                data= """
                                {
                                "sid" : "47",
                                "instId": "5",
                                "rType": "3"
                                }
                                """




                        // Response Data

                                resp = request.post(url, headers=headers, data=data)
                                print(resp.status_code)


                            
                        
                        //Javascript Data Services - GeneralFeed


                                Var url=("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed" )
                                Var xhr = new XMLHttpRequest();






                        //POST Request


                                xhr.open("POST", url);
                                xhr.setRequestHeader("Accept","application/json" );
                                xhr.setRequestHeader("Authorization","Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe- " );
                                xhr.setRequestHeader(Content-Type, "application/json" );

                                xhr.onreadystatechange= function() {
                                if(xhr.readyState = = = 4)
                                {
                                Console.log(xhr.status);
                                Console.log(xhr.responseText);
                                }};



                        //Create the Request Body
                                Var data = '{
                                "sid" : 47,
                                "instId" : 5,
                                "rType": 3
                                }';





                        // Response Data

                                Xhr.send(data);
                                Console.log(xhr.status);



                            
                            
                                //CURL Data Services - GeneralFeed


                                #! /bin/bash
                                #Login:


                                //POST Request


                                curl -d  "{ \ username\" :  \ "ABB \" , \"password\" : \"password\"}" "-H content-type: application/json" " https://uat.tickermarket.com TPILWebAPI/Api/V1/Users/Login"

                                Curl -X POST https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/GeneralFeed   -H "Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-"  -H
                                "Content-Type: application/json"


                                //Create the Request Body
                                - - data-binary @- << DATA
                                {
                                "sid" : "47",
                                "instId": "5",
                                " rType": "3"
                                }
                                DATA