This document outlines the procedure for making API calls to retrieve city data from https://easycms.fi/public_api/get_currencies/
. Utilize various parameters to filter and customize your data retrieval.
Fetch city data effectively using the below API call. Apply the IN
or NOT_IN
parameters as an array or a single integer to filter results according to your specific needs.
https://easycms.fi/public_api/get_currencies/
Each parameter can be used individually or in combination to refine your data retrieval:
TOKEN (api_key)
: Your unique API key for authentication. How to Create API Credentials.
username
: Your login username.
password
: Your login password.
account
: Your specific account ID.
Pagination: To manage data effectively, this endpoint supports fetching up to 50 products at a time.
Parameters:
start
- Specify the starting point of the row from which to begin fetching products.limit
- Control the number of products returned in a single request. The maximum limit is 50, but you can opt for a smaller number based on your needs.
Filters: To manage data effectively, this endpoint supports fetching up to 50 products at a time.
IN
- For filtering by city IDs (optional, array or single integer).
NOT_IN
- For excluding specific city IDs (optional, array or single integer).
curl -X POST 'https://easycms.fi/public_api/get_currencies' \
-H 'Authorization1: TOKEN' \
-d 'username=USERNAME&password=PASSWORD&account=ACCOUNT_ID'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://easycms.fi/public_api/get_currencies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query(['username' => 'USERNAME', 'password' => 'PASSWORD', 'account' => 'ACCOUNT_ID']),
CURLOPT_HTTPHEADER => array("Authorization1: TOKEN"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://easycms.fi/public_api/get_currencies"
headers = {"Authorization1": "TOKEN"}
payload = {'username': 'USERNAME', 'password': 'PASSWORD', 'account': 'ACCOUNT_ID'}
response = requests.post(url, headers=headers, data=payload)
print(response.text)
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://easycms.fi/public_api/get_currencies"))
.headers("Authorization1", "TOKEN")
.POST(HttpRequest.BodyPublishers.ofString("username=USERNAME&password=PASSWORD&account=ACCOUNT_ID"))
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
const https = require('https');
const data = new URLSearchParams({
username: 'USERNAME',
password: 'PASSWORD',
account: 'ACCOUNT_ID'
}).toString();
const options = {
hostname: 'prolasku.fi',
path: '/public_api/get_currencies',
method: 'POST',
headers: {
'Authorization1': 'TOKEN',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => { data += chunk; });
res.on('end', () => { console.log(data); });
});
req.on('error', (e) => { console.error(e); });
req.write(data);
req.end();
import React, { useEffect, useState } from 'react';
function App() {
const [categoryData, setCategoryData] = useState('');
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch('https://easycms.fi/public_api/get_currencies', {
method: 'POST',
headers: {'Authorization1': 'TOKEN', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({username: 'USERNAME', password: 'PASSWORD', account: 'ACCOUNT_ID'}).toString()
});
const data = await response.text();
setCategoryData(data);
} catch (error) {
console.error(error);
}
};
fetchData();
}, []);
return ({categoryData});
}
export default App;
// Kotlin example requires using a third-party library like OkHttp for POST requests with a body
// Kotlin Example using OkHttp for POST request
import okhttp3.OkHttpClient
import okhttp3.FormBody
import okhttp3.Request
fun main() {
val client = OkHttpClient()
val formBody = FormBody.Builder()
.add("username", "USERNAME")
.add("password", "PASSWORD")
.add("account", "ACCOUNT_ID")
.build()
val request = Request.Builder()
.url("https://easycms.fi/public_api/get_currencies")
.post(formBody)
.addHeader("Authorization1", "TOKEN")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException("Unexpected code $response")
println(response.body?.string())
}
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var token = "TOKEN";
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair("username", "USERNAME"),
new KeyValuePair("password", "PASSWORD"),
new KeyValuePair("account", "ACCOUNT_ID")
});
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("Authorization1", token);
var response = await httpClient.PostAsync("https://easycms.fi/public_api/get_currencies", content);
if (response.IsSuccessStatusCode)
{
var responseData = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseData);
}
else
{
Console.WriteLine($"Error: {response.StatusCode}");
}
}
}
}
When you make a request to the endpoint, you receive a JSON response containing various keys and values. Here's an explanation of the response keys and their meanings:
# API Response Output Object Breakdown
This document outlines a detailed breakdown of the response output object received from the API server. Each field in the JSON response is described to aid in understanding and integration.
## Fields Overview
The response object includes various fields that detail information about a country, its currency, and localization details. Below are the individual field descriptions:
### `main`
- **Type:** Integer
- **Description:** Indicates if this is the main record (primary data point). Usually "0" or "1".
- **Example:** `0`
### `curNumber`
- **Type:** Integer
- **Description:** A numerical identifier or code, potentially representing a currency or other numeric value.
- **Example:** `"2"`
### `country_id`
- **Type:** Integer
- **Description:** Unique identifier for the country.
- **Example:** `"142"`
### `rate`
- **Type:** Double
- **Description:** A rate value, possibly for currency or another metric. Typically, "1" might represent a base or default rate.
- **Example:** `1`
### `geoname_id`
- **Type:** String
- **Description:** Geographical database identifier for the country.
- **Example:** `"2562770"`
### `locale_code`
- **Type:** String
- **Description:** Locale code representing the preferred language or regional settings.
- **Example:** `"en"`
### `continent_code`
- **Type:** String
- **Description:** Code representing the continent where the country is located.
- **Example:** `"EU"`
### `continent_name`
- **Type:** String
- **Description:** Name of the continent where the country is located.
- **Example:** `"Europe"`
### `country_iso_code`
- **Type:** String
- **Description:** ISO code of the country.
- **Example:** `"MT"`
### `currency_alphabetic_code`
- **Type:** String
- **Description:** Alphabetic code for the country's currency.
- **Example:** `"EUR"`
### `country_name`
- **Type:** Object
- **Description:** Contains the name of the country in various languages.
- **Sub-fields:**
- `fi`, `en`, `fa_ir`, `sv`, `ru`, `no`, `th`, `en_gb`, `zh`
- Each sub-field is a language code representing the country name in that language.
- **Example:** `{"fi": "Malta", "en": "Malta", ...}`
### `ML_country_name`
- **Type:** String
- **Description:** A machine learning generated or confirmed country name.
- **Example:** `"Malta"`
### `languages`
- **Type:** String
- **Description:** List of languages spoken in the country, represented by language codes.
- **Example:** `"mt,en-MT"`
### `TLD`
- **Type:** String
- **Description:** Top Level Domain (TLD) for the country.
- **Example:** `".mt"`
### `country_number`
- **Type:** Integer
- **Description:** A numerical code or representation for the country.
- **Example:** `"150"`
### `parent_id`
- **Type:** Integer
- **Description:** Identifier for the parent entity of the country, if applicable. Zero often indicates no parent entity.
- **Example:** `0`
### `visible`
- **Type:** Integer
- **Description:** Indicates if the country is visible in the system. "1" for visible, "0" for not visible.
- **Example:** `"1"`
### `currency_symbol`
- **Type:** String
- **Description:** Symbol used for the country's currency.
- **Example:** `"€"`
{
"INFO": {
"start": 0,
"limit": 2,
"count": 2,
"total_count": 15
},
"OUTPUT": {
"0": {
"main": 0,
"curNumber": "1",
"country_id": "194",
"rate": 3.296975,
"geoname_id": "3573511",
"locale_code": "en",
"continent_code": "NA",
"continent_name": "North America",
"country_iso_code": "AI",
"currency_alphabetic_code": "XCD",
"country_name": {
"fi": "Anguilla",
"en": "Anguilla",
"fa_ir": "Anguilla",
"sv": "Anguilla",
"ru": "Anguilla",
"no": "Anguilla",
"th": "Anguilla",
"en_gb": "anguilla",
"zh": "anguilla"
},
"ML_country_name": "Anguilla",
"languages": "en-AI",
"TLD": ".ai",
"country_number": "5",
"parent_id": 0,
"visible": "1",
"currency_symbol": "$"
},
"1": {
"main": 0,
"curNumber": "2",
"country_id": "142",
"rate": 1,
"geoname_id": "2562770",
"locale_code": "en",
"continent_code": "EU",
"continent_name": "Europe",
"country_iso_code": "MT",
"currency_alphabetic_code": "EUR",
"country_name": {
"fi": "Malta",
"en": "Malta",
"fa_ir": "Malta",
"sv": "Malta",
"ru": "Malta",
"no": "Malta",
"th": "Malta",
"en_gb": "malta",
"zh": "malta"
},
"ML_country_name": "Malta",
"languages": "mt,en-MT",
"TLD": ".mt",
"country_number": "150",
"parent_id": 0,
"visible": "1",
"currency_symbol": "€"
},
"response_type": "success",
"message": "Data returned successfully"
}
}
Here are the possible error messages and their meanings:
UN-AUTHORIZED - _user_name_password_is_set_but_wrong_value!
: Incorrect username or password.this_account_does_not_exist_or_your_credentials_do_not_match_this_account
: The account doesn't exist or mismatched credentials.UN-AUTHORIZED - header is set but the header value is not correct!
: Incorrect authorization header value.Maximum query size is 50 rows per query
: Exceeded maximum limit of 50 rows per query.