List tags
curl --request POST \
--url https://api.mentionlab.io/api/tags/list \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "branding",
"with_queries_count": true,
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
'import requests
url = "https://api.mentionlab.io/api/tags/list"
payload = {
"name": "branding",
"with_queries_count": True,
"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: 'branding',
with_queries_count: true,
sort: [{field: 'name', direction: 'ASC'}]
})
};
fetch('https://api.mentionlab.io/api/tags/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/tags/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' => 'branding',
'with_queries_count' => true,
'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/tags/list"
payload := strings.NewReader("{\n \"name\": \"branding\",\n \"with_queries_count\": true,\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/tags/list")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"branding\",\n \"with_queries_count\": true,\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/tags/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\": \"branding\",\n \"with_queries_count\": true,\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": 1,
"project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"name": "feature",
"color": "#3B82F6",
"queryCount": 5,
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupName": "<string>"
}
]
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Tags
List tags
Returns a paginated list of tags matching the supplied filters, optionally with the linked-query count per tag.
POST
/
api
/
tags
/
list
List tags
curl --request POST \
--url https://api.mentionlab.io/api/tags/list \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"name": "branding",
"with_queries_count": true,
"sort": [
{
"field": "name",
"direction": "ASC"
}
]
}
'import requests
url = "https://api.mentionlab.io/api/tags/list"
payload = {
"name": "branding",
"with_queries_count": True,
"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: 'branding',
with_queries_count: true,
sort: [{field: 'name', direction: 'ASC'}]
})
};
fetch('https://api.mentionlab.io/api/tags/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/tags/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' => 'branding',
'with_queries_count' => true,
'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/tags/list"
payload := strings.NewReader("{\n \"name\": \"branding\",\n \"with_queries_count\": true,\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/tags/list")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"branding\",\n \"with_queries_count\": true,\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/tags/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\": \"branding\",\n \"with_queries_count\": true,\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": 1,
"project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"name": "feature",
"color": "#3B82F6",
"queryCount": 5,
"groupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"groupName": "<string>"
}
]
}{
"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 <= 1000Required range:
x >= 1Body
application/json
Filter tags by name using a case-insensitive partial match.
Example:
"branding"
Include the count of queries associated with each tag
Example:
true
Sorting options for the tag list. Currently only the "name" field is sortable. Defaults to ascending order by name.
Show child attributes
Show child attributes
Example:
[{ "field": "name", "direction": "ASC" }]