Skip to content

Commit fb2d776

Browse files
runtime sort update
1 parent a08e613 commit fb2d776

2 files changed

Lines changed: 46 additions & 52 deletions

File tree

modules/ROOT/pages/common/nav-rest-api.adoc

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ REST APIs
1212
* link:{{navprefix}}/api-authv2[REST API v2.0 authentication]
1313
* link:{{navprefix}}/rest-v2-changelog[REST API v2 changelog]
1414
* link:{{navprefix}}/restV2-playground?apiResourceId=http%2Fgetting-started%2Fintroduction[REST API v2 Playground]
15-
* link:{{navprefix}}/rest-apiv2-reference[REST API v2.0 Reference]
16-
** link:{{navprefix}}/api-user-management[Users and group privileges]
17-
** link:{{navprefix}}/rbac[Role-based access control]
18-
** link:{{navprefix}}/rest-apiv2-search[Search API endpoints]
19-
*** link:{{navprefix}}/rest-apiv2-users-search[Search users]
20-
*** link:{{navprefix}}/rest-apiv2-groups-search[Search groups]
21-
*** link:{{navprefix}}/rest-apiv2-metadata-search[Search metadata]
22-
** link:{{navprefix}}/fetch-data-and-report-apis[Data and Report APIs]
23-
** link:{{navprefix}}/spotter-api[Spotter APIs]
24-
*** link:{{navprefix}}/spotter-agent-apis[AI APIs (Spotter Agent and Spotter 3)]
25-
*** link:{{navprefix}}/spotter-apis-classic[AI APIs (Spotter Classic) ^BETA^]
26-
*** link:{{navprefix}}/spotter-coaching-apis[Spotter coaching APIs ^BETA^]
27-
** link:{{navprefix}}/audit-logs[Audit logs]
28-
** link:{{navprefix}}/tml[TML]
29-
** link:{{navprefix}}/collections[Collections ^BETA^]
30-
** link:{{navprefix}}/connections[Connections]
31-
** link:{{navprefix}}/connection-config[Connection configuration]
32-
** link:{{navprefix}}/runtime-sort[Runtime sorting]
15+
* link:{{navprefix}}/api-user-management[Users and group privileges]
16+
* link:{{navprefix}}/rbac[Role-based access control]
17+
* link:{{navprefix}}/rest-apiv2-search[Search API endpoints]
18+
** link:{{navprefix}}/rest-apiv2-users-search[Search users]
19+
** link:{{navprefix}}/rest-apiv2-groups-search[Search groups]
20+
** link:{{navprefix}}/rest-apiv2-metadata-search[Search metadata]
21+
* link:{{navprefix}}/fetch-data-and-report-apis[Data and Report APIs]
22+
* link:{{navprefix}}/spotter-api[Spotter APIs]
23+
** link:{{navprefix}}/spotter-agent-apis[AI APIs (Spotter Agent and Spotter 3)]
24+
** link:{{navprefix}}/spotter-apis-classic[AI APIs (Spotter Classic) ^BETA^]
25+
** link:{{navprefix}}/spotter-coaching-apis[Spotter coaching APIs ^BETA^]
26+
* link:{{navprefix}}/audit-logs[Audit logs]
27+
* link:{{navprefix}}/tml[TML]
28+
* link:{{navprefix}}/collections[Collections ^BETA^]
29+
* link:{{navprefix}}/connections[Connections]
30+
* link:{{navprefix}}/connection-config[Connection configuration]
31+
* link:{{navprefix}}/runtime-sort[Runtime sorting]
3332
3433
3534
[.sidebar-title]

modules/ROOT/pages/runtime-sort.adoc

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,7 @@ If you swap the sort order of these columns, the resulting output changes accord
4949

5050
== Runtime sorting of columns via REST API
5151

52-
You can use the REST API v1 or REST API v2 endpoints to apply runtime sorting parameters.
53-
54-
=== REST API v1
55-
56-
If you are using REST API v1 endpoints, runtime sorts can be applied when fetching a Liveboard or Answer object from ThoughtSpot.
57-
58-
To sort columns when fetching data from a Liveboard object, add sort properties to the Liveboard data API request URL as shown in the example here:
59-
60-
----
61-
http://{ThoughtSpot-host}/callosum/v1/tspublic/v1/pinboarddata?id=e36ee65e-64be-436b-a29a-22d8998c4fae&batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false
62-
----
63-
----
64-
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/pinboarddata?id=e36ee65e-64be-436b-a29a-22d8998c4fae&batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false&sortCol2=Tea
65-
----
66-
67-
To sort columns of an Answer object, add the sort attributes to the search data API request URL as shown in the following examples:
68-
----
69-
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/searchdata?batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false
70-
----
71-
72-
----
73-
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/searchdata?batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false&sortCol2=Tea
74-
----
75-
76-
=== REST API v2.0
77-
78-
The following REST API v2.0 endpoints support applying runtime sort parameters:
52+
The following REST API v2 endpoints support applying runtime sort parameters:
7953

8054
* `POST /api/rest/2.0/report/liveboard`
8155
* `POST /api/rest/2.0/report/answer`
@@ -86,7 +60,7 @@ The following REST API v2.0 endpoints support applying runtime sort parameters:
8660

8761
The following examples show the request body with runtime sort attributes:
8862

89-
.**Answer report**
63+
=== Answer report
9064

9165
[source,cURL]
9266
----
@@ -106,7 +80,7 @@ curl -X POST \
10680
}'
10781
----
10882

109-
.**Liveboard report**
83+
=== Liveboard report
11084

11185
[source,cURL]
11286
----
@@ -127,8 +101,7 @@ curl -X POST \
127101
----
128102

129103

130-
131-
.**Search data**
104+
=== Search data
132105

133106
[source,cURL]
134107
----
@@ -149,7 +122,7 @@ curl -X POST \
149122
}'
150123
----
151124

152-
.**Answer data**
125+
=== Answer data
153126

154127
[source,cURL]
155128
----
@@ -169,7 +142,7 @@ curl -X POST \
169142
}'
170143
----
171144

172-
.**Liveboard data**
145+
=== Liveboard data
173146

174147
[source,cURL]
175148
----
@@ -187,4 +160,26 @@ curl -X POST \
187160
"asc2": false
188161
}
189162
}
190-
----
163+
----
164+
165+
=== REST API v1 (Legacy endpoints)
166+
167+
If you are using REST API v1 endpoints, runtime sorts can be applied when fetching a Liveboard or Answer object from ThoughtSpot.
168+
169+
To sort columns when fetching data from a Liveboard object, add sort properties to the Liveboard data API request URL as shown in the example here:
170+
171+
----
172+
http://{ThoughtSpot-host}/callosum/v1/tspublic/v1/pinboarddata?id=e36ee65e-64be-436b-a29a-22d8998c4fae&batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false
173+
----
174+
----
175+
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/pinboarddata?id=e36ee65e-64be-436b-a29a-22d8998c4fae&batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false&sortCol2=Tea
176+
----
177+
178+
To sort columns of an Answer object, add the sort attributes to the search data API request URL as shown in the following examples:
179+
----
180+
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/searchdata?batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false
181+
----
182+
183+
----
184+
https://{ThoughtSpot-host}/callosum/v1/tspublic/v1/searchdata?batchsize=-1&pagenumber=-1&offset=-1&formattype=COMPACT&sortCol1=Sales&asc1=false&sortCol2=Tea
185+
----

0 commit comments

Comments
 (0)