Link Security
curl --request POST \
--url https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity \
--header 'Content-Type: application/json' \
--data '
{
"security_guid": "6ef11658-5a1c-4baf-9387-d977dcca6129",
"partner_security_id": "124"
}
'import requests
url = "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity"
payload = {
"security_guid": "6ef11658-5a1c-4baf-9387-d977dcca6129",
"partner_security_id": "124"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
security_guid: '6ef11658-5a1c-4baf-9387-d977dcca6129',
partner_security_id: '124'
})
};
fetch('https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'security_guid' => '6ef11658-5a1c-4baf-9387-d977dcca6129',
'partner_security_id' => '124'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity"
payload := strings.NewReader("{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity")
.header("Content-Type", "application/json")
.body("{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 0,
"message": "Security linked successfully.",
"details": []
}
}Link
Link Security
Link a security to the partner’s own security identifier. This will overwrite any existing link.
Request Body
-
security_guid(string, required): GUID of the security in TakeProfit system. -
partner_security_id(string, required): Partner’s own identifier for the security.
Response
status: Operation status.
Linked Security JSON Schema
{
"type": "object",
"properties": {
"security_guid": { "type": "string" },
"partner_security_id": { "type": "string" }
},
"required": ["security_guid", "partner_security_id"]
}
Frequently Asked Questions
Can I overwrite an existing link?
Yes, calling `LinkSecurity` with the same `security_guid` will overwrite the existing `partner_security_id`.
POST
/
takeprofit.partner.external.security.v1.LinkApi.LinkSecurity
Link Security
curl --request POST \
--url https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity \
--header 'Content-Type: application/json' \
--data '
{
"security_guid": "6ef11658-5a1c-4baf-9387-d977dcca6129",
"partner_security_id": "124"
}
'import requests
url = "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity"
payload = {
"security_guid": "6ef11658-5a1c-4baf-9387-d977dcca6129",
"partner_security_id": "124"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
security_guid: '6ef11658-5a1c-4baf-9387-d977dcca6129',
partner_security_id: '124'
})
};
fetch('https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'security_guid' => '6ef11658-5a1c-4baf-9387-d977dcca6129',
'partner_security_id' => '124'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity"
payload := strings.NewReader("{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity")
.header("Content-Type", "application/json")
.body("{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.tpinf.in/takeprofit.partner.external.security.v1.LinkApi.LinkSecurity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"security_guid\": \"6ef11658-5a1c-4baf-9387-d977dcca6129\",\n \"partner_security_id\": \"124\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"code": 0,
"message": "Security linked successfully.",
"details": []
}
}Headers
JWT access token
Body
application/json
The body is of type object.
Response
200 - application/json
OK
The response is of type object.
⌘I