A Ruby wrapper for the Zoho REST API.
Add this line to your application's Gemfile:
gem 'zoho_api'And then execute:
$ bundle
Or install it yourself as:
$ gem install zoho_api
Before you can make calls to Zoho you must configure the library with a valid client_id, client_secret and redirect_uri.
There are two ways to configure the gem. You can pass a hash of configuration options when you create a client, or you can use a configure block.
Initializing Zoho Invoice client:
client = ZohoApi::Invoice::Client.new(client_id: "YOUR_CLIENT_ID_HERE",
client_secret: "YOUR_CLIENT_SECRET_HERE",
redirect_uri: "YOUR_REDIRECT_URI_HERE",
access_token: "YOUR_ACCESS_TOKEN_HERE",
refresh_token: "YOUR_REFRESH_TOKEN_HERE")Initializing Zoho Books client:
client = ZohoApi::Books::Client.new(client_id: "YOUR_CLIENT_ID_HERE",
client_secret: "YOUR_CLIENT_SECRET_HERE",
redirect_uri: "YOUR_REDIRECT_URI_HERE",
access_token: "YOUR_ACCESS_TOKEN_HERE",
refresh_token: "YOUR_REFRESH_TOKEN_HERE")Initializing Zoho Books client with sandbox environment:
client = ZohoApi.client(client_id: "YOUR_CLIENT_ID_HERE",
client_secret: "YOUR_CLIENT_SECRET_HERE",
redirect_uri: "YOUR_REDIRECT_URI_HERE",
auth_code: "YOUR_AUTH_CODE_HERE",
sandbox: true)Generate access and refresh tokens from auth_code
client.fetch_tokensGenerate access token from refresh token
client.renew_tokenNote: You don't need to refresh client's access and refresh tokens after hitting these apis
Get specific contact details
client.contact('CONTACT_UUID')Get all the contacts
client.contactsGet contacts by page
# default value of page is 1
# default value of per_page is 200
client.clients(page: 2, per_page: 10)Get specific invoice details
client.invoice('INVOICE_UUID')Get all the invoices
client.invoicesGet invoices by page
# default value of page is 1
# default value of per_page is 200
client.invoices(page: 2, per_page: 10)- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request