Resolve labels for document mentions
Requires the configured page-editor feature (spaces by default) and current subject/page access. Workspace pages use a null subject; subject pages inherit their space access. The document must occur in an accessible page. Search and recent additionally require edit access to an active page. Read resolution never grants access to the mentioned record. Only references actually present in this document/version are disclosed; foreign, missing and unbound refs get unavailable disclosures. Input allows 400 entries before deduplication; at most 200 distinct valid refs are allowed.
curl --request POST \
--url https://api.gratona.com/v1/admin/mentions/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refs": [
{
"related_id": 2,
"page_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"version_id": 2
}
'import requests
url = "https://api.gratona.com/v1/admin/mentions/resolve"
payload = {
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refs": [
{
"related_id": 2,
"page_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"version_id": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
refs: [{related_id: 2, page_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
version_id: 2
})
};
fetch('https://api.gratona.com/v1/admin/mentions/resolve', 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.gratona.com/v1/admin/mentions/resolve",
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([
'document_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'refs' => [
[
'related_id' => 2,
'page_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'version_id' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.gratona.com/v1/admin/mentions/resolve"
payload := strings.NewReader("{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/mentions/resolve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/mentions/resolve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "<string>",
"level": "<string>",
"type": "<string>",
"type_label": "<string>",
"display": "<string>",
"url": "<string>",
"available": true,
"program_type": "<string>",
"mentioned_by": "<string>",
"inactive": true,
"requested": true
}
]
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Response
Resolve labels for document mentions response.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/mentions/resolve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refs": [
{
"related_id": 2,
"page_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"version_id": 2
}
'import requests
url = "https://api.gratona.com/v1/admin/mentions/resolve"
payload = {
"document_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refs": [
{
"related_id": 2,
"page_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"version_id": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
refs: [{related_id: 2, page_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
version_id: 2
})
};
fetch('https://api.gratona.com/v1/admin/mentions/resolve', 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.gratona.com/v1/admin/mentions/resolve",
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([
'document_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'refs' => [
[
'related_id' => 2,
'page_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'version_id' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.gratona.com/v1/admin/mentions/resolve"
payload := strings.NewReader("{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/mentions/resolve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/mentions/resolve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"refs\": [\n {\n \"related_id\": 2,\n \"page_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"version_id\": 2\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"key": "<string>",
"level": "<string>",
"type": "<string>",
"type_label": "<string>",
"display": "<string>",
"url": "<string>",
"available": true,
"program_type": "<string>",
"mentioned_by": "<string>",
"inactive": true,
"requested": true
}
]
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}