Manage indexing API tokens.
- Checkdatasourceauth - Check datasource authorization
Returns all datasource instances that require per-user OAuth authorization for the authenticated user, along with a transient auth token that can be appended to auth URLs to complete OAuth flows.
Clients construct the full OAuth URL by combining the backend base URL,
the authUrlRelativePath from each instance, and the transient auth token:
<backend>/<authUrlRelativePath>?transient_auth_token=<token>.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Authentication.Checkdatasourceauth(ctx)
if err != nil {
log.Fatal(err)
}
if res.CheckDatasourceAuthResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CheckdatasourceauthResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |