Copy Database API:
Zoho Reports provides an option to copy the database from one account to the other. The steps involved to copy the database are,
Getting Copy Database Key - API
This API allows the owner of the database to generate the Copy Database Key
of a particular database. This key will be used by the other user to
copy this database. Please note that any user who knows this Copy
Database Key can copy the database to their account.
API URL Format:http://reportsapi.zoho.com/api/<username of the database owner>/<database name>?ZOHO_ACTION=GETCOPYDBKEY
&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON
&ZOHO_API_KEY=<apikey
of the user user1>&ticket=<ticket of the database owner
account>&ZOHO_API_VERSION =1.0
Sample URL:A sample request for generating the Copy Database Key of the database "EmployeeDB" present in the zoho account "User1"
http://reportsapi.zoho.com/api/User1/EmployeeDB?ZOHO_ACTION=GETCOPYDBKEY
&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON
&ZOHO_API_KEY=23018f894d68dcd4b1e1c584f5809805&ticket=037821dd988c2ef1863403a7820577f7&ZOHO_API_VERSION =1.0
Specifying the Action:
In the Copy Database Key Generation API, the ZOHO_ACTION parameter should be
GETCOPYDBKEY. For the other API parameters such as ZOHO_OUTPUT_FORMAT, kindly refer the below link:
https://zohoreportsapi.wiki.zoho.com/Common-Parameters.htmlPlease
note that the ZOHO_ACTION parameter is case-sensitive. i.e., the
parameter should be GETCOPYDBKEY and not like getcopydbkey or
GetCopydbKey.
Parameters for specifying the Get Copy DB Key Option:
Parameter | Possible Values | Description |
ZOHO_REGENERATE_KEY | true/false | Optional. Default is false. true - return newly generated copydb key false - return the previously generated copydb key
|
Sample Success Response:
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/User1/EmployeeDB/" action="GETCOPYDBKEY">
<result>
<copydbkey>a2fbce33fd65dc7b7cd7c99945b96d52</copydbkey>
</result>
</response>
JSON:
{
"response":
{
"uri": "/api/User1/EmployeeDB/",
"action": "GETCOPYDBKEY",
"result":
{
"copydbkey":"a2fbce33fd65dc7b7cd7c99945b96d52"
}
}
}
This
API allows you to copy the particular database from "User1" account to
"User2" account. i.e., User2 will use the copydb key given by User1 to
copy the database into User2's account.
API URL:&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON&ZOHO_API_VERSION=1.0
&ZOHO_API_KEY=<api key of the User1>&ticket=<ticket of the User2>
&ZOHO_DATABASE_NAME=EmployeeDatabase&ZOHO_COPY_DB_KEY=<copy database key of the original database>
Sample URL:
A sample request to copy the database from User1's account to User's account.
http://reportsapi.zoho.com/api/User1/EmployeeDB?ZOHO_ACTION=COPYDATABASE
&ZOHO_OUTPUT_FORMAT=JSON&ZOHO_ERROR_FORMAT=JSON&ZOHO_API_VERSION=1.0
&ZOHO_API_KEY=23018f894d68dcd4b1e1c584f5809805&ticket=735ab3726f669211c089975b28e6798e
&ZOHO_DATABASE_NAME=EmployeeDatabase&ZOHO_COPY_DB_KEY=a2fbce33fd65dc7b7cd7c99945b96d52
Specifying the Action:
In the Copy Database Key Generation API, the ZOHO_ACTION parameter should be
COPYDATABASE. For the other API parameters such as ZOHO_OUTPUT_FORMAT, kindly refer the below link:
https://zohoreportsapi.wiki.zoho.com/Common-Parameters.html
Please note that the ZOHO_ACTION parameter is case-sensitive. i.e., the
parameter should be
COPYDATABASE and not like copydatabase or CopyDatabase.
Parameters for specifying the Copy Database Option:
Parameter | Possible Values | Description |
ZOHO_COPY_DB_KEY | String | Mandatory Copy DB key of the particular database. |
ZOHO_DATABASE_NAME | String | Mandatory New Database name |
ZOHO_DATABASE_DESC | String | Optional New Database description |
ZOHO_COPY_WITHDATA | True/False | Optional. Default value is false. true - Copy database with data false - Copy database without data |
Sample Success Response:
XML
<?xml version="1.0" encoding="UTF-8" ?>
<response uri="/api/User1/EmployeeDB/" action="COPYDATABASE">
<result>
<message>Successfully Database Copied</message>
</result>
</response>
JSON
{
"response":
{
"uri": "/api/User1/EmployeeDB/",
"action":"COPYDATABASE",
"result":
{
"message":"Successfully Database Copied"
}
}
}