(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_SECRET_KEY")),
)
res, err := s.Subscribers.Authentication.OauthCallback(ctx, operations.SubscribersV1ControllerChatOauthCallbackRequest{
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.SubscribersV1ControllerChatOauthCallbackRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersV1ControllerChatOauthCallbackResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 414 | application/json |
apierrors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.ErrorDto | 500 | 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_SECRET_KEY")),
)
res, err := s.Subscribers.Authentication.ChatAccessOauth(ctx, operations.SubscribersV1ControllerChatAccessOauthRequest{
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.SubscribersV1ControllerChatAccessOauthRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.SubscribersV1ControllerChatAccessOauthResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorDto | 414 | application/json |
apierrors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
apierrors.ValidationErrorDto | 422 | application/json |
apierrors.ErrorDto | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |