Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.24 KB

File metadata and controls

63 lines (44 loc) · 2.24 KB

Client.Authentication

Overview

Available Operations

CreateToken

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/*).

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CreateauthtokenResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*