(Notifications.Stats)
Get notification statistics
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.Notifications.Stats.Get(ctx)
if err != nil {
log.Fatal(err)
}
if res.ActivityStatsResponseDto != 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.NotificationsControllerGetActivityStatsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Get notification graph statistics
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.Notifications.Stats.GetGraph(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.ActivityGraphStatesResponses != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
days |
*float64 | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.NotificationsControllerGetActivityGraphStatsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |