Inbox Recipients

An InboxRecipient is a person who has had an inbox shared with them via email invitation.

List Inbox Recipients

SDK Method

inbox_recipient.List()

Return Values

Returns a *inbox_recipient.Iter and an error. Range over All() to receive files_sdk.InboxRecipient values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

Authorization Requirement

Available to all authenticated keys or sessions.

InboxRecipientListParams Fields

FieldDescription
InboxId
int64
Required
List recipients for the inbox with this ID.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    inbox_recipient "github.com/Files-com/files-sdk-go/v3/inboxrecipient"
)

inboxRecipientIterator, err := inbox_recipient.List(files_sdk.InboxRecipientListParams{InboxId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for inboxRecipient, err := range inboxRecipientIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(inboxRecipient)
}

Create Inbox Recipient

SDK Method

inbox_recipient.Create()

Return Values

Returns a files_sdk.InboxRecipient value and an error.

Authorization Requirement

Available to all authenticated keys or sessions.

InboxRecipientCreateParams Fields

FieldDescription
InboxId
int64
Required
Inbox to share.
Recipient
string
Required
Email address to share this inbox 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"
    inbox_recipient "github.com/Files-com/files-sdk-go/v3/inboxrecipient"
)

inboxRecipient, err := inbox_recipient.Create(files_sdk.InboxRecipientCreateParams{
  InboxId: 1,
  Recipient: "johndoe@gmail.com",
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(inboxRecipient)

The InboxRecipient Object

Some of the methods above return a InboxRecipient 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 inbox.
Recipient
string
The recipient's email address.
SentAt
date-time
When the Inbox was shared with this recipient.