Inbox Recipients

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

List Inbox Recipients

SDK Method

inboxrecipient.List()

Return Object

[]*InboxRecipient

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.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for inboxRecipientIterator.Next() {
    inboxRecipient := inboxRecipientIterator.inboxRecipient()
}
err = inboxRecipientIterator.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())
    }
}

Create Inbox Recipient

SDK Method

inboxrecipient.Create()

Return Object

InboxRecipient

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.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

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.