Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 6.86 KB

README.md

File metadata and controls

111 lines (82 loc) · 6.86 KB

Auth

(Auth)

Overview

Available Operations

GetUnifiedIntegrationAuth

Returns an authorization URL for the specified integration. Once a successful authorization occurs, a new connection is created.

Example Usage

package main

import(
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"context"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"log"
)

func main() {
    s := unifiedgosdk.New()

    ctx := context.Background()
    res, err := s.Auth.GetUnifiedIntegrationAuth(ctx, operations.GetUnifiedIntegrationAuthRequest{
        IntegrationType: "<value>",
        WorkspaceID: "<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.GetUnifiedIntegrationAuthRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetUnifiedIntegrationAuthResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

GetUnifiedIntegrationLogin

Returns an authentication URL for the specified integration. Once a successful authentication occurs, the name and email are returned inside a jwt parameter, which is a JSON web token that is base-64 encoded.

Example Usage

package main

import(
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"context"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"log"
)

func main() {
    s := unifiedgosdk.New()

    ctx := context.Background()
    res, err := s.Auth.GetUnifiedIntegrationLogin(ctx, operations.GetUnifiedIntegrationLoginRequest{
        IntegrationType: "<value>",
        WorkspaceID: "<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.GetUnifiedIntegrationLoginRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetUnifiedIntegrationLoginResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*