- Retrieve - Get insights
Gets the aggregate usage insights data displayed in the Insights Dashboards.
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.Insights.Retrieve(ctx, components.InsightsRequest{}, nil)
if err != nil {
log.Fatal(err)
}
if res.InsightsResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
insightsRequest |
components.InsightsRequest | ✔️ | Includes request parameters for insights requests. |
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. |
*operations.InsightsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |