Usage
Use ManageUserGroup to update User records based on the provided action.
Basic Steps
-
Determine the IDs of the users you want to update. For example, you might call Search to retrieve a set of User IDs you want to update. If you store the Cvent IDs for your User records within your database, you can use these IDs to update the desired users.
-
Construct an ID array and populate it with the IDs of each User record you want to update.
-
Optionally, specify the MessageId if you need to track the result of each record. Message IDs can represent unique identifiers from your system. Message IDs will be returned as Reference IDs in the result array for your tracking purposes.
-
Call ManageUserGroup, passing in the ID array, the action you want to take on the Users and the User Group ID.
NoteThe “Remove” action removes users from the group and does not delete the user group itself.
-
Process the results in the ManageUserGroup object to verify whether the objects have been successfully updated.
General Syntax
ManageUserGroupResultArray = cventapi.ManageUserGroup (ManageGroupAction Action, ID GroupId, CvObjectArray CvObjects)
Input
Name | Type | Description |
---|---|---|
Action | Manage Group Action | The action being taken on the objects. Valid actions: Add and Remove. |
GroupId | ID | The ID of the Group you are adding or removing objects to or from. |
CvObjects | CvObject Array | Array of one or more CvObject, which contains object IDs to be updated, and optionally MessageIds which will be returned as ReferenceIds. |
Output
Name | Type | Description |
---|---|---|
Id | ID | ID of the user that you attempted to update. |
ReferenceId | ID | The MessageId value in the input CvObject. |
Success | Boolean | Indicates whether the ManageUserGroup call succeeded (True) or not (False) for this user. |
Errors | Error Array | If an error occurred during the Create call, an array of one or more Error objects providing the error code and description. |
Notes
Take into account the following notes when using the ManageUserGroup call:
- Maximum Number of Users Updated: You can update up to 200 individual users in a single ManageUsersGroupMembers call. If the ManageUsersGroupMembers request exceeds 200 users, then the entire operation fails.
Validation Rules
The following validation rules should be applied to the ManageUserGroup call:
Validation Rule | Description |
---|---|
Actions | Valid actions are Add and Remove. For the Add action to succeed, the user must not already be a member of the specified user group. For the Remove action to succeed, the user must already be a member of the specified user group. |
Uniqueness | Based on ID, only the first instance of a user in the array will update the User record. All subsequent instances will return an error message. |