(Subscribers.Authentication)
- OauthCallback - Handle providers oauth redirect
- ChatAccessOauth - Handle chat oauth
Handle providers oauth redirect
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"github.com/novuhq/novu-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.Subscribers.Authentication.OauthCallback(ctx, operations.SubscribersControllerChatOauthCallbackRequest{
SubscriberID: "<id>",
ProviderID: "<id>",
HmacHash: "<value>",
EnvironmentID: "<id>",
Code: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.Res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.SubscribersControllerChatOauthCallbackRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersControllerChatOauthCallbackResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Handle chat oauth
package main
import(
"context"
"os"
novugo "github.com/novuhq/novu-go"
"github.com/novuhq/novu-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := novugo.New(
novugo.WithSecurity(os.Getenv("NOVU_API_KEY")),
)
res, err := s.Subscribers.Authentication.ChatAccessOauth(ctx, operations.SubscribersControllerChatAccessOauthRequest{
SubscriberID: "<id>",
ProviderID: "<id>",
HmacHash: "<value>",
EnvironmentID: "<id>",
})
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 |
operations.SubscribersControllerChatAccessOauthRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersControllerChatAccessOauthResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 400, 404, 409 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.APIError | 4XX, 5XX | */* |