Get Templates From Zoho Books
Table of Contents
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
"Invoices"
"5379XXXX"
"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