Create a book.
curl --request POST \
--url https://api.riskportal.activeviam.com/api/Books/CreateBook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core",
"book_name": "Example book",
"description": "<string>"
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Books/CreateBook"
payload = {
"$type": "Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core",
"book_name": "Example book",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core',
book_name: 'Example book',
description: '<string>'
})
};
fetch('https://api.riskportal.activeviam.com/api/Books/CreateBook', 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.riskportal.activeviam.com/api/Books/CreateBook",
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([
'$type' => 'Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core',
'book_name' => 'Example book',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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.riskportal.activeviam.com/api/Books/CreateBook"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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.riskportal.activeviam.com/api/Books/CreateBook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Books/CreateBook")
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-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Book.ApiBookCreateResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Create a book.
Creates an active Derivitec book and makes the caller its owner. Both name and description are required, and the name cannot duplicate another book already linked to the caller. Creation completes before returning in the normal result envelope.
POST
/
api
/
Books
/
CreateBook
Create a book.
curl --request POST \
--url https://api.riskportal.activeviam.com/api/Books/CreateBook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"$type": "Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core",
"book_name": "Example book",
"description": "<string>"
}
'import requests
url = "https://api.riskportal.activeviam.com/api/Books/CreateBook"
payload = {
"$type": "Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core",
"book_name": "Example book",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
$type: 'Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core',
book_name: 'Example book',
description: '<string>'
})
};
fetch('https://api.riskportal.activeviam.com/api/Books/CreateBook', 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.riskportal.activeviam.com/api/Books/CreateBook",
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([
'$type' => 'Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core',
'book_name' => 'Example book',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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.riskportal.activeviam.com/api/Books/CreateBook"
payload := strings.NewReader("{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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.riskportal.activeviam.com/api/Books/CreateBook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.riskportal.activeviam.com/api/Books/CreateBook")
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-patch+json'
request.body = "{\n \"$type\": \"Derivitec.Web.Core.Book.ApiBookCreateRequest, Derivitec.Web.Core\",\n \"book_name\": \"Example book\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"$type": "Derivitec.Web.Core.Book.ApiBookCreateResponse, Derivitec.Web.Core",
"is_success": true,
"error_messages": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
oauth2apikey
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Required non-empty BookName and Description. This request declares no explicit length bounds.
Book name and description used to create a Derivitec-managed book.
Response
Created
Outcome of creating a book.
Was this page helpful?