Skip to content

Latest commit

 

History

History
128 lines (97 loc) · 8.1 KB

README.md

File metadata and controls

128 lines (97 loc) · 8.1 KB

Authentication

(Subscribers.Authentication)

Overview

Available Operations

OauthCallback

Handle providers oauth redirect

Example Usage

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
    }
}

Parameters

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.

Response

*operations.SubscribersControllerChatOauthCallbackResponse, error

Errors

Error Type Status Code Content Type
apierrors.ErrorDto 400, 404, 409 application/json
apierrors.ValidationErrorDto 422 application/json
apierrors.APIError 4XX, 5XX */*

ChatAccessOauth

Handle chat oauth

Example Usage

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
    }
}

Parameters

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.

Response

*operations.SubscribersControllerChatAccessOauthResponse, error

Errors

Error Type Status Code Content Type
apierrors.ErrorDto 400, 404, 409 application/json
apierrors.ValidationErrorDto 422 application/json
apierrors.APIError 4XX, 5XX */*