List reports
curl --request GET \
--url https://api.togai.com/reports \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/reports"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/reports', 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.togai.com/reports",
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.togai.com/reports"
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.togai.com/reports")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/reports")
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_body{
"data": [
{
"id": "report.23Xx0Jkc2DM.FgysO",
"name": "acme-2024-09-18.csv",
"status": "COMPLETED",
"createdAt": "2024-09-18T01:30:08.216867Z",
"updatedAt": "2024-09-18T01:30:08.350259Z",
"accountId": null,
"fileId": "file.23Xx0JkTljo.4JN5B",
"queryInput": null,
"reportTemplateId": null,
"preSignedUrl": null,
"type": "CUSTOM"
},
{
"id": "report.231kfXmrPq7.YJkpy",
"name": "Demo Report",
"status": "COMPLETED",
"createdAt": "2024-06-28T16:38:05.517189Z",
"updatedAt": "2024-06-28T16:38:20.533519Z",
"accountId": null,
"fileId": "file.231kfo14hqu.7ejfb",
"queryInput": {
"selects": [
{
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": null,
"aggregator": null
}
],
"baseDataSource": "customers",
"sort": [
{
"column": {
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": [],
"aggregator": null
},
"sortOrder": "ASC"
}
],
"limit": "1000,",
"queryFilters": null,
"seekValues": null
},
"reportTemplateId": "report_template.231kfPGCpoQ.SSeyY",
"preSignedUrl": null,
"type": "TEMPLATE"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
}{
"message": "<Reason message>"
}Reports
List reports
List reports
GET
/
reports
List reports
curl --request GET \
--url https://api.togai.com/reports \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/reports"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/reports', 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.togai.com/reports",
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.togai.com/reports"
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.togai.com/reports")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/reports")
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_body{
"data": [
{
"id": "report.23Xx0Jkc2DM.FgysO",
"name": "acme-2024-09-18.csv",
"status": "COMPLETED",
"createdAt": "2024-09-18T01:30:08.216867Z",
"updatedAt": "2024-09-18T01:30:08.350259Z",
"accountId": null,
"fileId": "file.23Xx0JkTljo.4JN5B",
"queryInput": null,
"reportTemplateId": null,
"preSignedUrl": null,
"type": "CUSTOM"
},
{
"id": "report.231kfXmrPq7.YJkpy",
"name": "Demo Report",
"status": "COMPLETED",
"createdAt": "2024-06-28T16:38:05.517189Z",
"updatedAt": "2024-06-28T16:38:20.533519Z",
"accountId": null,
"fileId": "file.231kfo14hqu.7ejfb",
"queryInput": {
"selects": [
{
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": null,
"aggregator": null
}
],
"baseDataSource": "customers",
"sort": [
{
"column": {
"columnName": "name",
"dataSource": null,
"alias": " cus1-account",
"functions": [],
"aggregator": null
},
"sortOrder": "ASC"
}
],
"limit": "1000,",
"queryFilters": null,
"seekValues": null
},
"reportTemplateId": "report_template.231kfPGCpoQ.SSeyY",
"preSignedUrl": null,
"type": "TEMPLATE"
}
],
"nextToken": "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
}{
"message": "<Reason message>"
}Query Parameters
Query Parameters
Filterable Fields
Filterable Fields
Searchable Fields
Searchable Fields
Downloading Reports:Reports can be downloaded using the
fileId parameter of the Report entity using the Files API.Sharing Reports:Sharable links can be generated using the Generate download URL API
which are S3 signed URLs valid for 1 hour and do not require authentication.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Example:
"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="
Example:
10
Fetch for flag used to get the reports from:
- ALL: Both the organization and accounts
- ORGANIZATION: Only the organization
- ACCOUNTS: Only accounts, works with account_id filter only.
Available options:
ALL, ORGANIZATION, ACCOUNTS 