List entity groups
curl --request POST \
--url https://api.mentionlab.io/api/entity-groups/list \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Competitors",
"parentId": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
'import requests
url = "https://api.mentionlab.io/api/entity-groups/list"
payload = {
"name": "Competitors",
"parentId": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Competitors',
parentId: '018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42',
sort: [{field: 'name', direction: 'ASC'}]
})
};
fetch('https://api.mentionlab.io/api/entity-groups/list', 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.mentionlab.io/api/entity-groups/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Competitors',
'parentId' => '018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42',
'sort' => [
[
'field' => 'name',
'direction' => 'ASC'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/entity-groups/list"
payload := strings.NewReader("{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mentionlab.io/api/entity-groups/list")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entity-groups/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"page": {
"totalRecords": 123,
"limit": 123,
"currentPage": 123,
"totalPages": 123,
"nextPage": 123,
"prevPage": 123
},
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "group",
"name": "<string>",
"slug": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"parent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Entity Groups
List entity groups
Returns a paginated list of entity groups matching the supplied filters.
POST
/
api
/
entity-groups
/
list
List entity groups
curl --request POST \
--url https://api.mentionlab.io/api/entity-groups/list \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "Competitors",
"parentId": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
'import requests
url = "https://api.mentionlab.io/api/entity-groups/list"
payload = {
"name": "Competitors",
"parentId": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Competitors',
parentId: '018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42',
sort: [{field: 'name', direction: 'ASC'}]
})
};
fetch('https://api.mentionlab.io/api/entity-groups/list', 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.mentionlab.io/api/entity-groups/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Competitors',
'parentId' => '018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42',
'sort' => [
[
'field' => 'name',
'direction' => 'ASC'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/entity-groups/list"
payload := strings.NewReader("{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-project-id", "<x-project-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mentionlab.io/api/entity-groups/list")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entity-groups/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Competitors\",\n \"parentId\": \"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42\",\n \"sort\": [\n {\n \"field\": \"name\",\n \"direction\": \"ASC\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"page": {
"totalRecords": 123,
"limit": 123,
"currentPage": 123,
"totalPages": 123,
"nextPage": 123,
"prevPage": 123
},
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "group",
"name": "<string>",
"slug": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"parent": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Headers
Project ID to specify the project context
Query Parameters
Required range:
1 <= x <= 100Required range:
x >= 1Body
application/json
Filter entity groups by name using a case-insensitive partial match.
Example:
"Competitors"
Filter by container kind: "group" for top-level groups, "division" for divisions. Omit to list both.
Available options:
group, division Filter to the divisions of a given group, by group ID.
Example:
"018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42"
Sorting criteria for the returned entity groups. Supports sorting by "name" and "createdAt". Defaults to sorting by name in ascending order.
Show child attributes
Show child attributes
Example:
[{ "field": "name", "direction": "ASC" }]