Contract
3. Contract
All contract-related feature sets are available under Contract
class. There are three primary functions under this class.
3.1. generate
This function provides consumers to generate documents using templates and transaction data.
Declaration
public JObject generate(string templateId, string format = "PDF", string transactionId = "",
Hashtable? fillData = null)
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.string - [In] | templateId | Document template id against which the document is to be generated with real-time values. |
System.string - [In] | format | Document output format parameter. If left out, these parameters will be set to PDF. |
System.string - [In] | transactionId | Transaction Id against which the document is to be generated. The function will retrieve data based on the provided transactionId. The function will use the BLANK value if the parameter is left out during execution. |
System.Collections.Hashtable - [In] | fillData | This collection contains additional custom data that must be appended to the document. This is passed in the Key-Value pair. The function will use the BLANK value if the parameter is left out during execution. |
JObject - [Out] | N/A | The entire verification object is streamed into resp named parameter and returned. |
3.2. listTemplate
The List Template function retrieves a list of contract templates based on the provided filters.
Declaration
public JObject listTemplate(int order = -1, int limit = 10, int offset = 0, string filterTemplateId = "")
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.integer - [In] | order | Sort results by newest(-1) or oldest(1). If the parameter is left out during execution, the function will use the -1 value. The value cannot be 1 or -1. The function will throw an exception if any one of these is used. |
System.integer - [In] | limit | A number of items are to be returned per call. If the parameter is left out during execution, the function will use the -1 value. The 'limit' should be a positive integer greater than 0 and less than or equal to 100. |
System.integer - [In] | offset | Start the list from a particular entry index. |
System.integer - [In] | filterTemplateId | Filter result by template ID. |
JObject - [Out] | N/A | The entire array of template objects is streamed into resp named parameter and returned. |
3.3. getTemplate
This function enables the developer to retrieve the Template details as per the provided id.
Declaration
public JObject getTemplate(string templateId = "")
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.integer - [In] | templateId | Template ID that is to be retrieved. The function will use the BLANK value if the parameter is left out during execution. |
JObject - [Out] | N/A | The entire template object is streamed into resp named parameter and returned. |
3.4. deleteTemplate
Any unwanted template can be deleted by passing the relevant ID to this function.
Declaration
public JObject deleteTemplate(string templateId = "")
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.integer - [In] | templateId | Template ID that is to be retrieved. The function will use the BLANK value if the parameter is left out during execution. |
JObject - [Out] | N/A | The template deletion confirmation object is streamed into resp named parameter and returned back. |
3.5. createTemplate
A new template, if required, can be created using createTemplate. This function requires template-based content, which acts as a template for further processing.
Declaration
public JObject createTemplate(string name = "", string _content = "", string orientation = "0",
string timezone = "UTC", string font = "Open Sans")
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.string - [In] | name | Template name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter. |
System.string - [In] | _content | HTML based template. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter. |
System.string - [In] | orientation | Template orientation can be either landscape or portrait. 0=Portrait(Default), 1=Landscape. The function will use the BLANK value if the parameter is left out during execution. |
System.string - [In] | timezone | Template timezone. The function will use the UTC timezone value if the parameter is left out during execution. |
System.string - [In] | font | Template font. The function will use the Open Sans font value if the parameter is left out during execution. |
JObject - [Out] | N/A | The generated template object streamed into resp named parameter and returned. |
3.6. updateTemplate
Any existing template can be updated with this function based on the provided templateId.
Declaration
public JObject updateTemplate(string templateId = "", string name = "", string _content = "",
string orientation = "0", string timezone = "UTC", string font = "Open Sans")
Here are the input and output parameters defined against this function.
Type (In/Out) | Name | Description |
---|---|---|
System.integer - [In] | templateId | Template name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter. |
System.string - [In] | name | Template name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter. |
System.string - [In] | _content | HTML based template. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter. |
System.string - [In] | orientation | Template orientation, which can be either landscape or portrait. 0=Portrait(Default), 1=Landscape. The function will use the BLANK value if the parameter is left out during execution. |
System.string - [In] | timezone | Template timezone. The function will use the UTC timezone value if the parameter is left out during execution. |
System.string - [In] | font | Template font. The function will use the Open Sans fonts value if the parameter is left out during execution. |
JObject - [Out] | N/A | The updated template object streamed into resp named parameter and returned. |
Update Process
Please note that the BLANK field provided will be overridden with the existing data; therefore, it is advised to pass on the current data for the specific field in case no update is required.
Updated about 2 years ago