- RotateToken - Rotate token
Rotates the secret value inside the Indexing API token and returns the new raw secret. All other properties of the token are unchanged. In order to rotate the secret value, include the token as the bearer token in the /rotatetoken request. Please refer to Token rotation documentation for more information.
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.Indexing.Authentication.RotateToken(ctx)
if err != nil {
log.Fatal(err)
}
if res.RotateTokenResponse != 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.PostAPIIndexV1RotatetokenResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |