Bundle Recipients

A BundleRecipient is a person who has had a bundle shared with them via email invite. A Bundle can be re-shared with a Bundle Recipient by sending a create request with the inbox_id, recipient email address, and share_after_create => true.

SDK Method

bundlerecipient.List()

Return Object

[]*BundleRecipient

Authorization Requirement

Available to all authenticated keys or sessions.

BundleRecipientListParams Fields

FieldDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.
BundleId
int64
Required
List recipients for the bundle with this ID.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    bundle_recipient "github.com/Files-com/files-sdk-go/v3/bundlerecipient"
)

bundleRecipientIterator, err := bundle_recipient.List(files_sdk.BundleRecipientListParams{BundleId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for bundleRecipientIterator.Next() {
    bundleRecipient := bundleRecipientIterator.bundleRecipient()
}
err = bundleRecipientIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

SDK Method

bundlerecipient.Create()

Return Object

BundleRecipient

Authorization Requirement

Available to all authenticated keys or sessions.

BundleRecipientCreateParams Fields

FieldDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.
BundleId
int64
Required
Bundle to share.
Recipient
string
Required
Email addresses to share this bundle with.
Name
string
Name of recipient.
Company
string
Company of recipient.
Note
string
Note to include in email.
ShareAfterCreate
boolean
Set to true to share the link with the recipient upon creation.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    bundle_recipient "github.com/Files-com/files-sdk-go/v3/bundlerecipient"
)

bundleRecipient, err := bundle_recipient.Create(files_sdk.BundleRecipientCreateParams{
  BundleId: 1,
  Recipient: "johndoe@gmail.com"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The BundleRecipient Object

Some of the methods above return a BundleRecipient object. The attributes of this object are listed below.

AttributeDescription
Company
string
The recipient's company.
Name
string
The recipient's name.
Note
string
A note sent to the recipient with the bundle.
Recipient
string
The recipient's email address.
SentAt
date-time
When the Bundle was shared with this recipient.
WorkspaceId
int64
Workspace ID. 0 means the default workspace.