Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 4.34 KB

casefile.md

File metadata and controls

93 lines (73 loc) · 4.34 KB

Case files

The case file object is a container used to bundle documents and signers. Every signing process starts with a case file.

Creating a new case file

Creating a case file is dead simple:

// Create a new case file object
var myCaseFile = new CaseFile("My brand new case file");

// Finally, persist the object
myCaseFile.Persist();

Sending a case file out for signing

When the case file contains the relevant documents and signers, it has to be "send out for signing" before the signing process can begin. This is accomplished by calling the send() method on the case file object. You can delay the sending by setting the SendAt time using the SendAt property on the case file object. This method takes a DateTime object as parameter.

If you want to distribute the signing links yourself, use the Activate() method instead to activate the case file signing links.

Once the case file has been sent or activated, documents and signers can no longer be added or removed.

Setting an expiry time on a case file

A case file can be set to expire using the ExpireAt property on the object. When a case file is expired, the signers can no longer sign the case file documents. The ExpireAt property takes a DateTime object.

Retrieve existing case files

There is several ways to retrieve case files from Penneo. Available methods for retrieving case files are:

  • Query.Find(int id) Find one specific case file by its ID.
  • Query.FindAll Find all case files accessible by the authenticated user.
  • Query.FindBy(Dictionary<string, object> criteria = null, Dictionary<string, string> orderBy = null, int? limit = null, int? offset = null) Find all case files matching criteria ordered by orderBy. If limit is set, only limit results are returned. If offset is set, the offset first results are skipped. Criteria can either be title or metaData.
  • Query.FindOneBy(Dictionary<string, object> criteria = null, Dictionary<string, string> orderBy = null) Same as FindBy setting limit = 1 and offset = null

Below is a couple of examples:

// Retrieve all case files
var myCaseFiles = Query.FindAll<CaseFile>();

// Retrieve a specific case file (by id)
var myCaseFile = Query.Find<CaseFile>(271184);

// Retrieve all case files that contains the word "the" in their title and sort descending on creation date
var myCaseFiles = Query.FindByTitle<CaseFile>(
	"the",
	orderBy: new Dictionary<string, string>(){ {"created", "desc" } }	
);

// Retrieve case files from offset 10 until 110 ordered by title in ascending order
var myCaseFiles = Query.FindBy<CaseFile>(	
	orderBy: new Dictionary<string, string>(){ {"title", "asc" } },
	limit: 10,
	offset: 100
);

Deleting a case file

A case file can be completely deleted from Penneos document store as long as it is in the new state. As soon as it is send out, a delete request will only cause its status to be changed to deleted. A case file is deleted like so:

// Delete case file
myCaseFile.Delete();

Retrieving linked objects

A case file contains both signer and document objects. These objects can be retrieved using the following methods:

  • GetDocuments() Returns the documents linked to the case file as an array of document objects.
  • GetSigners() Returns the signers linked to the case file as an array of signer objects.
  • FindSigner(int id) Find and return a specific signer by id.

State variables

A series state variables are used to describe the case file state over the course of its life time. The methods for retrieving the state variables are described below:

  • GetStatus() Returns the status of the case file as a string. Possible status values are:
  • New: The case file hasn't been sent out for signing yet
  • Pending: The case file is out for signing
  • Rejected: One of the signers has rejected to sign
  • Deleted: The case file has been out for signing but have since been deleted
  • Signed: The case file is signed, but the signed documents are not generated
  • Completed: The signing process is completed
  • Created Returns the date and time the case file was created as a DateTime object
  • SignIteration Returns the current sign iteration. This is only relevant if the signing process is not parallel. In that case, the signing process is broken into iterations.