import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
thoughtspot: {
type: "app",
app: "thoughtspot",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.thoughtspot.$auth.hostname}/api/rest/2.0/auth/session/user`,
headers: {
Authorization: `Bearer ${this.thoughtspot.$auth.oauth_access_token}`,
},
})
},
})
ThoughtSpot uses OAuth authentication. When you connect your ThoughtSpot account, Pipedream will open a popup window where you can sign into ThoughtSpot and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any ThoughtSpot API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://{{custom_fields.hostname}}/api/rest/2.0/auth/token/full
Accept: application/json
username={{custom_fields.username}}
&
validity_time_in_sec=86400
&
auto_create=false
&
secret_key={{custom_fields.secret_key}}
POST
https://{{custom_fields.hostname}}/api/rest/2.0/auth/token/full
content-type: application/x-www-form-urlencoded
accept: application/json
username={{custom_fields.username}}
&
validity_time_in_sec=86400
&
grant_type=refresh_token
&
auto_create=false
&
secret_key={{custom_fields.secret_key}}