(SubscribersPreferences)
- UpdateGlobal - Update subscriber global preferences
- Update - Update subscriber preference
Update subscriber global preferences
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"github.com/novuhq/novu-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.SubscribersPreferences.UpdateGlobal(ctx, "<id>", components.UpdateSubscriberGlobalPreferencesRequestDto{})
if err != nil {
log.Fatal(err)
}
if res.UpdateSubscriberPreferenceGlobalResponseDto != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
subscriberID |
string | ✔️ | N/A |
updateSubscriberGlobalPreferencesRequestDto |
components.UpdateSubscriberGlobalPreferencesRequestDto | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersControllerUpdateSubscriberGlobalPreferencesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update subscriber preference
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"github.com/novuhq/novu-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.SubscribersPreferences.Update(ctx, "<id>", "<id>", components.UpdateSubscriberPreferenceRequestDto{})
if err != nil {
log.Fatal(err)
}
if res.UpdateSubscriberPreferenceResponseDto != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
subscriberID |
string | ✔️ | N/A |
workflowID |
string | ✔️ | N/A |
updateSubscriberPreferenceRequestDto |
components.UpdateSubscriberPreferenceRequestDto | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersControllerUpdateSubscriberPreferenceResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |