Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Commit

Permalink
date format custom calendar update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShashiSubramanya committed Jan 30, 2024
1 parent 3ce35ad commit 903fc19
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 43 deletions.
4 changes: 2 additions & 2 deletions modules/ROOT/pages/common/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ include::generated/typedoc/CustomSideNav.adoc[]
** link:{{navprefix}}/rest-apis[Overview]
** link:{{navprefix}}/api-user-management[Users and group privileges]
** link:{{navprefix}}/rbac[Role-based access control ^Beta^]
** link:{{navprefix}}/rest-api-v2[REST API v2.0]
** link:{{navprefix}}/rest-apiv2-getstarted[REST API v2.0]
*** link:{{navprefix}}/rest-apiv2-getstarted[Get started]
*** link:{{navprefix}}/api-authv2[REST API v2.0 authentication]
*** link:{{navprefix}}/rest-apiv2-js[REST API v2.0 in JavaScript]
Expand All @@ -116,7 +116,7 @@ include::generated/typedoc/CustomSideNav.adoc[]
*** link:{{navprefix}}/fetch-data-and-report-apis[Data and Report APIs]
** link:{{navprefix}}/restV2-playground[REST API v2.0 Reference]
** link:{{navprefix}}/rest-api-v1[REST API v1]
** link:{{navprefix}}/rest-api-getstarted[REST API v1]
*** link:{{navprefix}}/rest-api-getstarted[Get started]
*** link:{{navprefix}}/api-auth-session[REST API v1 authentication]
*** link:{{navprefix}}/catalog-and-audit[Catalog and audit content]
Expand Down
16 changes: 16 additions & 0 deletions modules/ROOT/pages/partials/date-format.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

If Custom Calendar is not enabled on your instance, the API output shows the date and time data in Epoch time format.
----
[694252800,702115200,709974000,717922800,725875200,733651200,741510000,749458800,757411200,765187200,773046000,780994800,788947200,796723200,804582000,812530800,820483200,828345600,836204400,844153200,852105600,859881600,867740400,875689200,883641600,891417600,899276400,907225200]
----
If Custom Calendar is enabled on your instance, the data returned in the API response shows the date and time in the `{"v":{"s":694252800}}` format.
----
[{"v":{"s":694252800}},{"v":{"s":702115200}},{"v":{"s":709974000}},{"v":{"s":717922800}},{"v":{"s":725875200}},{"v":{"s":733651200}},{"v":{"s":741510000}},{"v":{"s":749458800}},{"v":{"s":757411200}},{"v":{"s":765187200}},{"v":{"s":773046000}},{"v":{"s":780994800}},{"v":{"s":788947200}},{"v":{"s":796723200}},{"v":{"s":804582000}},{"v":{"s":812530800}},{"v":{"s":820483200}},{"v":{"s":828345600}},{"v":{"s":836204400}},{"v":{"s":844153200}},{"v":{"s":852105600}},{"v":{"s":859881600}},{"v":{"s":867740400}},{"v":{"s":875689200}},{"v":{"s":883641600}},{"v":{"s":891417600}},{"v":{"s":899276400}},{"v":{"s":907225200}}]
----

