Get Templates From Zoho Books
Table of Contents
Note:
- Each time the zoho.books.getTemplates integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.books.getTemplates integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
This task is used to fetch all the templates from the specified Zoho Books module.
This task is based on Zoho Books API -> <Module> -> List <ModuleName> templates.
Syntax
<variable> = zoho.books.getTemplates(<module_name>, <org_ID>, <connection>);
| Params | Data type | Description | ||||||
| <variable> | KEY-VALUE | Variable which will hold the response returned by Zoho Books. | ||||||
| <module_name> | TEXT | specifies the module from which the templates will be fetched. Following are the applicable modules.
| ||||||
| <org_ID> | TEXT | specifies the organization ID of the account from which the templates will be fetched. | ||||||
| <connection> | TEXT | is the link name of the Zoho Books connection Note:
|
Example
The following script fetches all the templates from the Zoho Books module - Invoices.
response = zoho.books.getTemplates("Invoices","5379XXXX", "books_connection");
where,
response
is the variable which will hold the KEY-VALUE response returned by Zoho Books
"Invoices"
is the TEXT that represents the name of the module from which the templates need to be fetched
"5379XXXX"
is the TEXT that represents the organization ID of the Zoho Books account
"books_connection"
is the TEXT that represents Zoho Books connection
Response Format
The following is a sample success response:
{
"code":0,
"message":"success",
"templates":[
{
"template_name":"Spreadsheet Template",
"template_id":"176XXXXXXXXXXXXX108",
"template_type":"excel"
},
{
"template_name":"Standard Template",
"template_id":"176XXXXXXXXXXXXX001",
"template_type":"standard"
}
]
}The failure response returned for incorrect / non-existent organization ID is of the following format.
{
"code":6041,
"message":"This user is not associated with the CompanyID/CompanyName:638XXX318."
}
Related Links
- Zoho Books API -> <Module> -> List <ModuleName> templates
- Common error codes can be viewed here