curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/enums/{name}/record?token=' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"priority": "Highest"
},
"ids": [
"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca"
],
"__order": 3
}
'import requests
url = "https://sandbox.circularo.com/api/v1/enums/{name}/record?token="
payload = {
"data": { "priority": "Highest" },
"ids": ["3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca"],
"__order": 3
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: {priority: 'Highest'},
ids: ['3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca'],
__order: 3
})
};
fetch('https://sandbox.circularo.com/api/v1/enums/{name}/record?token=', 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://sandbox.circularo.com/api/v1/enums/{name}/record?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'priority' => 'Highest'
],
'ids' => [
'3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca'
],
'__order' => 3
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/enums/{name}/record?token="
payload := strings.NewReader("{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://sandbox.circularo.com/api/v1/enums/{name}/record?token=")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/enums/{name}/record?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}"
response = http.request(request)
puts response.read_body{
"count": 22,
"errors": false,
"items": [
{
"id": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"index": "default_documents",
"status": 409,
"message": "Incorrect version",
"payload": {},
"type": "DOCUMENT:VERSION_CONFLICT"
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Update enumeration records
PUT /enums/{name}/record
Writes the same set of values into one or more records of an enumeration, merging them field by field so that ordinary fields the request does not mention keep what they hold. The unique fields are the exception: the request is validated against data alone before anything is merged, so each of them has to be sent along even when it is not the field being changed.
Sending a unique field with a new value changes what identifies the record, and an identity cannot be edited in place: such a record is deleted and stored again under the new identifier, which also credits it to whoever made the change and resets when it was created. A record whose unique values come back unchanged is updated where it stands.
Records are handled one by one and the call answers success even when some of them did not go through - a record the caller may not edit, and one blocked because the enumeration is not dynamic, are each reported against their own entry in the response body, so the outcome cannot be read off the status code. The call as a whole is refused only when none of the identifiers resolved to a record.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
curl --request PUT \
--url 'https://sandbox.circularo.com/api/v1/enums/{name}/record?token=' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"priority": "Highest"
},
"ids": [
"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca"
],
"__order": 3
}
'import requests
url = "https://sandbox.circularo.com/api/v1/enums/{name}/record?token="
payload = {
"data": { "priority": "Highest" },
"ids": ["3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca"],
"__order": 3
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
data: {priority: 'Highest'},
ids: ['3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca'],
__order: 3
})
};
fetch('https://sandbox.circularo.com/api/v1/enums/{name}/record?token=', 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://sandbox.circularo.com/api/v1/enums/{name}/record?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'priority' => 'Highest'
],
'ids' => [
'3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca'
],
'__order' => 3
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/enums/{name}/record?token="
payload := strings.NewReader("{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://sandbox.circularo.com/api/v1/enums/{name}/record?token=")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/enums/{name}/record?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"priority\": \"Highest\"\n },\n \"ids\": [\n \"3f8a1c0e5b7d29461af0c3e8d5b2790c4e6a8137f92d5b0ac1e74f6839b25dca\"\n ],\n \"__order\": 3\n}"
response = http.request(request)
puts response.read_body{
"count": 22,
"errors": false,
"items": [
{
"id": "a0d01c9d-f72f-4c57-af11-e26bda19cc59",
"index": "default_documents",
"status": 409,
"message": "Incorrect version",
"payload": {},
"type": "DOCUMENT:VERSION_CONFLICT"
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Path Parameters
Body
Values to write, keyed by the field names the enumeration declares. Keys it does not declare are dropped, and an ordinary field left out keeps the value it has - but every field the enumeration names as unique has to be present whatever the change is, carrying either its current value or the new one. A file or image value may only be sent for a single record at a time, since a stored file belongs to one record.
{ "priority": "Highest" }
Response
Returns the outcome of every record the request named - a record whose file sent as base64 starts as a PDF but cannot be read as one fails on its own.