Share Groups

A ShareGroup is a way for you to store and name groups of email contacts to be used for sending share and inbox invitations.

List Share Groups

SDK Method

\Files\Model\ShareGroup::list;

Return Object

ShareGroup[]

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.

Additional Arguments

Example Request

try {
  $share_groups = \Files\Model\ShareGroup::list([
    'user_id' => 1
  ]);
  foreach ($share_groups as $share_group) {
    // Operate on $share_group
  }
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Show Share Group

SDK Method

\Files\Model\ShareGroup::find;

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
id
int64
Required
Share Group ID.

Example Request

try {
  $share_group = \Files\Model\ShareGroup::find($id);
  // Operate on $share_group
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Create Share Group

SDK Method

\Files\Model\ShareGroup::create;

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.
notes
string
Additional notes of the share group
name
string
Required
Name of the share group
members
array(object)
Required
A list of share group members.

Example Request

try {
  $share_group = \Files\Model\ShareGroup::create([
    'name' => "Test group 1",
    'members' => [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}]
  ]);
  // Operate on $share_group
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Update Share Group

SDK Method

$share_group->update;

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
notes
string
Additional notes of the share group
name
string
Name of the share group
members
array(object)
A list of share group members.

Example Request

try {
  // Find the share_group object by its id.
  $share_group = \Files\Model\ShareGroup::find(id);
  $share_group->update([
    'notes' => "This group is defined for testing purposes"
  ]);
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

Delete Share Group

SDK Method

$share_group->delete;

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

try {
  // Find the share_group object by its id.
  $share_group = \Files\Model\ShareGroup::find(id);
  $share_group->delete();
} catch (\Files\NotAuthenticated\InvalidUsernameOrPasswordException $e) {
  echo 'Authentication Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
} catch (\Files\FilesException $e) {
  echo 'Unknown Error Occurred (' . get_class($e) . '): ', $e->getMessage(), "\n";
}

The ShareGroup Object

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

AttributeDescription
id
int64
Share Group ID
name
string
Name of the share group
notes
string
Additional notes of the share group
user_id
int64
Owner User ID
members
array(object)
A list of share group members