Repository (V2)¶
Send an email, export the configuration of a destination, list identities with access to a content type, recycle a document.
Every call in this group
- Method
POSTtohttps://{tenant}/api/{Group}/{Action}, also for reads. - Header
TempIdentityToken: <token>. Create tokens in Configuration > Services > API Access. - Success HTTP 200 with
{ "Success": true, "MessageKey": ..., "Data": ... }. Always checkSuccess. - Failure HTTP 412 with
{ "Success": false, "Messages": [ { "MessageKey": ... } ] }. The spec lists failures as 400; the server sends 412. HTTP 401 means the token or its features; HTTP 422 means the body does not match the model. - C# samples Use the generated client
KL.APIClient. Generate the client from your tenant's spec (how). A non-200 status throwsKL.APIClient.Client.ApiException. - Guides API introduction, Authentication
Actions¶
| Action | Summary |
|---|---|
| ExportReservoirConfigJson | Export configuration JSON for Reservoir to be used with Local Reservoir API. |
| GetIdentitiesWithAccessToContentType | Retrieves a collection of identities and their permissions with access to the specified content type. |
| SendDocumentToRecycleBin | Sends the specified Document to the configured Recycle Bin |
| SendEmail | Sends an email using the specified connector and email details. |
ExportReservoirConfigJson¶
Export configuration JSON for Reservoir to be used with Local Reservoir API.
- Content type: application/json
Request¶
No body. Send {} or an empty body.
Response¶
Returns a JSON string representing the configuration used by Reservoir, stripped of any sensitive information.
Envelope: DataResponseConfigDTO. Data is string.
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V2RepositoryAPIApi(config);
var response = await api.V2RepositoryAPIControllerExportReservoirConfigJsonAsync();
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/ExportReservoirConfigJson",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/ExportReservoirConfigJson", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
GetIdentitiesWithAccessToContentType¶
Retrieves a collection of identities and their permissions with access to the specified content type.
- Content type: application/json
Request¶
Identifying information for the content type.
Schema: ContentTypeIdentifierParameter. Identifying information for a content type
| Field | Type | Description |
|---|---|---|
InternalContentTypeId |
string (uuid) | Id of the content type used to refer to it internally |
Response¶
Returns a collection of user tokens and permissions representing identities with access to the specified content type.
Envelope: DataResponseIdentityPermissionsDTO. Data is IdentityPermissionsDTO.
{
"Success": true,
"MessageKey": null,
"Data": {
"V1_Identities": [
"user1_cfa6faf496dcf6620ba029b7aa3fa93707234fc2",
"user2_1eebf4aec3718f0ef5a432fe9aaecb3918228d41"
],
"IdentityPermissionSets": [
{
"IdentityToken": "user1_cfa6faf496dcf6620ba029b7aa3fa93707234fc2",
"Permission": "Fetch"
},
{
"IdentityToken": "user1_cfa6faf496dcf6620ba029b7aa3fa93707234fc2",
"Permission": "Update"
},
{
"IdentityToken": "user2_1eebf4aec3718f0ef5a432fe9aaecb3918228d41",
"Permission": "Delete"
}
]
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V2RepositoryAPIApi(config);
var response = await api.V2RepositoryAPIControllerGetIdentitiesWithAccessToContentTypeAsync(new ContentTypeIdentifierParameter
{
InternalContentTypeId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"InternalContentTypeId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/GetIdentitiesWithAccessToContentType" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/GetIdentitiesWithAccessToContentType",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"InternalContentTypeId": "00000000-0000-0000-0000-000000000000"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/GetIdentitiesWithAccessToContentType", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"InternalContentTypeId": "00000000-0000-0000-0000-000000000000"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
SendDocumentToRecycleBin¶
Sends the specified Document to the configured Recycle Bin
- Token feature Recycle Documents
- Content type application/json
Request¶
Schema: RecycleDocumentParameter. Identifying information for a document to send to the recycle bin.
| Field | Type | Description |
|---|---|---|
SearchCatalogId |
string (uuid) | Search Catalog Id |
DocumentId |
string | Document Id |
OptionalProperties |
object | Dictionary of string values. Such as hash Signature |
Response¶
The specified document has been sent to the recycle bin.
Envelope: KLApiResponse.
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V2RepositoryAPIApi(config);
var response = await api.V2RepositoryAPIControllerSendDocumentToRecycleBinAsync(new RecycleDocumentParameter
{
SearchCatalogId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
DocumentId = "string",
OptionalProperties = new Dictionary<string, string>(),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response);
$body = @'
{
"SearchCatalogId": "00000000-0000-0000-0000-000000000000",
"DocumentId": "string",
"OptionalProperties": {}
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendDocumentToRecycleBin" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendDocumentToRecycleBin",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"SearchCatalogId": "00000000-0000-0000-0000-000000000000",
"DocumentId": "string",
"OptionalProperties": {}
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendDocumentToRecycleBin", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"SearchCatalogId": "00000000-0000-0000-0000-000000000000",
"DocumentId": "string",
"OptionalProperties": {}
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
SendEmail¶
Sends an email using the specified connector and email details.
- Token feature Send Emails
- Content type application/json
Request¶
Object defining the parameters to use to send an email directly..
Schema: SendRepositoryEmailParameter. Object defining the parameters to use to send an email directly.
| Field | Type | Description |
|---|---|---|
EmailConnectorId |
string (uuid) | The id of a configured email connector. |
ToAddresses |
array of string | Who to send this email to. |
CcAddresses |
array of string | Who to include on the CC field of this email. |
Subject |
string | The subject line of the email send. |
Body |
string | The body of the email send. |
IsBodyHtml |
boolean | If true the body field is treated as HTML, if false or null it is treated as plain text |
Response¶
The email was successfully sent.
Envelope: KLApiResponse.
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V2RepositoryAPIApi(config);
var response = await api.V2RepositoryAPIControllerSendEmailAsync(new SendRepositoryEmailParameter
{
EmailConnectorId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
ToAddresses = new List<string> { "string" },
CcAddresses = new List<string> { "string" },
Subject = "string",
Body = "string",
IsBodyHtml = false,
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendEmail" \
-H "TempIdentityToken: $KL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"EmailConnectorId": "00000000-0000-0000-0000-000000000000", "ToAddresses": ["string"], "CcAddresses": ["string"], "Subject": "string", "Body": "string", "IsBodyHtml": false}'
$body = @'
{
"EmailConnectorId": "00000000-0000-0000-0000-000000000000",
"ToAddresses": [
"string"
],
"CcAddresses": [
"string"
],
"Subject": "string",
"Body": "string",
"IsBodyHtml": false
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendEmail" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendEmail",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"EmailConnectorId": "00000000-0000-0000-0000-000000000000",
"ToAddresses": [
"string"
],
"CcAddresses": [
"string"
],
"Subject": "string",
"Body": "string",
"IsBodyHtml": false
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V2_RepositoryAPI/SendEmail", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"EmailConnectorId": "00000000-0000-0000-0000-000000000000",
"ToAddresses": [
"string"
],
"CcAddresses": [
"string"
],
"Subject": "string",
"Body": "string",
"IsBodyHtml": false
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);