Data Services – Forex Domestic

This path is about the data services of Forex Domestic: /Api/V1/Data/DomForex

URL

Example POST API Request

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

Key Required Value Discription
Segments TPIL_TPCONTRIBUTORS_SEGMENT_ID 17 Domestic Forex Segment
Instrument TPIL_TPCONTRIBUTORS_SPOT_INSTRUMENT_TYPE TPIL_TPCONTRIBUTORS_FWD_INSTRUMENT_TYPE TPIL_TPCONTRIBUTORS_CROSS_CURRENCIES_INSTRUMENT_TYPE TPIL_TPCONTRIBUTORS_MIFOR_INSTRUMENT_TYPE 1,2,3,4 Spot, Forward
Request Type Domestic Forex 1 - 5 Spot and Forward Data Services
Otherinfo Optional 0 Timestamp-Seconds
                            
                              {
                                "sid":"17",
                                "instId":"2",
                                "rType":"2"
                            }
                          
                        
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/json
                          
                        
                          [
    {
                            "SwapPointBid": "5.277466",
                            "Date": "15-Dec-2022",
                            "FwdOutrightAsk": "92.78818",
                            "SpotRateAsk": "87.4475",
                            "FwdOutrightBid": "92.709966",
                            "SwapPointAsk": "5.34068",
                            "SpotRateBid": "87.4325",
                            "Days": "420"
                         }
    ]
                        
                      
                            
                            {
                              "sid":"17",
                              "instId":"2",
                              "rType":"2"
                            }
                          
                        
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/xml
                          
                        
                          <domesticcalc>
                          <item>
                          <SwapPointBid>5.277466</SwapPointBid>
                          <Date>15-Dec-2022</Date>
                          <FwdOutrightAsk>92.78818</FwdOutrightAsk>
                          <SpotRateAsk>87.4475</SpotRateAsk>
                          <FwdOutrightBid>92.709966</FwdOutrightBid>
                          <SwapPointAsk>5.34068</SwapPointAsk>
                          <SpotRateBid>87.4325</SpotRateBid>
                          <Days>420</Days>
                          </item>
                          </domesticcalc>
                        
                      
                        
                        // Java Data Services -FOREX DOMESTIC
                      URL url = new
                      URL("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/DomForex");

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

//POST Requesr
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\": 2,\n  \"instId\": 1,\n  \"rType\": 1,\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 - FOREX DOMESTIC
                                var  url = "https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/DomForex");
                                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\": 2,\n  \"instId\": 1,\n  \"rType\": 1,\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 - FOREX DOMESTIC

                                ?php

                                $url = ("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/DomForex");
                                $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" : 2,
                                "instId" : 1,
                                "rType": 1
                                };




                                // Response Data

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

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

                                url = ("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/DomForex");
                                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" : "2",
                                "instId": "1",
                                "rType": "1"
                                }
                                """




                        // Response Data

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


                            
                        
                            //Javascript Data Services - FOREX DOMESTIC


                                Var url=("https://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/DomForex" )
                                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" : 3,
                                "instId" : 1,
                                "rType": 1
                                }';





                        // Response Data

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



                            
                            
                                //CURL Data Services - FOREX DOMESTIC


                                #! /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/DomForex   -H "Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-"  -H
                                "Content-Type: application/json"


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