Skip to content

Latest commit

 

History

History
174 lines (129 loc) · 17.4 KB

File metadata and controls

174 lines (129 loc) · 17.4 KB

Client.Verification

Overview

Available Operations

AddReminder

Creates a verification reminder for the document. Users can create verification reminders from different product surfaces.

Example Usage

package main

import(
	"context"
	"os"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := apiclientgo.New(
        apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
    )

    res, err := s.Client.Verification.AddReminder(ctx, components.ReminderRequest{
        DocumentID: "<id>",
    }, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.Verification != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
reminderRequest components.ReminderRequest ✔️ Details about the reminder.
locale *string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
opts []operations.Option The options for this request.

Response

*operations.AddverificationreminderResponse, error

Errors

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

List

Returns the information to be rendered in verification dashboard. Includes information for each document owned by user regarding their verifications.

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.Verification.List(ctx, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.VerificationFeed != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
count *int64 Maximum number of documents to return
locale *string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
opts []operations.Option The options for this request.

Response

*operations.ListverificationsResponse, error

Errors

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

Verify

Verify documents to keep the knowledge up to date within customer corpus.

Example Usage

package main

import(
	"context"
	"os"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := apiclientgo.New(
        apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
    )

    res, err := s.Client.Verification.Verify(ctx, components.VerifyRequest{
        DocumentID: "<id>",
    }, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.Verification != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
verifyRequest components.VerifyRequest ✔️ Details about the verification request.
locale *string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
opts []operations.Option The options for this request.

Response

*operations.VerifyResponse, error

Errors

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