Skip to main content
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT
 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace

Join us for the biggest low-code event of the year. Register now!

x

Choose where you’d like to start

invokeAPI Task

Overview

The invokeAPI task is an HTTP client that allows you to access and modify the data of one Zoho service from another Zoho service using APIs.

Unlike the InvokeURL task where you specify the complete URL to access a specific resource mentioned in the API document, with invokeAPI, only the path needs to be specified. The domain of the Zoho service is fetched automatically based on its data center for making an API call, ensuring accessibility across all data centers.

Note:

  • This task will throw "socket timeout error" if the web resource/ API takes more than 40 seconds to respond. 
  • The default connection timeout will happen in 10 seconds, and the connection request timeout in 5 seconds.
  • In Zoho Creator, this task can download file up to 5 MB.  Some older accounts would allow downloads up to 50 MB which will eventually be reduced without affecting the existing scripts. Learn more.
  • In services other than Zoho Creator, you can download Zoho domain files of size up to 15 MB and other domain files of size up to 5 MB using the relevant APIs.

Syntax

response = invokeapi
[
service:<service_name>
path:<path_value>
type:<type_value>
parameters:<parameters_value>
body:<body_value>
headers:<headers_value>
connection:<connection_name>
response-format:<response_format_value>
response-decoding:<encoding_format_value>
];
ParameterData typeDescription
<response>KEY-VALUE/ FILE/ TEXT/ LISTThe variable that will contain the response returned.
<service_name> TEXT

The name of the Zoho service whose resources need to be accessed.

Allowed Values: 

<path_value>TEXTThe URL path of the service that needs to be accessed, excluding the base URL.
For example, if the request URL is "https://www.zohoapis.com/crm/v3/Leads" the path will be "/crm/v3/Leads"

<type_value>

(optional)

Constant

The HTTP request method.

Allowed values:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Default value: GET

<parameters_value>

(optional)

TEXT/ KEY-VALUEParameters are query strings that will be appended to the end of a URL. They facilitate the transmission of specific data to the server for processing or filtering purposes.

<body_value>

(optional)

TEXT/ FILE/ KEY-VALUE

The body of the request. 

Send various types of request body using invokeAPI task:

text/plain: This type is used to supply values to the API in raw TEXT format without any specific encoding or formatting.

application/x-www-form-urlencoded: The data is sent to the API as KEY-VALUE pairs. This encoding is commonly used for sending form data in HTTP requests.

multipart/form-data: The data sent to the API is structured as a multipart form in KEY-VALUE format. This format is particularly useful when dealing with file uploads, allowing for the transmission of binary data along with additional metadata.

application/json: The data is sent to the API in JSON format. It is commonly used for sending structured data in HTTP requests, allowing for the representation of complex data structures, including objects and arrays.

Note: When sending data in JSON format to the API, ensure it is converted to TEXT format using the toString() function. See Example

application/octet-stream: This type is employed when sending FILE data. Data is transmitted in its raw, binary format without any specific encoding.

Info: Refer here to learn how to send key-value data with this parameter.

<headers_value>

(optional)

KEY-VALUEThe attributes or the header values.
<connection_name>TEXT

The connection name of the required service.

Note: 

  • This parameter is optional for services other than Zoho Creator, provided the API call is made within the same service.
  • Multiple connections can be created for the same service.

<response_format_value>

(optional)

TEXT

The data type in which the response must be returned.

Allowed values:

  • FILE
  • COLLECTION
  • STRING
  • NONE
  • DEFAULT

Default value: DEFAULT

Note: If the value of this parameter is set to NONE, the response won't be returned.
<encoding_format_value>TEXT

The character encoding scheme based on which the response returned needs to be decoded.

Allowed values: Click here to find the list of allowed values for this parameter.

Default value: UTF-8

The following functions can be used along with the response to get a detailed response.

<response>.statusReturns the response code of the respective request.
<response>.headersReturns the header of the respective request

Format to Send the Key-Value Data

Follow the format below to send the key-value data with the body of the invokeAPI request if the value associated with the key is,

  • FILE:

    Note:

    • Only file objects, such as those returned by an invokeAPI or invokeURL task, and data converted to file using the toFile function, can be attached. For example, a text value formatted as CSV can be converted into a CSV file using the toFile function. Please note that this function is currently not applicable to Zoho Creator.
    • In Zoho Creator, input text that is converted into a file cannot exceed 5MB. Some older accounts currently allow conversion up to 50MB, but this limit will eventually be reduced without affecting existing scripts.
    <variable> = {{"param-name": <key>, "param-value": <File>}};
  • TEXT/ MAP:

    <variable> = {{"param-name": <key>, "param-value": <value>, "content-type":"<content_type_value>", "encoding-type":"<encoding_type_value>"}};
  • LIST (list of KEY-VALUE data with the associated 'param-values' as FILE, TEXT, or MAP):

    list_ = List();
    list_variable.add({"param-name": <key>, "param-value": <File_1>});
    list_variable.add({"param-name": <key>, "param-value": <File_2>});
    list_variable.add({"param-name": <key>, "param-value": <text_value>, "<content_type_value>":, "encoding-type":"<encoding_type_value>"});
    list_variable.add({"param-name": <key>, "param-value": <map_value>, "<content_type_value>":, "encoding-type":"<encoding_type_value>"});
                                                    
