curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/export/count?token=' \
--header 'Content-Type: application/json' \
--data '
{
"exporterName": "folder",
"query": {
"activity": {
"states": [
"signing"
],
"requests": [
"sign"
]
},
"aggs": {},
"allowFolders": true,
"assignedToGroups": [
"accounting"
],
"createdByGroups": [
"accounting"
],
"esFilters": [
{}
],
"esQuery": [
{}
],
"exclude": [
"file",
"workflow.history"
],
"fields": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"filters": {
"document": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"history": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"workflow": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
]
},
"folder": {
"folder": "8b312068-ecdf-4fa6-8f13-c6183da85f43",
"global": false,
"recursive": false
},
"from": 0,
"highlight": {},
"inbox": true,
"lastAction": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"lastActivity": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"lastRequest": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"limit": 20,
"nested_queryStrings": [
{}
],
"page": 0,
"query_string": {},
"scroll": {
"id": "<string>",
"timeout": 30
},
"signable": true,
"size": 10,
"sort": [
{}
],
"tags": {
"and": false,
"any": [
"invoice"
],
"global": [
"invoice"
],
"user": [
"to-review"
]
},
"trash": true,
"type": "d_default",
"unreadOnly": true,
"workflow": "wf_archive"
},
"options": {
"documentIds": [
"8b312068-ecdf-4fa6-8f13-c6183da85f43"
]
}
}
'import requests
url = "https://sandbox.circularo.com/api/v1/export/count?token="
payload = {
"exporterName": "folder",
"query": {
"activity": {
"states": ["signing"],
"requests": ["sign"]
},
"aggs": {},
"allowFolders": True,
"assignedToGroups": ["accounting"],
"createdByGroups": ["accounting"],
"esFilters": [{}],
"esQuery": [{}],
"exclude": ["file", "workflow.history"],
"fields": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"filters": {
"document": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"history": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"workflow": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
]
},
"folder": {
"folder": "8b312068-ecdf-4fa6-8f13-c6183da85f43",
"global": False,
"recursive": False
},
"from": 0,
"highlight": {},
"inbox": True,
"lastAction": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"lastActivity": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"lastRequest": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"limit": 20,
"nested_queryStrings": [{}],
"page": 0,
"query_string": {},
"scroll": {
"id": "<string>",
"timeout": 30
},
"signable": True,
"size": 10,
"sort": [{}],
"tags": {
"and": False,
"any": ["invoice"],
"global": ["invoice"],
"user": ["to-review"]
},
"trash": True,
"type": "d_default",
"unreadOnly": True,
"workflow": "wf_archive"
},
"options": { "documentIds": ["8b312068-ecdf-4fa6-8f13-c6183da85f43"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
exporterName: 'folder',
query: {
activity: {states: ['signing'], requests: ['sign']},
aggs: {},
allowFolders: true,
assignedToGroups: ['accounting'],
createdByGroups: ['accounting'],
esFilters: [{}],
esQuery: [{}],
exclude: ['file', 'workflow.history'],
fields: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
filters: {
document: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
history: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
workflow: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}]
},
folder: {
folder: '8b312068-ecdf-4fa6-8f13-c6183da85f43',
global: false,
recursive: false
},
from: 0,
highlight: {},
inbox: true,
lastAction: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
lastActivity: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
lastRequest: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
limit: 20,
nested_queryStrings: [{}],
page: 0,
query_string: {},
scroll: {id: '<string>', timeout: 30},
signable: true,
size: 10,
sort: [{}],
tags: {and: false, any: ['invoice'], global: ['invoice'], user: ['to-review']},
trash: true,
type: 'd_default',
unreadOnly: true,
workflow: 'wf_archive'
},
options: {documentIds: ['8b312068-ecdf-4fa6-8f13-c6183da85f43']}
})
};
fetch('https://sandbox.circularo.com/api/v1/export/count?token=', 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://sandbox.circularo.com/api/v1/export/count?token=",
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([
'exporterName' => 'folder',
'query' => [
'activity' => [
'states' => [
'signing'
],
'requests' => [
'sign'
]
],
'aggs' => [
],
'allowFolders' => true,
'assignedToGroups' => [
'accounting'
],
'createdByGroups' => [
'accounting'
],
'esFilters' => [
[
]
],
'esQuery' => [
[
]
],
'exclude' => [
'file',
'workflow.history'
],
'fields' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'filters' => [
'document' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'history' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'workflow' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
]
],
'folder' => [
'folder' => '8b312068-ecdf-4fa6-8f13-c6183da85f43',
'global' => false,
'recursive' => false
],
'from' => 0,
'highlight' => [
],
'inbox' => true,
'lastAction' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'lastActivity' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'lastRequest' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'limit' => 20,
'nested_queryStrings' => [
[
]
],
'page' => 0,
'query_string' => [
],
'scroll' => [
'id' => '<string>',
'timeout' => 30
],
'signable' => true,
'size' => 10,
'sort' => [
[
]
],
'tags' => [
'and' => false,
'any' => [
'invoice'
],
'global' => [
'invoice'
],
'user' => [
'to-review'
]
],
'trash' => true,
'type' => 'd_default',
'unreadOnly' => true,
'workflow' => 'wf_archive'
],
'options' => [
'documentIds' => [
'8b312068-ecdf-4fa6-8f13-c6183da85f43'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/export/count?token="
payload := strings.NewReader("{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/export/count?token=")
.header("Content-Type", "application/json")
.body("{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/export/count?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"count": 42
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Count the documents an export would cover
POST /export/count
Returns how many documents the given exporter would take in, without exporting anything. A client asks this before offering the export, to warn the user about the size of it and to tell whether the export will come back in the response or be handed to a background job.
The number is the exporter’s own answer, not a plain search count: the exporters driven by query count the documents it matches, while folder counts what options.documentIds names and userData counts all of the caller’s own documents - which is exactly why the endpoint exists for the exporters that take no query. Aggregations are dropped from the search before it is counted, and the count reaches only the documents the caller may read, the reporting exporter aside: for a caller holding the use_all_documents_export right it counts across their whole organization.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/export/count?token=' \
--header 'Content-Type: application/json' \
--data '
{
"exporterName": "folder",
"query": {
"activity": {
"states": [
"signing"
],
"requests": [
"sign"
]
},
"aggs": {},
"allowFolders": true,
"assignedToGroups": [
"accounting"
],
"createdByGroups": [
"accounting"
],
"esFilters": [
{}
],
"esQuery": [
{}
],
"exclude": [
"file",
"workflow.history"
],
"fields": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"filters": {
"document": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"history": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"workflow": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
]
},
"folder": {
"folder": "8b312068-ecdf-4fa6-8f13-c6183da85f43",
"global": false,
"recursive": false
},
"from": 0,
"highlight": {},
"inbox": true,
"lastAction": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"lastActivity": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"lastRequest": [
{
"field": "documentType",
"type": "term",
"inverse": true,
"value": "d_default"
}
],
"limit": 20,
"nested_queryStrings": [
{}
],
"page": 0,
"query_string": {},
"scroll": {
"id": "<string>",
"timeout": 30
},
"signable": true,
"size": 10,
"sort": [
{}
],
"tags": {
"and": false,
"any": [
"invoice"
],
"global": [
"invoice"
],
"user": [
"to-review"
]
},
"trash": true,
"type": "d_default",
"unreadOnly": true,
"workflow": "wf_archive"
},
"options": {
"documentIds": [
"8b312068-ecdf-4fa6-8f13-c6183da85f43"
]
}
}
'import requests
url = "https://sandbox.circularo.com/api/v1/export/count?token="
payload = {
"exporterName": "folder",
"query": {
"activity": {
"states": ["signing"],
"requests": ["sign"]
},
"aggs": {},
"allowFolders": True,
"assignedToGroups": ["accounting"],
"createdByGroups": ["accounting"],
"esFilters": [{}],
"esQuery": [{}],
"exclude": ["file", "workflow.history"],
"fields": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"filters": {
"document": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"history": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"workflow": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
]
},
"folder": {
"folder": "8b312068-ecdf-4fa6-8f13-c6183da85f43",
"global": False,
"recursive": False
},
"from": 0,
"highlight": {},
"inbox": True,
"lastAction": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"lastActivity": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"lastRequest": [
{
"field": "documentType",
"type": "term",
"inverse": True,
"value": "d_default"
}
],
"limit": 20,
"nested_queryStrings": [{}],
"page": 0,
"query_string": {},
"scroll": {
"id": "<string>",
"timeout": 30
},
"signable": True,
"size": 10,
"sort": [{}],
"tags": {
"and": False,
"any": ["invoice"],
"global": ["invoice"],
"user": ["to-review"]
},
"trash": True,
"type": "d_default",
"unreadOnly": True,
"workflow": "wf_archive"
},
"options": { "documentIds": ["8b312068-ecdf-4fa6-8f13-c6183da85f43"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
exporterName: 'folder',
query: {
activity: {states: ['signing'], requests: ['sign']},
aggs: {},
allowFolders: true,
assignedToGroups: ['accounting'],
createdByGroups: ['accounting'],
esFilters: [{}],
esQuery: [{}],
exclude: ['file', 'workflow.history'],
fields: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
filters: {
document: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
history: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
workflow: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}]
},
folder: {
folder: '8b312068-ecdf-4fa6-8f13-c6183da85f43',
global: false,
recursive: false
},
from: 0,
highlight: {},
inbox: true,
lastAction: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
lastActivity: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
lastRequest: [{field: 'documentType', type: 'term', inverse: true, value: 'd_default'}],
limit: 20,
nested_queryStrings: [{}],
page: 0,
query_string: {},
scroll: {id: '<string>', timeout: 30},
signable: true,
size: 10,
sort: [{}],
tags: {and: false, any: ['invoice'], global: ['invoice'], user: ['to-review']},
trash: true,
type: 'd_default',
unreadOnly: true,
workflow: 'wf_archive'
},
options: {documentIds: ['8b312068-ecdf-4fa6-8f13-c6183da85f43']}
})
};
fetch('https://sandbox.circularo.com/api/v1/export/count?token=', 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://sandbox.circularo.com/api/v1/export/count?token=",
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([
'exporterName' => 'folder',
'query' => [
'activity' => [
'states' => [
'signing'
],
'requests' => [
'sign'
]
],
'aggs' => [
],
'allowFolders' => true,
'assignedToGroups' => [
'accounting'
],
'createdByGroups' => [
'accounting'
],
'esFilters' => [
[
]
],
'esQuery' => [
[
]
],
'exclude' => [
'file',
'workflow.history'
],
'fields' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'filters' => [
'document' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'history' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'workflow' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
]
],
'folder' => [
'folder' => '8b312068-ecdf-4fa6-8f13-c6183da85f43',
'global' => false,
'recursive' => false
],
'from' => 0,
'highlight' => [
],
'inbox' => true,
'lastAction' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'lastActivity' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'lastRequest' => [
[
'field' => 'documentType',
'type' => 'term',
'inverse' => true,
'value' => 'd_default'
]
],
'limit' => 20,
'nested_queryStrings' => [
[
]
],
'page' => 0,
'query_string' => [
],
'scroll' => [
'id' => '<string>',
'timeout' => 30
],
'signable' => true,
'size' => 10,
'sort' => [
[
]
],
'tags' => [
'and' => false,
'any' => [
'invoice'
],
'global' => [
'invoice'
],
'user' => [
'to-review'
]
],
'trash' => true,
'type' => 'd_default',
'unreadOnly' => true,
'workflow' => 'wf_archive'
],
'options' => [
'documentIds' => [
'8b312068-ecdf-4fa6-8f13-c6183da85f43'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://sandbox.circularo.com/api/v1/export/count?token="
payload := strings.NewReader("{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/export/count?token=")
.header("Content-Type", "application/json")
.body("{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/export/count?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"exporterName\": \"folder\",\n \"query\": {\n \"activity\": {\n \"states\": [\n \"signing\"\n ],\n \"requests\": [\n \"sign\"\n ]\n },\n \"aggs\": {},\n \"allowFolders\": true,\n \"assignedToGroups\": [\n \"accounting\"\n ],\n \"createdByGroups\": [\n \"accounting\"\n ],\n \"esFilters\": [\n {}\n ],\n \"esQuery\": [\n {}\n ],\n \"exclude\": [\n \"file\",\n \"workflow.history\"\n ],\n \"fields\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"filters\": {\n \"document\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"history\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"workflow\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ]\n },\n \"folder\": {\n \"folder\": \"8b312068-ecdf-4fa6-8f13-c6183da85f43\",\n \"global\": false,\n \"recursive\": false\n },\n \"from\": 0,\n \"highlight\": {},\n \"inbox\": true,\n \"lastAction\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastActivity\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"lastRequest\": [\n {\n \"field\": \"documentType\",\n \"type\": \"term\",\n \"inverse\": true,\n \"value\": \"d_default\"\n }\n ],\n \"limit\": 20,\n \"nested_queryStrings\": [\n {}\n ],\n \"page\": 0,\n \"query_string\": {},\n \"scroll\": {\n \"id\": \"<string>\",\n \"timeout\": 30\n },\n \"signable\": true,\n \"size\": 10,\n \"sort\": [\n {}\n ],\n \"tags\": {\n \"and\": false,\n \"any\": [\n \"invoice\"\n ],\n \"global\": [\n \"invoice\"\n ],\n \"user\": [\n \"to-review\"\n ]\n },\n \"trash\": true,\n \"type\": \"d_default\",\n \"unreadOnly\": true,\n \"workflow\": \"wf_archive\"\n },\n \"options\": {\n \"documentIds\": [\n \"8b312068-ecdf-4fa6-8f13-c6183da85f43\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"count": 42
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}