* `v` indicates value
* `s` indicates the start date in Epoch time format
* `e` indicates the end date in Epoch time format
If the API implementation in your environment is designed to use the date output in Epoch format, this change may break your current setup.
27 changes: 11 additions & 16 deletions modules/ROOT/pages/rest-api-getstarted.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,23 @@ Note that after you add your host domain for CORS, ThoughtSpot adds the `access-
* You have valid login credentials and access privileges to run the operations.
== Access resource endpoints
== API Explorer

You can access the REST API v1 explorer using one of the following options:

* Using the *REST Playground v1* menu option in the Developer portal (Requires Developer or Administrator privilege)
+
If the REST API Playground feature is enabled on your cluster, go to *Develop* > **REST API **> *REST Playground v1*.
* Using the *REST Playground v1* menu option in the *Develop* page (Requires Developer or Administrator privilege)

+
++++
<a href="{{previewPrefix}}/tspublic/rest/playgroundV1" id="preview-in-playground" target="_blank">Try it out</a>
++++


* Using the Swagger URL
+
----
https://<your-thoughtspot.com>/external/swagger
----
+
++++
<a href="{{tshost}}/external/swagger" id="preview-in-playground" target="_blank"> Try it out</a>
++++
The REST API v1 Explorer displays a list of REST API services available for the logged-in ThoughtSpot users.

+
Expand All @@ -57,17 +51,10 @@ Any completed log-in process will return session cookies from the ThoughtSpot sy

For more information, see xref:api-auth-session.adoc[Authentication].

== Data format

The REST APIs allow you to send and receive data in JSON format.
To embed this data in your application, you can import or extract the data from the JSON file.
You can also use scriptable files in ThoughtSpot Modeling Language (TML) to represent objects in a reusable, editable, and easy-to-read format. ThoughtSpot allows you to export and import these scriptable files using REST APIs.

== API requests and response

To call a REST API, send a request to the endpoint URL with the attributes required to create, view, or modify an object.


=== Request method

Specify the HTTP request method in your API request.
Expand All @@ -79,7 +66,6 @@ Specify the HTTP request method in your API request.

Some endpoints may require you to send a `POST` request for delete or update operation. For more information about the endpoint URIs and request methods, see xref:rest-api-reference.adoc[REST API v1 Reference].


=== Request headers

[width="100%" cols="1,4"]
Expand Down Expand Up @@ -140,6 +126,15 @@ For example, you can use the `/tspublic/v1/metadata/listvizheaders` endpoint to
]
----

=== Data format

The REST APIs allow you to send and receive data in JSON format.
To embed this data in your application, you can import or extract the data from the JSON file.

=== Date format in API response

include::{path}/date-format.adoc[]

=== HTTP status codes

For each API request, ThoughtSpot sends a response. The API returns one of the following response codes upon completing a request operation:
Expand Down
9 changes: 9 additions & 0 deletions modules/ROOT/pages/rest-api-v2-getstarted.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ curl -X POST \
}
----

=== Data format

The REST APIs allow you to send and receive data in JSON format.
To embed this data in your application, you can import or extract the data from the JSON file.

=== API response

A successful API call returns a response body or the 204 response code. The REST API v2.0 framework supports standard HTTP response codes to indicate the status of a request.
Expand Down Expand Up @@ -195,5 +200,9 @@ If an API call returns an error in the Playground, you can view the error detail
[.widthAuto]
image::./images/rest-v2-error.png[REST API v2.0 error codes width=auto]

=== Date format in API response

include::{path}/date-format.adoc[]

== Example libraries
The link:https://github.com/thoughtspot/thoughtspot_rest_api_v1_python[thoughtspot_rest_api_v1 Python library, window=_blank] includes a `TSRestApiV2` class that implements the v2.0 REST API. You can use this as a ready-made implementation for testing back-end REST API calls or as a pattern for implementing your own library in any other programming language.
8 changes: 3 additions & 5 deletions modules/ROOT/pages/rest-api-v2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@ The REST API v2.0 introduces several breaking changes that may affect interopera

We recommend using REST API v2.0 API endpoints for development and testing purposes in the initial release. ThoughtSpot will provide migration instructions when REST API v2.0 framework is fully ready to replace the REST API v1 endpoints in a production setup.



== Feature limitations

* The REST API v2.0 `session/login` endpoint does not return session cookies. However, you can use obtain a bearer token from ThoughtSpot via `/api/rest/2.0/auth/token/full` and use it to authorize your subsequent API requests.
* The following REST API v2.0 endpoints require administrator or data download privilege, and at least view access to the metadata object specified in the API request.
* The following REST API v2.0 endpoints require administrator or data download (`DATADOWNLOADING`) privilege, and at least view access to the metadata object specified in the API request.

** `POST /api/rest/2.0/searchdata`
** `POST /api/rest/2.0/metadata/liveboard/data`
** `POST /api/rest/2.0/metadata/answer/data`
** `POST /api/rest/2.0/report/liveboard`
** `POST /api/rest/2.0/report/answer`

* Object sharing via `/api/rest/2.0/security/metadata/share` requires administrator privileges.
If you have edit permissions or view access to the metadata object, but don't have administrator privileges, use the REST API v1 endpoint (`/tspublic/v1/security/share`) or the *Share* action in the UI to share an object.

== Related information

* xref:rest-api-v2-playground.adoc[REST Playground v2]
Expand Down
20 changes: 0 additions & 20 deletions modules/ROOT/pages/whats-new.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,6 @@ For information about the new features and enhancements introduced in Visual Emb

=== REST API

==== Date format change in the API response

If Custom Calendar is not enabled on your instance, the API output shows the date and time data in Epoch time format.
----
[694252800,702115200,709974000,717922800,725875200,733651200,741510000,749458800,757411200,765187200,773046000,780994800,788947200,796723200,804582000,812530800,820483200,828345600,836204400,844153200,852105600,859881600,867740400,875689200,883641600,891417600,899276400,907225200]
----

If Custom Calendar is enabled on your instance, the data returned in the API response shows the date and time in the `{"v":{"s":694252800}}` format.
----
[{"v":{"s":694252800}},{"v":{"s":702115200}},{"v":{"s":709974000}},{"v":{"s":717922800}},{"v":{"s":725875200}},{"v":{"s":733651200}},{"v":{"s":741510000}},{"v":{"s":749458800}},{"v":{"s":757411200}},{"v":{"s":765187200}},{"v":{"s":773046000}},{"v":{"s":780994800}},{"v":{"s":788947200}},{"v":{"s":796723200}},{"v":{"s":804582000}},{"v":{"s":812530800}},{"v":{"s":820483200}},{"v":{"s":828345600}},{"v":{"s":836204400}},{"v":{"s":844153200}},{"v":{"s":852105600}},{"v":{"s":859881600}},{"v":{"s":867740400}},{"v":{"s":875689200}},{"v":{"s":883641600}},{"v":{"s":891417600}},{"v":{"s":899276400}},{"v":{"s":907225200}}]
----

* `v` indicates value
* `s` indicates the start date in Epoch time format
* `e` indicates the end date in Epoch time format

If the API implementation in your environment is designed to use the date output in Epoch format, this change may break your current setup.

==== Other changes and enhancements

For information about REST API enhancements, see xref:rest-apiv2-changelog.adoc[REST API v2.0 changelog].

== Version 9.7.0.cl
Expand Down

0 comments on commit 903fc19

Please sign in to comment.