PHPackages                             interworks/thoughtspotrest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. interworks/thoughtspotrest

ActiveLibrary[API Development](/categories/api)

interworks/thoughtspotrest
==========================

This package allows simple REST API communication with your ThoughtSpot cluster.

v0.0.4(1y ago)18MITPHPPHP ^8.2

Since Oct 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/InterWorks/ThoughtSpotREST)[ Packagist](https://packagist.org/packages/interworks/thoughtspotrest)[ RSS](/packages/interworks-thoughtspotrest/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

ThoughtSpot REST API for Laravel
================================

[](#thoughtspot-rest-api-for-laravel)

[![GitHub Workflow Status (Pest)](https://camo.githubusercontent.com/be1d4efdc9c91de12d0ba4738ef875b6b8247bd1db04c611691d1e2e4c9d4dc1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f496e746572576f726b732f54686f7567687453706f74524553542f706573742e796d6c3f6272616e63683d6d61696e266c6162656c3d50657374267374796c653d726f756e642d737175617265)](https://github.com/InterWorks/ThoughtSpotREST/actions)[![GitHub Workflow Status (PHPStan)](https://camo.githubusercontent.com/e6faf78cafa47c40bc9016edac616bc128ab7d23cf9922a6ac24c01c1db953ae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f496e746572576f726b732f54686f7567687453706f74524553542f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d5048505374616e267374796c653d726f756e642d737175617265)](https://github.com/InterWorks/ThoughtSpotREST/actions)[![Latest Version](https://camo.githubusercontent.com/95ee9b4bc0d30d42f8041778a56ba3fc3e32e99037f51a88d7bb39f17d92fda6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f496e746572576f726b732f54686f7567687453706f7452455354)](https://packagist.org/packages/InterWorks/ThoughtSpotREST)[![License](https://camo.githubusercontent.com/ed015def7e8333ae96dbbc5248ebda7b62b18d60198f44af5023d6fe5ebc8bee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f496e746572576f726b732f54686f7567687453706f7452455354)](https://packagist.org/packages/InterWorks/ThoughtSpotREST)

This is a simple API for calling REST API's against your ThoughtSpot cluster. It handles authentication for you so install, add the environment variables, and start making REST API calls!

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

Requires PHP &gt;= 8.2.

```
composer require interworks/thoughtspotrest
```

Next, add the following required environment variables to your .env file:

```
THOUGHTSPOT_REST_URL="https://YOUR-ORG.thoughtspot.cloud"
THOUGHTSPOT_REST_USERNAME="YOUR_USER"
```

Then, depending on your desired authentication, add these:

"Basic" authentication:

```
THOUGHTSPOT_REST_AUTH_TYPE="basic"
THOUGHTSPOT_REST_PASSWORD="YOUR_USER_PASSWORD"
```

"Trusted" authentication:

```
THOUGHTSPOT_REST_AUTH_TYPE="trusted"
THOUGHTSPOT_REST_SECRET_KEY="123abc-..."
```

"Cookie" authentication:

```
THOUGHTSPOT_REST_AUTH_TYPE="cookie"
THOUGHTSPOT_REST_PASSWORD="YOUR_USER_PASSWORD"
```

For more information on ThoughtSpot REST API authentication options, view their doc [here](https://developers.thoughtspot.com/docs/api-authv2).

### Documentation

[](#documentation)

Every REST API call in ThoughtSpot's documentation has a function to call it with the same name in camel case. For instance, the "Search Metadata" API call can be called with:

```
$ts->searchMetadata($args);
```

ThoughtSpot's REST API documentation can be found [here](https://developers.thoughtspot.com/docs/restV2-playground?apiResourceId=http/getting-started/introduction).

Usage Guide
-----------

[](#usage-guide)

### Basic Usage

[](#basic-usage)

Instantiate a ThoughtSpotREST object and start making calls!

```
use InterWorks\ThoughtSpotREST\ThoughtSpotREST;

// Instantiate
$ts = new ThoughtSpotREST();

// Get first 10 Liveboards and create a collection.
$liveboards = $ts->searchMetadata(['metadata' => ['type' => 'LIVEBOARD'], 'record_size' => 10]);
$liveboards = collect($liveboards);

// Get a user by name and update it
$users  = $ts->searchUsers(['user_identifier' => 'jlyons', 'record_size' => 1]);
$user   = collect($users)->first();
$userID = $user['id'];
$ts->updateUser($userID, ['email' => 'justin.lyons@interworks.com']);
```

### Unsupported Endpoints

[](#unsupported-endpoints)

If there's an endpoint missed, you can use the `call` function to specify the URL, arguments, and method. The function returns a `Illuminate\Http\Client\Response` object.

```
$response = $ts->call(
    url   : 'metadata/search',
    args  : ['metadata' => ['type' => 'LIVEBOARD'], 'record_size' => 10],
    method: 'POST'
);
$response->json();
```

### Function Return Type Options

[](#function-return-type-options)

By default, either an array or boolean will be returned depending on the endpoint. If you'd like more control over how the response is processed, you can set `returnResponseObject` to `true` in the constructor to always receive the `Illuminate\Http\Client\Response` object.

```
$ts         = new ThoughtSpotREST(returnResponseObject: true);
$response   = $ts->searchMetadata(['metadata' => ['type' => 'LIVEBOARD'], 'record_size' => 10]);
$success    = $response->successful();
$body       = $response->body();
$liveboards = $response->json();
```

License
-------

[](#license)

This package is released under the MIT License. See [`LICENSE`](LICENSE) for details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

565d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a346b89670993cca37dec5d11f65a692f3aed9dae9c8488bdbf6b4e6be26d8ad?d=identicon)[jplcodes](/maintainers/jplcodes)

---

Top Contributors

[![jplcodes](https://avatars.githubusercontent.com/u/16199260?v=4)](https://github.com/jplcodes "jplcodes (1 commits)")

---

Tags

lib

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/interworks-thoughtspotrest/health.svg)

```
[![Health](https://phpackages.com/badges/interworks-thoughtspotrest/health.svg)](https://phpackages.com/packages/interworks-thoughtspotrest)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
