- CreateToken - Create authentication token
Creates an authentication token for the authenticated user. These are specifically intended to be used with the Web SDK.
Note: The tokens generated from this endpoint are not valid tokens
for use with the Client API (e.g. /rest/api/v1/*).
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.Client.Authentication.CreateToken(ctx)
if err != nil {
log.Fatal(err)
}
if res.CreateAuthTokenResponse != 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.CreateauthtokenResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |