Skip to content

Latest commit

 

History

History
executable file
·
510 lines (362 loc) · 33.3 KB

GroupsApi.md

File metadata and controls

executable file
·
510 lines (362 loc) · 33.3 KB

Alfresco\GroupsApi

All URIs are relative to https://localhost/alfresco/api/-default-/public/alfresco/versions/1

Method HTTP request Description
createGroup POST /groups Create a group
createGroupMembership POST /groups/{groupId}/members Create a group membership
deleteGroup DELETE /groups/{groupId} Delete a group
deleteGroupMembership DELETE /groups/{groupId}/members/{groupMemberId} Delete a group membership
getGroup GET /groups/{groupId} Get group details
listGroupMemberships GET /groups/{groupId}/members List memberships of a group
listGroupMembershipsForPerson GET /people/{personId}/groups List group memberships
listGroups GET /groups List groups
updateGroup PUT /groups/{groupId} Update group details

createGroup

\Alfresco\Model\GroupEntry createGroup($group_body_create, $include, $fields)

Create a group

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group. The group id must start with "GROUP\". If this is omitted it will be added automatically. This format is also returned when listing groups or group memberships. It should be noted that the other group-related operations also expect the id to start with "GROUP\". If one or more parentIds are specified then the group will be created and become a member of each of the specified parent groups. If no parentIds are specified then the group will be created as a root group. The group will be created in the APP.DEFAULT and AUTH.ALF zones. You must have admin rights to create a group.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_body_create = new \Alfresco\Model\GroupBodyCreate(); // \Alfresco\Model\GroupBodyCreate | The group to create.
$include = array("include_example"); // string[] | Returns additional information about the group. The following optional fields can be requested: * parentIds * zones
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->createGroup($group_body_create, $include, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->createGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_body_create \Alfresco\Model\GroupBodyCreate The group to create.
include string[] Returns additional information about the group. The following optional fields can be requested: * parentIds * zones [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupEntry

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGroupMembership

\Alfresco\Model\GroupMemberEntry createGroupMembership($group_id, $group_membership_body_create, $fields)

Create a group membership

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Create a group membership (for an existing person or group) within a group groupId. If the added group was previously a root group then it becomes a non-root group since it now has a parent. It is an error to specify an id that does not exist. You must have admin rights to create a group membership.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$group_membership_body_create = new \Alfresco\Model\GroupMembershipBodyCreate(); // \Alfresco\Model\GroupMembershipBodyCreate | The group membership to add (person or sub-group).
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->createGroupMembership($group_id, $group_membership_body_create, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->createGroupMembership: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
group_membership_body_create \Alfresco\Model\GroupMembershipBodyCreate The group membership to add (person or sub-group).
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupMemberEntry

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteGroup

deleteGroup($group_id, $cascade)

Delete a group

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group groupId. The option to cascade delete applies this recursively to any hierarchy of group members. In this case, removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$cascade = false; // bool | If **true** then the delete will be applied in cascade to sub-groups.

try {
    $api_instance->deleteGroup($group_id, $cascade);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->deleteGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
cascade bool If true then the delete will be applied in cascade to sub-groups. [optional] [default to false]

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteGroupMembership

deleteGroupMembership($group_id, $group_member_id)

Delete a group membership

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Delete group member groupMemberId (person or sub-group) from group groupId. Removing a group member does not delete the person or sub-group itself. If a removed sub-group no longer has any parent groups then it becomes a root group. You must have admin rights to delete a group membership.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$group_member_id = "group_member_id_example"; // string | The identifier of a person or group.

try {
    $api_instance->deleteGroupMembership($group_id, $group_member_id);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->deleteGroupMembership: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
group_member_id string The identifier of a person or group.

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroup

\Alfresco\Model\GroupEntry getGroup($group_id, $include, $fields)

Get group details

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Get details for group groupId. You can use the include parameter to return additional information.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$include = array("include_example"); // string[] | Returns additional information about the group. The following optional fields can be requested: * parentIds * zones
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->getGroup($group_id, $include, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->getGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
include string[] Returns additional information about the group. The following optional fields can be requested: * parentIds * zones [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupEntry

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listGroupMemberships

\Alfresco\Model\GroupMemberPaging listGroupMemberships($group_id, $skip_count, $max_items, $order_by, $where, $fields)

List memberships of a group

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of the group memberships for the group groupId. You can use the where parameter to filter the returned groups by memberType. Example to filter by memberType, use any one of: (memberType='GROUP') (memberType='PERSON') The default sort order for the returned list is for group members to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$skip_count = 0; // int | The number of entities that exist in the collection before those included in this list.  If not supplied then the default value is 0.
$max_items = 100; // int | The maximum number of items to return in the list.  If not supplied then the default value is 100.
$order_by = array("order_by_example"); // string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields.  Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order.  To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
$where = "where_example"; // string | A string to restrict the returned objects by using a predicate.
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->listGroupMemberships($group_id, $skip_count, $max_items, $order_by, $where, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->listGroupMemberships: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
skip_count int The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. [optional] [default to 0]
max_items int The maximum number of items to return in the list. If not supplied then the default value is 100. [optional] [default to 100]
order_by string[] A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field. [optional]
where string A string to restrict the returned objects by using a predicate. [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupMemberPaging

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listGroupMembershipsForPerson

\Alfresco\Model\GroupPaging listGroupMembershipsForPerson($person_id, $skip_count, $max_items, $order_by, $include, $where, $fields)

List group memberships

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of group membership information for person personId. You can use the -me- string in place of <personId> to specify the currently authenticated user. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: (isRoot=true) The where parameter can also be used to filter by zone. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the MY.ZONE zone. where=(zones in ('MY.ZONE')) This may be combined with the isRoot filter, as shown below: where=(isRoot=false AND zones in ('MY.ZONE')) Note: restrictions include * AND is the only supported operator when combining isRoot and zones filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * displayName

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$person_id = "person_id_example"; // string | The identifier of a person.
$skip_count = 0; // int | The number of entities that exist in the collection before those included in this list.  If not supplied then the default value is 0.
$max_items = 100; // int | The maximum number of items to return in the list.  If not supplied then the default value is 100.
$order_by = array("order_by_example"); // string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields.  Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order.  To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
$include = array("include_example"); // string[] | Returns additional information about the group. The following optional fields can be requested: * parentIds * zones
$where = "where_example"; // string | A string to restrict the returned objects by using a predicate.
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->listGroupMembershipsForPerson($person_id, $skip_count, $max_items, $order_by, $include, $where, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->listGroupMembershipsForPerson: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
person_id string The identifier of a person.
skip_count int The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. [optional] [default to 0]
max_items int The maximum number of items to return in the list. If not supplied then the default value is 100. [optional] [default to 100]
order_by string[] A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field. [optional]
include string[] Returns additional information about the group. The following optional fields can be requested: * parentIds * zones [optional]
where string A string to restrict the returned objects by using a predicate. [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupPaging

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listGroups

\Alfresco\Model\GroupPaging listGroups($skip_count, $max_items, $order_by, $include, $where, $fields)

List groups

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Gets a list of groups. You can use the include parameter to return additional information. You can use the where parameter to filter the returned groups by isRoot. For example, the following where clause will return just the root groups: (isRoot=true) The where parameter can also be used to filter by zone. This may be combined with isRoot to narrow a result set even further. For example, the following where clause will only return groups belonging to the MY.ZONE zone. where=(zones in ('MY.ZONE')) This may be combined with the isRoot filter, as shown below: where=(isRoot=false AND zones in ('MY.ZONE')) Note: restrictions include * AND is the only supported operator when combining isRoot and zones filters * Only one zone is supported by the filter * The quoted zone name must be placed in parenthesis — a 400 error will result if these are omitted. The default sort order for the returned list is for groups to be sorted by ascending displayName. You can override the default by using the orderBy parameter. You can specify one of the following fields in the orderBy parameter: * id * displayName

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$skip_count = 0; // int | The number of entities that exist in the collection before those included in this list.  If not supplied then the default value is 0.
$max_items = 100; // int | The maximum number of items to return in the list.  If not supplied then the default value is 100.
$order_by = array("order_by_example"); // string[] | A string to control the order of the entities returned in a list. You can use the **orderBy** parameter to sort the list by one or more fields.  Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order.  To sort the entities in a specific order, you can use the **ASC** and **DESC** keywords for any field.
$include = array("include_example"); // string[] | Returns additional information about the group. The following optional fields can be requested: * parentIds * zones
$where = "where_example"; // string | A string to restrict the returned objects by using a predicate.
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->listGroups($skip_count, $max_items, $order_by, $include, $where, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->listGroups: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
skip_count int The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. [optional] [default to 0]
max_items int The maximum number of items to return in the list. If not supplied then the default value is 100. [optional] [default to 100]
order_by string[] A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field. [optional]
include string[] Returns additional information about the group. The following optional fields can be requested: * parentIds * zones [optional]
where string A string to restrict the returned objects by using a predicate. [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupPaging

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGroup

\Alfresco\Model\GroupEntry updateGroup($group_id, $group_body_update, $include, $fields)

Update group details

Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Update details (displayName) for group groupId. You must have admin rights to update a group.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

$api_instance = new Alfresco\Api\GroupsApi();
$group_id = "group_id_example"; // string | The identifier of a group.
$group_body_update = new \Alfresco\Model\GroupBodyUpdate(); // \Alfresco\Model\GroupBodyUpdate | The group information to update.
$include = array("include_example"); // string[] | Returns additional information about the group. The following optional fields can be requested: * parentIds * zones
$fields = array("fields_example"); // string[] | A list of field names.  You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth.  The list applies to a returned individual entity or entries within a collection.  If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.

try {
    $result = $api_instance->updateGroup($group_id, $group_body_update, $include, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GroupsApi->updateGroup: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
group_id string The identifier of a group.
group_body_update \Alfresco\Model\GroupBodyUpdate The group information to update.
include string[] Returns additional information about the group. The following optional fields can be requested: * parentIds * zones [optional]
fields string[] A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. [optional]

Return type

\Alfresco\Model\GroupEntry

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]