Bulk update classification flags on multiple entities
curl --request PATCH \
--url https://api.mentionlab.io/api/entities/many \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"ids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"550e8400-e29b-41d4-a716-446655440000"
],
"isOwned": true,
"isCompetitor": false,
"isBlacklisted": false
}
'import requests
url = "https://api.mentionlab.io/api/entities/many"
payload = {
"ids": ["f47ac10b-58cc-4372-a567-0e02b2c3d479", "550e8400-e29b-41d4-a716-446655440000"],
"isOwned": True,
"isCompetitor": False,
"isBlacklisted": False
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['f47ac10b-58cc-4372-a567-0e02b2c3d479', '550e8400-e29b-41d4-a716-446655440000'],
isOwned: true,
isCompetitor: false,
isBlacklisted: false
})
};
fetch('https://api.mentionlab.io/api/entities/many', 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/entities/many",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'550e8400-e29b-41d4-a716-446655440000'
],
'isOwned' => true,
'isCompetitor' => false,
'isBlacklisted' => false
]),
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/entities/many"
payload := strings.NewReader("{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.mentionlab.io/api/entities/many")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities/many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Entities
Bulk update classification flags on multiple entities
Updates classification flags on several entities at once; only the flags provided are changed, and the call is rejected when none are supplied.
PATCH
/
api
/
entities
/
many
Bulk update classification flags on multiple entities
curl --request PATCH \
--url https://api.mentionlab.io/api/entities/many \
--header 'Content-Type: application/json' \
--header 'x-project-id: <x-project-id>' \
--data '
{
"ids": [
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"550e8400-e29b-41d4-a716-446655440000"
],
"isOwned": true,
"isCompetitor": false,
"isBlacklisted": false
}
'import requests
url = "https://api.mentionlab.io/api/entities/many"
payload = {
"ids": ["f47ac10b-58cc-4372-a567-0e02b2c3d479", "550e8400-e29b-41d4-a716-446655440000"],
"isOwned": True,
"isCompetitor": False,
"isBlacklisted": False
}
headers = {
"x-project-id": "<x-project-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-project-id': '<x-project-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ids: ['f47ac10b-58cc-4372-a567-0e02b2c3d479', '550e8400-e29b-41d4-a716-446655440000'],
isOwned: true,
isCompetitor: false,
isBlacklisted: false
})
};
fetch('https://api.mentionlab.io/api/entities/many', 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/entities/many",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'550e8400-e29b-41d4-a716-446655440000'
],
'isOwned' => true,
'isCompetitor' => false,
'isBlacklisted' => false
]),
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/entities/many"
payload := strings.NewReader("{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.mentionlab.io/api/entities/many")
.header("x-project-id", "<x-project-id>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/entities/many")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-project-id"] = '<x-project-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"550e8400-e29b-41d4-a716-446655440000\"\n ],\n \"isOwned\": true,\n \"isCompetitor\": false,\n \"isBlacklisted\": false\n}"
response = http.request(request)
puts response.read_body{
"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
Body
application/json
Entity IDs to update (must belong to the current project)
Example:
[
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"550e8400-e29b-41d4-a716-446655440000"
]
Mark entities as owned by the project
Example:
true
Mark entities as competitors
Example:
false
Mark entities as blacklisted (excludes from analysis but preserves history)
Example:
false