Bulk upsert or delete vocabularies
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"operations": [
{
"upsert": {
"key": "<string>",
"title": "<string>",
"description": "<string>"
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk"
payload = { "operations": [{ "upsert": {
"key": "<string>",
"title": "<string>",
"description": "<string>"
} }] }
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [{upsert: {key: '<string>', title: '<string>', description: '<string>'}}]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk', 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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk",
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([
'operations' => [
[
'upsert' => [
'key' => '<string>',
'title' => '<string>',
'description' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-API-Key: <api-key>"
],
]);
$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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-API-Key", "<api-key>")
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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"receipts": [
{
"key": "<string>",
"error": {
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}
}
]
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Vocabularies
Bulk upsert or delete vocabularies
Bulk upsert or delete vocabularies. Bulk operations are processed synchronously.
POST
/
terminology
/
v1
/
vocabularies
/
bulk
Bulk upsert or delete vocabularies
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"operations": [
{
"upsert": {
"key": "<string>",
"title": "<string>",
"description": "<string>"
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk"
payload = { "operations": [{ "upsert": {
"key": "<string>",
"title": "<string>",
"description": "<string>"
} }] }
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [{upsert: {key: '<string>', title: '<string>', description: '<string>'}}]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk', 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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk",
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([
'operations' => [
[
'upsert' => [
'key' => '<string>',
'title' => '<string>',
'description' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-API-Key: <api-key>"
],
]);
$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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-API-Key", "<api-key>")
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.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/terminology/v1/vocabularies/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"upsert\": {\n \"key\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"receipts": [
{
"key": "<string>",
"error": {
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}
}
]
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Authorizations
apiKeybasicHttpAuthbearerHttpAuth
Body
application/json
The request body should contain a list of vocabularies to upsert or delete.
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
The bulk operation is valid.
Response contains the status of bulk request and status of each processed operation.
Bulk request status will be SUCCESS if all operations are successful, otherwise FAILURE.
The status of the bulk request. If one or more operations failed, the status will be FAILURE.
Available options:
SUCCESS, PENDING, CANCELLED, FAILURE In case of failure, receipts of the operations are returned. Every operation sent will have a receipt corresponding to their original order. Each receipt will contain the status of the operation and an error if the operation failed.
Show child attributes
Show child attributes
Was this page helpful?
⌘I