Note: If the 'content-type' and 'encoding-type' are not specified, the default value for content type will be set to text/plain, and the default encoding format will be set to UTF-8.

Example 1: Fetch Organization Details from Zoho Recruit

The below script fetches the organization details from your Zoho Recruit account. Click here to learn more about the API used in this example.

response = invokeapi
[
service: ZohoRecruit
path: "/recruit/v2/org"
type: GET
connection: "recruit_connection"
];
info response;

Where,

"/recruit/v2/org"
The TEXT that represents the URL path specified in the Zoho Recruit API to fetch organization details.
GET
The HTTP request method.
"recruit_connection"
The TEXT that represents the connection name.

Example 2: Create a Sales Order in Zoho Books

The following script creates a sales order with the specified values in Zoho Books. Click here to learn more about the API used in this example.

// Create a map that holds the values of the new salesorder that needs to be created
item = Map();
                                                                                                                    item.put("item_id",205788000000122285);
item.put("rate", 120);
item.put("name", "Hard Drive");
item.put("description", "500GB, USB 2.0 interface 1400 rpm, protective hard case.");
// Format the data as specified in the Zoho Books API item_list = List(); item_list.add(item);
data = Map(); data.put("customer_id",205788000000127011); data.put("line_item", item_list);
// Supply the parameters to the invokeApi task response = invokeapi [ service : ZohoBooks path : "/books/v3/invoices" type : POST parameters : {"organization_id": "10xxx59"} body : data headers : {"content-type":"application/x-www-form-urlencoded"} connection : "zohobooks_connection" ];
info response.status;

Where,

"/books/v3/invoices?organization_id=10xxx695"
The TEXT that represents the URL path specified in the Zoho Books API to create a sales order.
POST
The HTTP request method.
"zohobooks_connection"
The TEXT that represents the connection name.

Example 3: Upload an Attachment to Zoho CRM Record

The following script uploads an attachment to the specified Zoho CRM record. Click here to learn more about the API used in this example.

//Fetch the file using the invoke URL task.
Attachment = invokeurl
[                                                                                                                url :"https://www.cmu.edu/blackboard/files/evaluate/tests-example.xls"                                                                                                              type :GET                                                                                                         ];
//Create a variable to store the record id of the record where the attachment to be uploaded. Record_ID = "2689962xxxxx509150";
//Supply the parameters to the invokeapi task. response = invokeapi [ service :zohocrm path :"/crm/v7/Leads/"+Record_ID+"/Attachments" type :POST body:{{"param-name":"file","param-value":Attachment}} connection:"zohocrm_connection" ]; info response.status;

Where,

Attachment
The FILE variable that holds the attachment file.
Record_ID
The variable that holds the ID of the record where the file is to be uploaded.
"/crm/v7/Leads/"
The TEXT that represents the URL path specified in the Zoho CRM API to create an invoice.
POST
The HTTP request method.
"zohocrm_connection"
The TEXT that represents the name of the connection. 

Example 4: Update a Contact in Zoho Inventory

The following script updates the billing address of a contact with the specified details in the Zoho Inventory. Click here to learn more about the API used in this example.     

//Create a variable to store JSON value.
Address = {"attention": "Mr.John","address": "4900 Hopyard Rd","street2": "Suit 310","city": "Pleasanton", "state":"California","zip": 94588,"country": "U.S.A"};
//Map the Address json with the shipping_address parameter as specifies in the Zoho Books API address_map = Map(); address_map.put("shipping_address",Address);
//Supply the parameters to the invokeApi task. response = invokeapi [ service :ZohoInventory path :"/inventory/v1/contacts/4600xxxxx026049" type :PUT parameters : {"organization_id": "10234695"} body :address_map.toString() headers :{"content-type":"application/json"} connection :"zohoinventory_connection" ];
Info response.headers;

Where,             

Address
The variable that holds the JSON value.
"/inventory/v1/contacts/"
The TEXT that represents the URL path specified in the Zoho Inventory API to update a contact.
PUT
The HTTP request method.
"zohoinventory_connection"
The TEXT that represents the connection name.

 Response Format                

The standard response will be returned in the following format:

 {
       "responseText": "Example.png"
 }
  • To return the header of the request use the following script.

    <variable> = <response>.headers;                                                                                                                                                                                                                                                                                                                                                                                                                     

    The response for the request to return the header will be in the following format:

    {
          "date": "Wed, 23 Oct 2019 10:03:31 GMT",
          "server": "Apache",
          "content-length": "159500",
          "expires": "Wed, 23 Oct 2019 16:03:31 GMT",
          "x-endurance-cache-level": "2",
          "x-cache-lookup": "MISS from 172.30.232.40:3128",
          "via": "1.1 172.30.232.40 (squid/4.1)",
          "last-modified": "Wed, 04 May 2016 01:44:18 GMT",
          "content-type": "image/png",
          "connection": "keep-alive",
          "x-cache": "MISS from 172.30.232.40",
          "accept-ranges": "bytes",
          "cache-control": "max-age=21600"
    }
  • To return the response code of the request, use the following script:

    <variable> = <response>.status;                                                                                                                                                                                                                                                                                                                                                                                                                     

    The response for the request to return the response code will be in the following format:

    200

Related Links

Get Started Now

Execute