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.

Method Arguments

ArgumentDescription
inbox_id
int64
Required
List recipients for the inbox with this ID.

Additional Arguments

Example Request

import InboxRecipient from 'files.com/lib/models/InboxRecipient';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const inboxRecipients = await InboxRecipient.list({
    inbox_id: 1,
  });
  for (const inboxRecipient of inboxRecipients) {
    // Operate on inboxRecipient
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Create Inbox Recipient

SDK Method

InboxRecipient.create()

Return Object

InboxRecipient

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
inbox_id
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.
share_after_create
boolean
Set to true to share the link with the recipient upon creation.

Example Request

import InboxRecipient from 'files.com/lib/models/InboxRecipient';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const inboxRecipient = await InboxRecipient.create({
    inbox_id: 1,
    recipient: "johndoe@gmail.com",
  });
  // Operate on inboxRecipient
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

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.
sent_at
date-time
When the Inbox was shared with this recipient.