Choose where you’d like to start

Get Templates From Zoho Books

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>);
ParamsData typeDescription

<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.

InvoicesSalesordersRetainerInvoices

Estimates

Purchaseorders

CreditNotes

<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:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • Add relevant scopes as mentioned in Zoho Books API -> <Module> -> List <ModuleName> templates. 
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

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

Get Started Now

Execute