Samco Publisher
Easily copy and paste trade buttons to embed them on your website.
What is its purpose?
Integrating buttons into websites and apps to enable users to execute trades. The Samco Publisher buttons can seamlessly become part of your website by copying and pasting a few lines of HTML and JavaScript code.
Why?
Enhance the user experience for your audience, whether they're readers of your financial blog or consumers of your market analysis. Offer them a unique trading experience while also presenting the opportunity for additional revenue for you.
Is there any fees?
No, Samco Publisher is available free of charge.
How do I get my trade buttons?
First create a Publisher app and obtain API keys via /publihser/createApp API. Use these keys along with the necessary HTML/Javascript lines to embed buttons on your website as documented here.
Create App
This Publisher create API is to create a Publisher app and obtain API keys. POST /publisher/createApp
Code Sample
curl -X POST 'https://tradeapi.samco.in/publisher/createApp' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"appName":"My App","redirectURL":"https://www.example.com/","description":"Description about the App"}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Sample {
public static void main(String[] args) throws Exception {
String requestBody = """
{
"appName": "My App",
"redirectURL": "https://www.example.com/",
"description": "Description about the App"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://tradeapi.samco.in/publisher/createApp"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}(async () => {
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
};
const requestBody = {
appName: "My App",
redirectURL: "https://www.example.com/",
description: "Description about the App"
};
const response = await fetch('https://tradeapi.samco.in/publisher/createApp', {
method: 'POST',
headers,
body: JSON.stringify(requestBody),
});
const data = await response.json();
console.log(data);
})();import requests
import json
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
}
requestBody = {
"appName": "My App",
"redirectURL": "https://www.example.com/",
"description": "Description about the App"
}
r = requests.post('https://tradeapi.samco.in/publisher/createApp',
data=json.dumps(requestBody),
headers=headers)
print(r.json())Sample Request Body
requestBody={
"appName": "My App",
"redirectURL": "https://www.example.com/",
"description": "Description about the App"
}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
body | object | false | Contains the details for creating the app. |
appName | string | true | The name of the app you want to create. |
redirectURL | string | true | URL to which the user will be redirected after the order execution. |
description | string | true | A description of the app, providing details or information about its purpose or functionality. |
Sample Response
{
"serverTime": "06/02/24 14:02:03",
"msgId": "d3001338-4312-45ca-8195-9edc6873577a",
"status": "Success",
"apiKey": "5TmpmCtzBnxq2MbDb",
"statusMessage": "Publisher App created & api key generated"
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | The current time at the server when the response was generated. |
msgId | string | A unique identifier for the request. Use this ID when contacting support about any issues. |
status | string | Indicates whether the login attempt was successful or failed. |
statusMessage | string | Provides additional information about the status of the login attempt. |
apiKey | string | The API key required for creating HTML/JSON trade buttons. |