Zoho Reports API
Zoho Reports provides REST style Web APIs over HTTP. With this API, users/developers can extend their web applications to push or pull data into or from Zoho Reports for powerful analysis and reporting.
The API allows you to:
- Add data into a table in Zoho Reports database
- Modify data in the Zoho Reports database
- Bulk Add/Update data into a table via CSV file.
- Bulk Update with criteria support.
- Bulk Delete with criteria support.
- Export data and Reports in various formats such as CSV, JSON, PDF,HTML,IMAGE
- Fetch data from the database using SQL Select query.
This API documentation is organized with the following sections:
This section lists the prerequisites that need to be satisfied before you use API.
Provides the complete API language specification including the request and the response formats of various supported operations
Provides the complete list of actions that are supported by Zoho Reports API
Client libraries are programming language wrappers over the raw HTTP APIs. This enables developers to easily use Zoho Reports API in the corresponding programming language. Currently we support the following language libraries:
Zoho CloudSQL is a middleware technology that allows customers to interact with their business data stored in Zoho through familiar SQL language. Users can access the data in the Zoho cloud using SQL on both other cloud applications as well as through traditional on-premises software.
Zoho Reports is the first service to support CloudSQL as an API extension. Refer to the following links for more details:
Hello,
Don't you have API support for .Net languages ?
I am planning to use your services for a .Net based application and would like to know, if you have any API/Webservice that can be consumed from an .NET based application.
Thanks,
Pavan
Hi Pavan,
We do support API for .net languages. Currently we do not have the client library. But we will be adding it very soon. Mean while please send us your email id to support "at" zohoreports "dot" com. we will send you the .net example to use our API.
Thanks & Regards,
Shibu Alexis
Zoho Reports.
does the JSON format support callbacks? I tried
$.getJSON("http://reports.zoho.com/api/<ID>/<DB>?ZOHO_ACTION=EXPORT&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=XML&ZOHO_API_KEY=<key>ticket= <ticket>ZOHO_API_VERSION=1.0&ZOHO_SQLQUERY=select%20*%20from%20Table&callback=?
and I keep getting script errors. when i paste the URL into a browser, i'm able to see the data come back just fine.
Hi,
You can use the parameter ZOHO_CALLBACK_FUNCTION in the API url to callback javascript function.
Below is an example:
http://reports.zoho.com/api/<username>/<DB>?ZOHO_ACTION=EXPORT&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=XML&ZOHO_API_KEY=<key>ticket= <ticket>ZOHO_API_VERSION=1.0&ZOHO_SQLQUERY=select%20*%20from%20Table&ZOHO_CALLBACK_FUNCTION=<js_function_name>
Sorry that the parameter 'ZOHO_CALLBACK_FUNCTION' is yet to be documented. We will provide with the documents for the same very soon.
Thanks,
Saminathan,
Zoho Reports
good
hi ,
Can you provider .net supporting API's
Thanks ,
Ramakrishna
Hi Ramakrishna,
As of now, we don't have the API client library for .Net.
But, we do have a sample VB .Net program which will be useful for you to get started with API using .Net.
Below is the sample VB .Net code to add rows into Zoho Reports online database using API.
''''''''' SAMPLE CODE - START ''''''''''''
Imports System.Web
Imports System.Net
Imports System.IO
Imports System.Text
Public Class Form1
Private Sub zoho()
' *** COMMENT: GETTING THE ZOHO TICKET ID FOR AUTHENTICATION
Dim getANewTicket As String = getZohoTicketId()
Dim address As Uri
' *** COMMENT: EXIT IF THE TICKET IS NOT VALID
If getANewTicket.Length < 1 Then
'No valid ticket
Exit Sub
End If
' *** COMMENT: CONSTRUCTING API URL TO ADD ROWS INTO ZOHO REPORTS ONLINE DATABASE
address = New Uri("http://reports.zoho.com/api/_testuser_/_database_/_table_?ZOHO_ACTION=ADDROW&ZOHO_OU
TPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML&ZOHO_API_KEY=___abc___&ticket=" & getANewTicket & "&ZOHO_API_VERSION=1.0"
)
Try
' *** COMMENT: ADDING ROWS
' *** COMMENT: ADDING ROW #1
Dim web1 As New System.Net.WebClient()
web1.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim data As Byte() = System.Text.Encoding.ASCII.GetBytes("col1=val1")
Dim response1 As Byte() = web1.UploadData(address, "POST", data)
MsgBox(System.Text.Encoding.ASCII.GetString(response1))
' *** COMMENT: ADDING ROW #2
Dim web2 As New System.Net.WebClient()
web2.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
data = System.Text.Encoding.ASCII.GetBytes("col2=val2")
Dim response2 As Byte() = web2.UploadData(address, "POST", data)
MsgBox(System.Text.Encoding.ASCII.GetString(response2))
' *** COMMENT: SHOW ERROR MESSAGE IN CASE OF EXCEPTION
Catch ex As Exception
msgbox(ex.message)
End Try
End Sub
' *** COMMENT: FUNCTION TO GET ZOHO TICKET ID
Private Function getZohoTicketId() As String
'Get a ticket number with the prescribed username and password
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim reader As StreamReader
Dim ticketResponse As String = "" 'Hold reponse
Try
' *** COMMENT: CREATE THE WEB REQUEST TO GET TICKET ID
request = DirectCast(WebRequest.Create("https://accounts.zoho.com/login?servicename=ZohoReports&FROM_AGENT=true&LOGIN_ID=_testuser_&PASSWORD=_a_password_"), HttpWebRequest)
' *** COMMENT: GET THE RESPONSE
response = DirectCast(request.GetResponse(), HttpWebResponse)
' *** COMMENT: GET THE RESPONSE STREAM INTO READER
reader = New StreamReader(response.GetResponseStream())
Do While reader.Peek <> -1
Dim row As String = reader.ReadLine
' *** COMMENT: PARSING AND GET THE TICKET
Dim startPosition As Integer
startPosition = row.IndexOf("TICKET")
If startPosition <> -1 Then
ticketResponse = row.Substring(7)
End If
Loop
Finally
If Not response Is Nothing Then response.Close()
End Try
Return ticketResponse
End Function
' *** COMMENT: START ADDING ROWS USING API
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
zoho()
End Sub
End Class
''''''''' SAMPLE CODE - END ''''''''''''
Please get back to support "at" zohoreports "dot" com for further clarifications.
Best Regards,
Manohar Nixon S
Zoho Reports