CURL *curl;
CURLcode res;
// The URL to which we will send the POST request
const char *url = "https://api.insightease.com/forex/profile";
// Create form data with parameters
const char *postfields = "id=1,2,3&api_key=Your_API_Key";
// Initialize libcurl
curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if(curl){
// Set the URL for the POST request
curl_easy_setopt(curl, CURLOPT_URL, url);
// Specify that this is a POST request
curl_easy_setopt(curl, CURLOPT_POST, 1L);
// Set the POST fields
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postfields);
// Perform the request, res will get the return code
res = curl_easy_perform(curl);
// Check for errors
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
// Always cleanup
curl_easy_cleanup(curl);
}
// Global cleanup
curl_global_cleanup();
return 0;
// Initialize the client with the base URL
var client = new RestClient("https://api.insightease.com/forex/profile");
// Create a POST request
var request = new RestRequest(Method.POST);
// Create form data with parameters
request.AddParameter("id", "1,2,3");
request.AddParameter("api_key", "Your_API_Key");
// Execute the request and get the response
IRestResponse response = client.Execute(request);
// Print the response
Console.WriteLine(response.Content);
# Use curl to make a POST request to the specified URL
curl -X POST https://api.insightease.com/forex/profile \
# Create form data with parameters
-d "id=1,2,3" \
-d "api_key=Your_API_Key"
package main
import (
"bytes"
"fmt"
"net/http"
"net/url"
)
func main() {
apiUrl := "https://api.insightease.com/forex/profile"
// Create form data with parameters
data := url.Values{}
data.Set("id", "1,2,3")
data.Set("api_key", "Your_API_Key")
// Create a new POST request
req, err := http.NewRequest("POST", apiUrl, bytes.NewBufferString(data.Encode()))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
// Set content type header
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
// Perform the request
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
// Print response status
fmt.Println("Response status:", resp.Status)
}
OkHttpClient client = new OkHttpClient();
// Create form data with parameters
RequestBody requestBody = new FormBody.Builder();
.add("id", "1,2,3")
.add("api_key", "Your_API_Key")
.build()
// Create the request
Request request = new Request.Builder();
.url("https://api.insightease.com/forex/profile")
.post(requestBody)
.build()
// Execute the request and get the response
try (Response response = client.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("Unexpected code " + response);
}
// Print the response body
System.out.println(response.body().string());
}
// Make a POST request using Unirest
HttpResponse<String> response = Unirest.post("https://api.insightease.com/forex/profile")
// Set the Content-Type header
.header("Content-Type", "application/x-www-form-urlencoded")
// Create form data with parameters
.field("id", "1,2,3")
.field("api_key", "Your_API_Key")
// Execute the request and get the response
.asString();
// Print the response body
System.out.println(response.getBody());
// Create an instance of AsyncHttpClient
AsyncHttpClient asyncHttpClient = Dsl.asyncHttpClient();
// Build the POST request
Request Request = Dsl.post("https://api.insightease.com/forex/profile");
// Create form data with parameters
.addFormParam("id", "1,2,3")
.addFormParam("api_key", "Your_API_Key")
.build();
// Execute the request asynchronously
asyncHttpClient.executeRequest(request)
.toCompletableFuture();
.thenAccept(response -> {
// Print the response status code
System.out.println("Response status code: " + response.getStatusCode());
// Print the response body
System.out.println("Response body: " + response.getResponseBody());
})
.join();
// Close the AsyncHttpClient instance
asyncHttpClient.close();
// Create form data with parameters
const formData = new FormData();
formData.append("id", "1,2,3");
formData.append("api_key", "Your_API_Key");
// Send a POST request to the API
fetch("https://api.insightease.com/forex/profile", {
method: "POST",
headers: {
// Set content type to form-urlencoded
"Content-Type": "application/x-www-form-urlencoded"
},
body: formData
})
// Parse the JSON response
.then(response => response.json())
// Log the data to the console
.then(data => console.log(data))
// Log any errors to the console
.catch(error => console.error("Error:", error))
// Create form data with parameters
var data = {
id: "1,2,3",
api_key: "Your_API_Key"
};
// Make the POST request
$.ajax({
// URL to send the request to
url: "https://api.insightease.com/forex/profile",
type: "POST",
data: data,
success: function(response) {
// Log the response to the console
console.log(response);
},
error: function(response, status, error) {
// Log the error to the console
console.log(status, error);
}
});
// Create form data with parameters
var formData = new FormData();
formData.append("id", "1,2,3");
formData.append("api_key", "Your_API_Key");
// Create a new XMLHttpRequest object
var xhr = new XMLHttpRequest();
// Configure the request
xhr.open("POST", "https://api.insightease.com/forex/profile", true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// Set up a function to handle the response
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// Request was successful, handle the response here
console.log(xhr.responseText);
}
};
// Send the request with the parameters
xhr.send(formData);
// Require the 'request' library
const request = require('request');
// Define the request options
const options = {
url: "https://api.insightease.com/forex/profile",
method: "POST",
// Create form data with parameters
form: {
id: '1,2,3',
api_key: 'Your_API_Key',
}
};
// Make the HTTP request
request(options, function (error, response, body) {
if (error) {
console.error('Error:', error);
}
else {
console.log('Response:', body);
}
});
// Require the 'unirest' library
const unirest = require('unirest');
// Make a POST request to the specified URL
unirest.post("https://api.insightease.com/forex/profile")
.headers({'Content-Type': 'application/json'})
// Create form data with parameters
.field('id', "1,2,3")
.field('api_key', "Your_API_Key")
.end(function (response) {
console.log(response.body);
});
// Require the 'axios' library
const axios = require('axios');
// Create form data with parameters
const data = {
id: '1,2,3',
api_key: 'Your_API_Key'
};
// Making a POST request using Axios
axios.post("https://api.insightease.com/forex/profile", data)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error("error", error);
});
// Create form data with parameters
$data = array(
'id' => '1,2,3',
'api_key' => 'Your_API_Key',
);
// Initialize CURL:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.insightease.com/forex/profile");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch); // Store the data
curl_close($ch);
if (curl_errno($ch)) {
echo 'Error: ' . ch_error($curl);
}
else {
// Display the response
echo $response;
}
// Create form data with parameters
$data = array(
'id' => '1,2,3',
'api_key' => 'Your_API_Key',
);
// Set POST data
$data_query = http_build_query($data);
// Set URL
$url = "https://api.insightease.com/forex/profile";
// Initialize a new HTTP request
$request = new HttpRequest($url, HttpRequest::METH_POST);
$request->addHeaders(array(
'Content-Type' => 'application/x-www-form-urlencoded',
});
$request->setBody($data_query);
// Send the request and capture the response
try {
$response = $request->send();
// Display the response
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
# Create form data with parameters
params = {
"id": "1,2,3",
"api_key": "Your_API_Key"
}
# Make the POST request
response = requests.post("https://api.insightease.com/forex/profile", data=params)
# Print the response
print(response.text)
require 'uri'
require 'net/http'
url = URI("https://api.insightease.com/forex/profile")
# Create form data with parameters
params = {
"id": "1,2,3",
"api_key": "Your_API_Key"
}
# Create the HTTP object
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
# Create the request
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.set_form_data(params)
# Send the request
response = http.request(request)
# Output the response
puts "Response code: #{response.code}"
puts "Response body: #{response.body}"
http --ignore-stdin --form --follow --timeout 3600 POST 'https://api.insightease.com/forex/profile' \
# Create form data with parameters
"id"="1,2,3" \
"api_key"="Your_API_Key"
wget --quiet \
--method=POST \
--header='Content-Type: application/x-www-form-urlencoded' \
--body-data='id=1,2,3&api_key=Your_API_Key' \
--output-document=- \
https://api.insightease.com/forex/profile
There are multiple errors that help you to understand issue with your API response.
Code | Message |
---|---|
200 | Your API is working. Response successfully |
101 | API Key error : Your access key is wrong, Please login in your dashboard and get your API KEY. |
102 | Your Account is not activated. |
103 | Your Account is blocked. |
104 | API Key error : You have not set your api_key in parameters. |
111 | Full access is not allow with DEMO API key, so please signup and get your api key to unlock full access. |
112 | Data not found, it may be you set wrong values and it may be no data from our side. More error details will be send in API response. |
113 | Required parameters are missing, Please check api documentaion also check message in API response for more error details. |
211 | You have used your all monthly API request limit. |