For Zoho Services only:


I'm actually part of something bigger at Ascent Business Solutions recognized as the top Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions offer support for smaller technical fixes and projects for larger developments, such as migrating to a ZohoCRM.  A team rather than a one-man-band is always available to ensure seamless progress and address any concerns. You'll find our competitive support rates with flexible, no-expiration bundles at http://ascentbusiness.co.uk/zoho-support-2.  For larger projects, check our bespoke pricing structure and receive dedicated support from our hands-on project consultants and developers at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices.

The team I manage specializes in coding API integrations between Zoho and third-party finance/commerce suites such as Xero, Shopify, WooCommerce, and eBay; to name but a few.  Our passion lies in creating innovative solutions where others have fallen short as well as working with new businesses, new sectors, and new ideas.  Our success is measured by the growth and ROI we deliver for clients, such as transforming a garden shed hobby into a 250k monthly turnover operation or generating a +60% return in just three days after launch through online payments and a streamlined e-commerce solution, replacing a paper-based system.

If you're looking for a partner who can help you drive growth and success, we'd love to work with you.  You can reach out to us on 0121 392 8140 (UK) or info@ascentbusiness.co.uk.  You can also visit our website at http://ascentbusiness.co.uk.

Zoho Deluge: Setup an API Connection for InvokeURL

What?
This is slightly different to my article Zoho Deluge: Get Refresh/Access Token API v2 (Zoho to Zoho service) and different to my Zoho CRM: APIv2 using PHP & cURL (3rd-Party to Zoho), in that this details how to setup a connection to use in an invoke URL statement. Specifically for Zoho Books, Subscriptions or Inventory.

Why?
Setting up a connection avoids the hassle of having to generate access/refresh tokens using OAuth2.0. Usually used with an invokeUrl:
copyraw
response = invokeUrl
[ 
	url: "https://books.zoho.com/api/v3/estimates?organization_id=12346789" 
	type: GET
	connection: "joelconnector" 
];
  1.  response = invokeUrl 
  2.  [ 
  3.      url: "https://books.zoho.com/api/v3/estimates?organization_id=12346789" 
  4.      type: GET 
  5.      connection: "joelconnector" 
  6.  ]

How?
So in the following example, we are going to setup a connection in Zoho Books on an EU datacenter:
  1. First determine what datacenter your client is using
  2. Register the App
  3. Setup the Connector

How do I determine what datacenter to use?
To find out which datacenter your client/customer is using in Zoho, check the domain and specifically the top-level-domain (TLD) part. For example, if it says zoho.com, then this means the US datacenter. If it says zoho.eu, then this is the EU datacenter. If it says zoho.in, then this is the India datacenter.

View the attached if this is still confusing. The following screenshot is of a client's Zoho Books instance opened in a browser. the circled part is the domain of the Zoho app we are accessing:
Setup Connection: Determine DataCenter from Website Address

Here is a list of the datacenters that I know of:
  • AU = Australia (zoho.com.au)
  • CN = China (zoho.com.cn)
  • EU = Europe (zoho.eu)
  • IN = India (zoho.in)
  • US = United States (zoho.com)

