Index a custom content
curl --request POST \
--url https://api.super.work/v1/super/index \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rootId": "a2ZSuHnZf",
"id": "custom-id",
"title": "Note title",
"content": "# Content in markdown",
"type": "markdown",
"updatedAt": "2021-01-01T00:00:00Z",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite"
}
'import requests
url = "https://api.super.work/v1/super/index"
payload = {
"rootId": "a2ZSuHnZf",
"id": "custom-id",
"title": "Note title",
"content": "# Content in markdown",
"type": "markdown",
"updatedAt": "2021-01-01T00:00:00Z",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rootId: 'a2ZSuHnZf',
id: 'custom-id',
title: 'Note title',
content: '# Content in markdown',
type: 'markdown',
updatedAt: '2021-01-01T00:00:00Z',
url: 'https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite'
})
};
fetch('https://api.super.work/v1/super/index', 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.super.work/v1/super/index",
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([
'rootId' => 'a2ZSuHnZf',
'id' => 'custom-id',
'title' => 'Note title',
'content' => '# Content in markdown',
'type' => 'markdown',
'updatedAt' => '2021-01-01T00:00:00Z',
'url' => 'https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.super.work/v1/super/index"
payload := strings.NewReader("{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.super.work/v1/super/index")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.super.work/v1/super/index")
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'
request.body = "{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}"
response = http.request(request)
puts response.read_body{
"title": "Onboarding",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite",
"id": "S1TSuHnZf",
"updatedAt": "2021-01-01T00:00:00.000Z"
}{
"message": "Invalid apiKey",
"id": "auth/unauthorized"
}{
"message": "This feature is disabled for your organization. Please contact support.",
"id": "askx-disabled"
}{
"message": "Data source not found.",
"id": "root-id-not-found"
}{
"message": "Validation Failed",
"id": "field-validation",
"details": {}
}{
"message": "You've reached the api rate limit. Please wait and retry later.",
"id": "rate-limit"
}{
"message": "<string>",
"id": "<string>"
}Index a custom content
Index a custom content for Super usage.
POST
/
super
/
index
Index a custom content
curl --request POST \
--url https://api.super.work/v1/super/index \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rootId": "a2ZSuHnZf",
"id": "custom-id",
"title": "Note title",
"content": "# Content in markdown",
"type": "markdown",
"updatedAt": "2021-01-01T00:00:00Z",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite"
}
'import requests
url = "https://api.super.work/v1/super/index"
payload = {
"rootId": "a2ZSuHnZf",
"id": "custom-id",
"title": "Note title",
"content": "# Content in markdown",
"type": "markdown",
"updatedAt": "2021-01-01T00:00:00Z",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rootId: 'a2ZSuHnZf',
id: 'custom-id',
title: 'Note title',
content: '# Content in markdown',
type: 'markdown',
updatedAt: '2021-01-01T00:00:00Z',
url: 'https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite'
})
};
fetch('https://api.super.work/v1/super/index', 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.super.work/v1/super/index",
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([
'rootId' => 'a2ZSuHnZf',
'id' => 'custom-id',
'title' => 'Note title',
'content' => '# Content in markdown',
'type' => 'markdown',
'updatedAt' => '2021-01-01T00:00:00Z',
'url' => 'https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.super.work/v1/super/index"
payload := strings.NewReader("{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.super.work/v1/super/index")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.super.work/v1/super/index")
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'
request.body = "{\n \"rootId\": \"a2ZSuHnZf\",\n \"id\": \"custom-id\",\n \"title\": \"Note title\",\n \"content\": \"# Content in markdown\",\n \"type\": \"markdown\",\n \"updatedAt\": \"2021-01-01T00:00:00Z\",\n \"url\": \"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite\"\n}"
response = http.request(request)
puts response.read_body{
"title": "Onboarding",
"url": "https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite",
"id": "S1TSuHnZf",
"updatedAt": "2021-01-01T00:00:00.000Z"
}{
"message": "Invalid apiKey",
"id": "auth/unauthorized"
}{
"message": "This feature is disabled for your organization. Please contact support.",
"id": "askx-disabled"
}{
"message": "Data source not found.",
"id": "root-id-not-found"
}{
"message": "Validation Failed",
"id": "field-validation",
"details": {}
}{
"message": "You've reached the api rate limit. Please wait and retry later.",
"id": "rate-limit"
}{
"message": "<string>",
"id": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Root id of the object to gather sources from. This should be created from the UI as a new custom data source.
Example:
"a2ZSuHnZf"
Unique id of the object to index scoped to the rootId
Pattern:
^[A-Za-z0-9-_]+$Example:
"custom-id"
Title of the object to index
Example:
"Note title"
Content of the object to index
Example:
"# Content in markdown"
Type of the object to index. Can be "markdown" or "html"
Available options:
markdown, html Example:
"markdown"
Last update date of the object to index. Used to determine the freshness of the object.
Example:
"2021-01-01T00:00:00Z"
Url of the object to index. Used to redirect to the proper page.
Example:
"https://slite.slite.page/p/S1TSuHnZf/Security-at-Slite"
⌘I

