For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 293 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

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: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used 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 - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.