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 Function

ShareGroup.list()

Return Object

ListIterator<ShareGroup>

Authorization Requirement

Available to all authenticated keys or sessions.

Function Arguments

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

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ShareGroup;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("user_id", 1);
  
  ListIterator<ShareGroup> shareGroups = ShareGroup.list(parameters);
  for (ShareGroup shareGroup : shareGroups.listAutoPaging()) {
    // Operate on shareGroup
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Share Group

SDK Function

ShareGroup.find()

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Function Arguments

ArgumentDescription
id
int64
Required
Share Group ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ShareGroup;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ShareGroup shareGroup = ShareGroup.find(id, parameters);
  // Operate on shareGroup
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create Share Group

SDK Function

ShareGroup.create()

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Function 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

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ShareGroup;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Test group 1");
  parameters.put("members", [{"name" => "John Doe", "company" => "Acme Ltd", "email" => "johndoe@gmail.com"}]);
  
  ShareGroup shareGroup = ShareGroup.create(parameters);
  // Operate on shareGroup
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update Share Group

SDK Function

shareGroup.update();

Return Object

ShareGroup

Authorization Requirement

Available to all authenticated keys or sessions.

Attribute Setters

SetterDescription
setNotes
string
Additional notes of the share group
setName
string
Name of the share group
setMembers
array(object)
A list of share group members.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ShareGroup;

try {
  // Find the shareGroup object by its id.
  ShareGroup shareGroup = ShareGroup.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("notes", "This group is defined for testing purposes");
  shareGroup.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete Share Group

SDK Function

shareGroup.delete();

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ShareGroup;

try {
  // Find the shareGroup object by its id.
  ShareGroup shareGroup = ShareGroup.find(id, null);
  shareGroup.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The ShareGroup Object

Some of the functions 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