Groups

Sometimes it's convenient to share requests for signatures among the members of a group. For example, it might be convenient to treat the pharmacists in a particular pharmacy as a group, so that any available member of the group can sign the paperwork for a patient's prescriptions.

Managing Groups

Introduction

Sometimes it's convenient to share requests for signatures among the members of a group. For example, it might be convenient to treat the pharmacists in a particular pharmacy as a group, so that any available member of the group can sign the paperwork for a patient's prescriptions.

In ValidSign, a Signer Group is a set of ValidSign users who can act as a single signer from the point of view of the package creator. Users who can become group members must already be members of the associated ValidSign account.

ValidSign group members receive an email invitation to sign a related document package. Among those members, signing is on a first-come, first-serve basis. When one member is signing, all other members are locked out.

Any member who signs does so on behalf of the group, but their name will be stamped on the documents they sign. Anyone verifying the document through the Audit Trail will see the individual member's signature information and identity.

All group members can monitor the progress of the group's transactions, which helps ensure that those transactions are completed on time.

Creating Groups

The sample code below will create a group with two members. It is important to note that these members have to be Senders in your account.

POST /api/groups

{
  "email": "your_group_email@example.com",
  "name": "your_group_name",
  "members": [
    {
      "pending": true,
      "email": "john_doe@example.com",
      "memberType": "REGULAR",
      "firstName": "John",
      "lastName": "Doe"
    },
    {
      "pending": true,
      "email": "walter_white@example.com",
      "memberType": "REGULAR",
      "firstName": "Walter",
      "lastName": "White"
    }
  ]
}
Group group1 = GroupBuilder.newGroup( "your_group_name" )
.withEmail( "your_group_email@example.com" )
.withIndividualMemberEmailing()
.withMember( GroupMemberBuilder.newGroupMember( "john_doe@example.com" )
    .as( GroupMemberType.REGULAR ) )
.withMember( GroupMemberBuilder.newGroupMember( "walter_white@example.com" )
    .as( GroupMemberType.REGULAR ) )
.build();

Group createdGroup1 = eslClient.getGroupService().createGroup( group1 );
Group group1 = GroupBuilder.NewGroup("your_group_name")
.WithCustomId(new GroupId(Guid.NewGuid().ToString()))
.WithMember(GroupMemberBuilder.NewGroupMember("john_doe@example.com")
    .AsMemberType(GroupMemberType.MANAGER))
.WithMember(GroupMemberBuilder.NewGroupMember("walter_white@example.com")
    .AsMemberType(GroupMemberType.REGULAR))
.WithEmail("your_group_email@example.com")
.WithIndividualMemberEmailing()
.Build()
Retrieving Groups

Retrieving your groups can come in handy when you wish to invite members to your group. It is important to note that the group id is required when sending invitations.

GET /api/groups
List allGroups = esl.getGroupService().getMyGroups();

for ( Group group : allGroups ) {
     System.out.println( group.getName() + " with email " + group.getEmail() + " and id " + group.getId() );
     List allMembers = esl.getGroupService().getGroupMembers( group.getId() );
     for ( GroupMember member : allMembers ) {
          System.out.println( member.getGroupMemberType().toString() + " " + member.getFirstName() + " " + member.getLastName() + " with email " + member.getEmail());
     }
}
List allGroups = eslClient.GroupService.GetMyGroups();

foreach (Group group in allGroups)
{
    Debug.WriteLine(group.Name + " with email " + group.Email + " and id " + group.Id.Id);
    List allMembers = eslClient.GroupService.GetGroupMembers(group.Id);
    foreach (GroupMember member in allMembers)
    {
        Debug.WriteLine(member.GroupMemberType.ToString() + " " + member.FirstName + " " + member.LastName + " with email " + member.Email);
    }
}
Adding a Group Signer

Once your group has been created, you can now then add a group signer to your package. The code below shows you how to edit the signer block in order to add a group signer.

POST /api/packages

{
  "roles": [
    {
      "id": "Signer1",
      "type": "SIGNER",
      "index": 0,
      "signers": [
        {
          "group": {
            "id": "540b86f9-2d93-4498-bdb4-b7b320540bb6",
            "email": "your_group_email@example.com",
            "name": "your_group_name"
          },
          "email": "your_group_email@example.com",
          "firstName": "your_group_name",
          "lastName": ""
        }
      ],
      "name": "Signer1"
    }
  ]
}
DocumentPackage documentPackage = newPackageNamed( "My Example Package" )

.withSigner( SignerBuilder.newSignerFromGroup( myGroup.getId() )
  .canChangeSigner()
  .deliverSignedDocumentsByEmail() )
.withDocument(newDocumentWithName("Example Document")
   .fromFile("your_file_path")
   .withExtractionType(ExtractionType.TEXT_TAGS)
   .enableExtraction())
.build();
              
PackageId packageId = esl.createAndSendPackage(documentPackage);
DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Example Package")
.WithSigner(SignerBuilder.NewSignerFromGroup(myGroup.Id)
  .CanChangeSigner()
  .DeliverSignedDocumentsByEmail())
.WithDocument(DocumentBuilder.NewDocumentNamed("Example Document")
   .FromStream(fs, DocumentType.PDF)
   .WithExtractionType(ExtractionType.TEXT_TAGS)
   .EnableExtraction())
.Build();
 
PackageId packageId = eslClient.CreateAndSendPackage(documentPackage);