Registering the App
You need to do this so as to tell which Zoho system for which organization you are connecting to. If you get this wrong, you may access the wrong system (such as your own rather than the clients) or you may not access anything at all.
  1. Open a new browser window (preferably using the Google Chrome profile you have for the customer) Logged in to Zoho as an Administrator of the system to access.
  2. Browse to the Zoho Developer Console at the appropriate link based on the clients datacenter:
  3. If this is your first app, then click on "Get Started" and select "Server-based Applications" by clicking on "Create Now" on the appropriate box.
  4. If this is not your first app, just select "Server-based Applications", then on the plus icon to add new client.
  5. Fill in the new form to Create New Client:
    1. Client Name: put something descriptive so it is easy to identify if the client has 3rd-parties adding clients. eg. "JoelLipman_BooksConnector".
    2. Homepage URL: put our corporate website URL, this is for developers who need to query what this app belongs to or does. eg. "https://www.joellipman.com/"
    3. Authorized Redirect URIs: for this put in one of the following options, again, based on the clients datacenter:
    4. Click on "Create"
    5. You will be issued a Client ID and Client Secret, make a note of these or leave this window to copy&paste into the next step.
      Setup Connector: Copy Client ID and Client Secret

    Setting up the Oauth Connector
    So return to your Zoho Books instance (or Subscriptions, Inventory, app you were making the connection):
    1. From within books (or inventory, subscriptions as these are simillar), go to edit a custom function and click on the "Connections" link to the top right of a function:
      Setup Connector: The Connections button in Zoho Books
    2. If this is your first connection, simply click on the "Go To Connections" button
    3. Select "Custom Service" and complete the form:
      1. Service Name: Enter a descriptive name that can help you find it amongst many connections. eg. "the Joel Lipman App".
      2. Service LinkName: Not sure what this is used for but I enter the same name in lowercase and replacing special characters with an underscore. eg. "the_joel_lipman_app"
      3. Authentication Type: set this to "oauth2"
      4. Param Type: set this to "Header"
      5. Grant Type: set this to "Authorization Code"
      6. Client ID: Copy & paste from the previous step this value into this field.
      7. Client Secret: Copy & paste from the previous step this value into this field.
      8. Authorize URL: Enter the Zoho authentication URL based on the client's datacenter:
        • US datacenter: https://accounts.zoho.com/oauth/v2/auth
        • EU datacenter: https://accounts.zoho.eu/oauth/v2/auth
        • CN datacenter: https://accounts.zoho.com.cn/oauth/v2/auth
        • IN datacenter: https://accounts.zoho.in/oauth/v2/auth
      9. Access Token URL: Enter the Zoho token URL based on the client's datacenter:
        • US datacenter: https://accounts.zoho.com/oauth/v2/token
        • EU datacenter: https://accounts.zoho.eu/oauth/v2/token
        • CN datacenter: https://accounts.zoho.com.cn/oauth/v2/token
        • IN datacenter: https://accounts.zoho.in/oauth/v2/token
      10. Refresh Token URL: Enter the Zoho token URL based on the client's datacenter:
        • US datacenter: https://accounts.zoho.com/oauth/v2/token
        • EU datacenter: https://accounts.zoho.eu/oauth/v2/token
        • CN datacenter: https://accounts.zoho.com.cn/oauth/v2/token
        • IN datacenter: https://accounts.zoho.in/oauth/v2/token
      11. Connection Name: Put a descriptive name
      12. Connection LinkName: Put the link name that we will use in code later (preferably in lowercase as it will lowercase it anyway)
      13. Scope: Enter each scope you need and click on the plus icon to add each one.
      14. Keep "Use credentials of login user" ticked.
      15. You should have something like the following:
        Setup Connection: Form Overview
      16. Click on "Create and Connect"
    4. You will get a popup confirming what this app will access and you should click on "Accept":
      Setup Connection: Accept App Permissions
    5. A quick popup will appear to say connected. Done!

    Now you can use this in your custom function with the invokeURL without the need for a header parameter:
    copyraw
    response = invokeUrl
    [ 
    	url: "https://books.zoho.com/api/v3/estimates?organization_id=12346789" 
    	type: GET
    	connection: "joelconnector" 
    ];
    1.  response = invokeUrl 
    2.  [ 
    3.      url: "https://books.zoho.com/api/v3/estimates?organization_id=12346789" 
    4.      type: GET 
    5.      connection: "joelconnector" 
    6.  ]

    Additional
    I'd always recommend locking down your app privileges by checking the scope(s) you have allowed it to have.... However in those times of debugging/testing when you can't seem to access that bit of information Zoho is reluctantly letting you have (such as comment information for estimates/sales orders/invoices). There are some quietly documented scopes granting absolute access:
    • ZohoBooks.fullaccess.all
    • ZohoInventory.FullAccess.all
    • ZohoSubscriptions.fullaccess.all

    Other Links
    Category: Zoho :: Article: 728

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.