Browse Departments
curl --request GET \
--url https://api.{tenant}.getomneo.com/api/v3/departmentsimport requests
url = "https://api.{tenant}.getomneo.com/api/v3/departments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.{tenant}.getomneo.com/api/v3/departments', 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/departments",
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/departments"
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/departments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/departments")
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>",
"handle": "<string>",
"external_id": "<string>",
"external_code": "<string>",
"description": "<string>",
"short_description": "<string>",
"url": "<string>",
"image_url": "<string>",
"internal_note": "<string>",
"meta": [
"<unknown>"
],
"brand_id": 123,
"location_id": 123,
"brand": {
"name": "<string>",
"handle": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Department
Browse Departments
A GET to the /departments endpoint allows your application to retrieve departments.
GET
/
v3
/
departments
Browse Departments
curl --request GET \
--url https://api.{tenant}.getomneo.com/api/v3/departmentsimport requests
url = "https://api.{tenant}.getomneo.com/api/v3/departments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.{tenant}.getomneo.com/api/v3/departments', 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/departments",
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/departments"
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/departments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{tenant}.getomneo.com/api/v3/departments")
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>",
"handle": "<string>",
"external_id": "<string>",
"external_code": "<string>",
"description": "<string>",
"short_description": "<string>",
"url": "<string>",
"image_url": "<string>",
"internal_note": "<string>",
"meta": [
"<unknown>"
],
"brand_id": 123,
"location_id": 123,
"brand": {
"name": "<string>",
"handle": "<string>"
},
"created_at": "<string>",
"updated_at": "<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/departments?filter[external_id]={external_id}" \
-H "Authorization: Bearer ${TOKEN}"
curl -X GET "https://api.[tenant].getomneo.com/api/v3/departments?filter[name][nullable]=0" \
-H "Authorization: Bearer ${TOKEN}"
Operators
| Operator | Meaning | Example |
|---|---|---|
eq | Equal to. Applied when you give no operator. | filter[external_id]={external_id} |
ne | Not equal to. | filter[external_id][ne]={external_id} |
gt | Greater than. | filter[external_id][gt]={external_id} |
gte | Greater than or equal to. | filter[external_id][gte]={external_id} |
lt | Less than. | filter[external_id][lt]={other-external_id} |
lte | Less than or equal to. | filter[external_id][lte]={other-external_id} |
in | Matches any value in a comma separated list. | filter[brand_id][in]=123,456 |
not_in | Excludes every value in a comma separated list. | filter[brand_id][not_in]=123,456 |
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 | handle | brand_id |
external_id | external_code | description |
short_description | location_id | url |
image_url | internal_note | meta |
sort key, for example ?sort=-name for descending order.
Search attributes
filter[search] runs one partial match term across name, handle, description, internal_note. A record matches when any one of those attributes contains the term.
curl -X GET "https://api.[tenant].getomneo.com/api/v3/departments?filter[search]={term}" \
-H "Authorization: Bearer ${TOKEN}"
⌘I