Browse Countries
curl --request GET \
--url https://api.{tenant}.getomneo.com/api/v3/countriesimport requests
url = "https://api.{tenant}.getomneo.com/api/v3/countries"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.{tenant}.getomneo.com/api/v3/countries', 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.{tenant}.getomneo.com/api/v3/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/countries"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{tenant}.getomneo.com/api/v3/countries")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/countries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"name": "<string>",
"iso_2": "<string>",
"iso_3": "<string>",
"iso_numeric": "<string>",
"sort_order": 123,
"states": [
{
"id": 123,
"name": "<string>",
"type": "<string>",
"iso": "<string>",
"iso_2_country": "<string>",
"iso_2_country_state_code": "<string>",
"sort_order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
],
"currency": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"region": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"is_default": "<string>"
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Country
Browse Countries
A GET to the /countries endpoint allows your application to retrieve countries.
GET
/
v3
/
countries
Browse Countries
curl --request GET \
--url https://api.{tenant}.getomneo.com/api/v3/countriesimport requests
url = "https://api.{tenant}.getomneo.com/api/v3/countries"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.{tenant}.getomneo.com/api/v3/countries', 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.{tenant}.getomneo.com/api/v3/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.{tenant}.getomneo.com/api/v3/countries"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.{tenant}.getomneo.com/api/v3/countries")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/countries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"name": "<string>",
"iso_2": "<string>",
"iso_3": "<string>",
"iso_numeric": "<string>",
"sort_order": 123,
"states": [
{
"id": 123,
"name": "<string>",
"type": "<string>",
"iso": "<string>",
"iso_2_country": "<string>",
"iso_2_country_state_code": "<string>",
"sort_order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
],
"currency": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"region": {
"id": "<string>",
"name": "<string>",
"handle": "<string>",
"is_default": "<string>"
}
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Filtering
This endpoint accepts
filter and sort query parameters. See Filtering, sorting, and search for paging and for the shared search_with, custom_field, and json_contains filters.Examples
curl -X GET "https://api.[tenant].getomneo.com/api/v3/countries?filter[name]={name}" \
-H "Authorization: Bearer ${TOKEN}"
curl -X GET "https://api.[tenant].getomneo.com/api/v3/countries?filter[name][nullable]=0" \
-H "Authorization: Bearer ${TOKEN}"
Operators
| Operator | Meaning | Example |
|---|---|---|
eq | Equal to. Applied when you give no operator. | filter[name]={name} |
ne | Not equal to. | filter[name][ne]={name} |
gt | Greater than. | filter[sort_order][gt]=100 |
gte | Greater than or equal to. | filter[sort_order][gte]=100 |
lt | Less than. | filter[sort_order][lt]=250 |
lte | Less than or equal to. | filter[sort_order][lte]=250 |
in | Matches any value in a comma separated list. | filter[name][in]={name},{other-name} |
not_in | Excludes every value in a comma separated list. | filter[name][not_in]={name},{other-name} |
nullable | 1 returns records where the attribute is empty. Any other value returns records where it is set. | filter[name][nullable]=1 |
not_has operator applies to related attributes, which this endpoint does not have.
Filter attributes
| Attribute | Attribute | Attribute |
|---|---|---|
name | iso_2 | iso_3 |
iso_numeric | sort_order | currency |
sort key, for example ?sort=-name for descending order.
Search attributes
filter[search] runs one partial match term across name, iso_2, iso_3, iso_numeric, states.iso, states.name. A record matches when any one of those attributes contains the term.
curl -X GET "https://api.[tenant].getomneo.com/api/v3/countries?filter[search]={term}" \
-H "Authorization: Bearer ${TOKEN}"
⌘I