Create library
POST
https://api.catenda.com/v2/projects/{project-id}/libraries
Path Parameters
- project-idstringrequiredExampleDescription
Body Parameters
- bodyobjectrequired
- namestringrequiredExampleDescription
- typestring<classification>requiredExampleDescriptionAllowedclassification
- classificationobjectDescription
- sourcestringDescription
- editionstringDescription
- editionDatestringExampleDescription
Responses
200
- libraryDescription
- idstringExampleDescription
- namestringExampleDescription
- typestring<document | link | embedded_value | classification>ExampleDescriptionAlloweddocumentlinkembedded_valueclassification
- createdByuserDescription
- idstringExampleDescription
- namestringExampleDescription
- usernamestringExampleDescription
- emailstringExampleDescription
- createdAtstringExampleDescription
- avatarUrlstringExampleDescription
- typestring<user | organization | team>ExampleDescriptionAlloweduserorganizationteam
curl
curl --request POST \
--url https://api.catenda.com/v2/projects/{project-id}/libraries \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "Library 1",
"type": "classification"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "Library 1",
"type": "classification"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.catenda.com/v2/projects/{project-id}/libraries", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.catenda.com/v2/projects/{project-id}/libraries")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"name": "Library 1",
"type": "classification"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.catenda.com/v2/projects/{project-id}/libraries"
payload = json.dumps({
"name": "Library 1",
"type": "classification"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"id": "954803076a694255b959d236517b55da",
"name": "Library Name",
"type": "document",
"createdBy": {
"id": "524809076a694255b989d236517a55da",
"name": "John Doe",
"username": "[email protected]",
"email": "[email protected]",
"createdAt": "2016-09-20T14:55:22.000Z",
"avatarUrl": "https://api.catenda.com/v2/avatar/397t0ccd8f74516096c738de15dc6512",
"type": "user"
}
}