Fetch Drafts
curl --request GET \
--url https://api.sublay.io/v8/:projectId/entities/drafts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/entities/drafts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/entities/drafts', 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.sublay.io/v8/:projectId/entities/drafts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/entities/drafts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/entities/drafts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/entities/drafts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEntity Endpoints
Fetch Drafts
Get the authenticated user’s draft entities
Fetch Drafts
curl --request GET \
--url https://api.sublay.io/v8/:projectId/entities/drafts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/entities/drafts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/entities/drafts', 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.sublay.io/v8/:projectId/entities/drafts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/entities/drafts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/entities/drafts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/entities/drafts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyRequires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.Query Parameters
number
default:"1"
Page number (1-indexed). A whole number of at least
1 — 0, a negative number or a non-integer value returns 400 entity/invalid-query.number
default:"10"
Number of drafts per page. A whole number of at least
1 — 0, a negative number or a non-integer value returns 400 entity/invalid-query. Maximum 100 — larger values are treated as 100.string
Filter drafts by
sourceId. Pass "null" to return drafts with no sourceId.string
Filter drafts by space ID.
string
Associations to include. Pass it as one comma-separated value (
include=user,space) or as repeated params (include=user&include=space). Values:user— the author’s user profilespace— the space the entity belongs tofiles— uploaded file/image attachmentsgrants— the reputation-grant summary for the entity
topComments and saved aren’t accepted here: any other value returns 400 entity/invalid-query.Response
Returns a paginated response:{
"data": [ ...Entity[] ],
"pagination": {
"page": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 3,
"hasMore": false
}
}
isDraft: true. Results are ordered by most recently updated.
Error Responses
Invalid Query — 400
Invalid Query — 400
Returned when
page or limit is below 1 or not a whole number, or include contains a value that isn’t accepted here.{ "error": "page: Page must be a positive integer", "code": "entity/invalid-query" }
Unauthorized — 401
Unauthorized — 401
Returned when no user is authenticated.

