Skip to content

Latest commit

 

History

History
250 lines (191 loc) · 17.9 KB

File metadata and controls

250 lines (191 loc) · 17.9 KB

Envelopes.Items

Overview

Available Operations

CreateMany

Create multiple envelope items for an envelope

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/documenso/sdk-go"
	"github.com/documenso/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
    )

    res, err := s.Envelopes.Items.CreateMany(ctx, operations.EnvelopeItemCreateManyRequest{
        Payload: operations.EnvelopeItemCreateManyPayload{
            EnvelopeID: "<id>",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.EnvelopeItemCreateManyRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.EnvelopeItemCreateManyResponse, error

Errors

Error Type Status Code Content Type
apierrors.EnvelopeItemCreateManyBadRequestError 400 application/json
apierrors.EnvelopeItemCreateManyUnauthorizedError 401 application/json
apierrors.EnvelopeItemCreateManyForbiddenError 403 application/json
apierrors.EnvelopeItemCreateManyInternalServerError 500 application/json
apierrors.APIError 4XX, 5XX */*

UpdateMany

Update multiple envelope items for an envelope

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/documenso/sdk-go"
	"github.com/documenso/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
    )

    res, err := s.Envelopes.Items.UpdateMany(ctx, operations.EnvelopeItemUpdateManyRequest{
        EnvelopeID: "<id>",
        Data: []operations.EnvelopeItemUpdateManyDataRequest{},
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.EnvelopeItemUpdateManyRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.EnvelopeItemUpdateManyResponse, error

Errors

Error Type Status Code Content Type
apierrors.EnvelopeItemUpdateManyBadRequestError 400 application/json
apierrors.EnvelopeItemUpdateManyUnauthorizedError 401 application/json
apierrors.EnvelopeItemUpdateManyForbiddenError 403 application/json
apierrors.EnvelopeItemUpdateManyInternalServerError 500 application/json
apierrors.APIError 4XX, 5XX */*

Delete

Delete an envelope item from an envelope

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/documenso/sdk-go"
	"github.com/documenso/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
    )

    res, err := s.Envelopes.Items.Delete(ctx, operations.EnvelopeItemDeleteRequest{
        EnvelopeID: "<id>",
        EnvelopeItemID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.EnvelopeItemDeleteRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.EnvelopeItemDeleteResponse, error

Errors

Error Type Status Code Content Type
apierrors.EnvelopeItemDeleteBadRequestError 400 application/json
apierrors.EnvelopeItemDeleteUnauthorizedError 401 application/json
apierrors.EnvelopeItemDeleteForbiddenError 403 application/json
apierrors.EnvelopeItemDeleteInternalServerError 500 application/json
apierrors.APIError 4XX, 5XX */*

Download

Download an envelope item by its ID

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/documenso/sdk-go"
	"github.com/documenso/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
    )

    res, err := s.Envelopes.Items.Download(ctx, "<id>", operations.EnvelopeItemDownloadVersionSigned.ToPointer())
    if err != nil {
        log.Fatal(err)
    }
    if res.Any != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
envelopeItemID string ✔️ The ID of the envelope item to download.
version *operations.EnvelopeItemDownloadVersion The version of the envelope item to download. "signed" returns the completed document with signatures, "original" returns the original uploaded document.
opts []operations.Option The options for this request.

Response

*operations.EnvelopeItemDownloadResponse, error

Errors

Error Type Status Code Content Type
apierrors.EnvelopeItemDownloadBadRequestError 400 application/json
apierrors.EnvelopeItemDownloadUnauthorizedError 401 application/json
apierrors.EnvelopeItemDownloadForbiddenError 403 application/json
apierrors.EnvelopeItemDownloadNotFoundError 404 application/json
apierrors.EnvelopeItemDownloadInternalServerError 500 application/json
apierrors.APIError 4XX, 5XX */*