Replace knowledge file
curl --request PUT \
--url https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded'const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file';
const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file"
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.put(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
response = http.request(request)
puts response.read_body{
"contentType": "<string>",
"embeddingStatus": "<string>",
"filename": "<string>",
"id": "<string>",
"size": 123,
"tags": [
"<string>"
],
"workspaceId": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}knowledge
Replace knowledge file
Replace an existing knowledge base file. The uploaded filename may rename the file.
PUT
/
workspaces
/
{workspaceID}
/
knowledges
/
{knowledgeID}
/
file
Replace knowledge file
curl --request PUT \
--url https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded'const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch('https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file';
const options = {
method: 'PUT',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file"
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.put(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/knowledges/{knowledgeID}/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
response = http.request(request)
puts response.read_body{
"contentType": "<string>",
"embeddingStatus": "<string>",
"filename": "<string>",
"id": "<string>",
"size": 123,
"tags": [
"<string>"
],
"workspaceId": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}{
"data": [
{
"createdAt": "<string>",
"type": "email",
"value": "<string>"
}
],
"message": "<string>"
}Authorizations
Body
application/x-www-form-urlencodedmultipart/form-data
Replacement file (.pdf, .txt, .md, .csv, .html, .htm, .docx)
The body is of type file.
