Skip to main content

Python client library for RESTAPI SDK

Project description

Getting Started with RESTAPI SDK

Install the Rest API SDK

You must have Python 3 >=3.7, <= 3.9 installed on your system to use this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc. These dependencies are defined in the requirements.txt file that comes with the SDK. To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps at https://pip.pypa.io/en/stable/installing/.

Python and PIP executables should be defined in your PATH. Open command prompt and type pip --version. This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.

To install the dependencies create requirements.txt with content thoughtspot-rest-api-sdk, run the command echo thoughtspot-rest-api-sdk > requirements.txt. Next, run the command pip install -r requirements.txt. This should install all the required dependencies.

To install the SDK, run the command pip install thoughtspot-rest-api-sdk at the command line.

Initialize the API Client

Note: Documentation for the client can be found here.

The following parameters are configurable for the API Client:

Parameter Type Description
content_type string body content type for post request
Default: 'application/json'
accept_language string response format
Default: 'application/json'
access_token string The OAuth 2.0 Access Token to use for API requests.
base_url string Default: 'https://localhost:443'
environment Environment The API environment.
Default: Environment.PRODUCTION
http_client_instance HttpClient The Http Client passed from the sdk user for making requests
override_http_client_configuration bool The value which determines to override properties of the passed Http Client from the sdk user
timeout float The value to use for connection timeout.
Default: 60
max_retries int The number of times to retry an endpoint call if it fails.
Default: 0
backoff_factor float A backoff factor to apply between attempts after the second try.
Default: 2
retry_statuses Array of int The http statuses on which retry is to be done.
Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]
retry_methods Array of string The http methods on which retry is to be done.
Default: ['GET', 'PUT', 'GET', 'PUT']

The API client can be initialized as follows:

from restapisdk.restapisdk_client import RestapisdkClient
from restapisdk.configuration import Environment

client = RestapisdkClient(
    content_type='application/json',
    accept_language='application/json',
    access_token='AccessToken',
    environment=Environment.PRODUCTION,
    base_url = 'https://localhost:443',)

Authorization

This API uses OAuth 2 Bearer token.

Guide

API Reference

Live Playground

We recommend that you browse through the code playground before you start constructing your API requests. The playground offers an interactive portal with comprehensive information about the API endpoints, request and response workflows.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restapisdk-2.0.0.tar.gz (65.6 kB view details)

Uploaded Source

File details

Details for the file restapisdk-2.0.0.tar.gz.

File metadata

  • Download URL: restapisdk-2.0.0.tar.gz
  • Upload date:
  • Size: 65.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

File hashes

Hashes for restapisdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a16b143e5060766ee79c820ef6a89d055eb165d8c276724be1574b4e654f8de4
MD5 34c4ef69d35964233386ec505c2ee856
BLAKE2b-256 7890031dd7352cf308f3eaf7e4266dfc54f6a159f7783e2f646c8cfd200174b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page