Zoho Books - Make an API call
@sergio
code:
data:privatelast updated:3 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
nodejs
auth
to use OAuth tokens and API keys in code via theauths object
(auths.zoho_books)
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps, auths) => {
1
2
3
4
5
6
7
}
8

this.headers = {
        Authorization: `Bearer ${auths.zoho_books.oauth_access_token}`        
}

this.body =  JSON.parse(`{"customer_id":"2392161000000077001","line_items":[{"item_id":"2392161000000075001","quantity":1,"item_total":120}]}`);
steps.
zoho_books_make_api_call
Makes an aribitrary call to Zoho Books API
auth
(auths.zoho_books)
params
Request method

Http method to use in the request.

string ·params.request_method
Relative url

A path relative to Zoho Books to send the request against.

 
string ·params.relative_url
Headers

Headers to send in the request.

 
key
 
value
object ·params.headers
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
}
13
// See the API docs: https://www.zoho.com/books/api/v3/#introduction

params.query_string = params.query_string || ''

return await require("@pipedreamhq/platform").axios(this, {
  method: params.request_method,
  url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/${params.relative_url}${params.query_string}`,  
  headers: params.headers,
  data : params.request_body
})