Replaces all the currently indexed shortcuts using paginated batch API calls. Note that this endpoint is used for indexing shortcuts not hosted by Glean. If you want to upload shortcuts that would be hosted by Glean, please use the /uploadshortcuts endpoint. For information on what you can do with Golinks, which are Glean-hosted shortcuts, please refer to this page.
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.Indexing.Shortcuts.BulkIndex(ctx, components.BulkIndexShortcutsRequest{
UploadID: "<id>",
Shortcuts: []components.ExternalShortcut{
components.ExternalShortcut{
InputAlias: "<value>",
DestinationURL: "https://plump-tune-up.biz/",
CreatedBy: "<value>",
IntermediateURL: "https://lean-sightseeing.net",
},
components.ExternalShortcut{
InputAlias: "<value>",
DestinationURL: "https://plump-tune-up.biz/",
CreatedBy: "<value>",
IntermediateURL: "https://lean-sightseeing.net",
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.BulkIndexShortcutsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1BulkindexshortcutsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Creates glean shortcuts for uploaded shortcuts info. Glean would host the shortcuts, and they can be managed in the knowledge tab once uploaded.
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.Indexing.Shortcuts.Upload(ctx, components.UploadShortcutsRequest{
UploadID: "<id>",
Shortcuts: []components.IndexingShortcut{
components.IndexingShortcut{
InputAlias: "<value>",
DestinationURL: "https://majestic-pharmacopoeia.info/",
CreatedBy: "<value>",
},
components.IndexingShortcut{
InputAlias: "<value>",
DestinationURL: "https://majestic-pharmacopoeia.info/",
CreatedBy: "<value>",
},
components.IndexingShortcut{
InputAlias: "<value>",
DestinationURL: "https://majestic-pharmacopoeia.info/",
CreatedBy: "<value>",
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.UploadShortcutsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1UploadshortcutsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |