Copy - Database

Tags:  

Copy Database




Introduction


The Copy Database API is used to copy the database from one Zoho Reports Account to another Zoho Reports Account.

Getting Started


To get started with the below documentation, make sure that you already gone through the Prerequisites and API Specifications documentations.

Request


The sample request URL is below.


https://reportsapi.zoho.com/api/<email_address_of_database_administrator>/<name_of_the_source_database>?ZOHO_ACTION=COPYDATABASE
&ZOHO_DATABASE_NAME=<destination_database_name>&ZOHO_DATABASE_DESC=<destination_database_description>&ZOHO_COPY_WITHDATA=<true/false>
&
ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
&authtoken=<authtoken_of_the_user_who_want_to_copy>&ZOHO_API_VERSION=1.0&ZOHO_COPY_DB_KEY=<copy_database_key_of_the_original_database>


Query String Parameters

The below table shows the list of Query String parameters that has to be passed along with the request URL.

Parameter NameDescription
ZOHO_ACTIONThis parameter value should be COPYDATABASE.

Note:
This parameter should be in same case (UPPER CASE) as given in the document.
ZOHO_DATABASE_NAMEThis parameter holds the name of the destination database
ZOHO_DATABASE_DESCThis parameter holds the description of the description database
ZOHO_COPY_WITHDATAtrue - The data present in all tables of source database will be copied into destination database
false - The data present in all tables of source database will not be copied into destination database
ZOHO_COPY_DB_KEYThe secret key used for allowing the user to copy the database / reports. The source database owner has to invoke the below URL to get the Copy Database Secret Key.

https://reportsapi.zoho.com/api/abcd@zoho.com/SourceEmployeeDB?ZOHO_ACTION=GETCOPYDBKEY&ZOHO_OUTPUT_FORMAT=XML&ZOHO_ERROR_FORMAT=XML
&authtoken=<source_db_owner_authtoken>&ZOHO_API_VERSION=1.0

Note: You need to provide the appropriate values in the above URL to generate the corresponding Copy Database Key for your setup
authtoken
The authtoken parameter should hold the Auth Token of the Database Administrator whose database is to be copied.


Response



The sample response sent from the server if the Copy Database process is success.

XML Format:

<response uri="/api/abc@zoho.com" action="COPYDATABASE">
<result>
<message>Successfully Database Copied</message> <dbid>100000000000889</dbid>
</result>
</response>


JSON Format:

{
"response":
{
"uri": "\/api\/abc@zoho.com",
"action": "COPYDATABASE",
"result":
{
"message": "Successfully Database Copied", "dbid": "10000000000889"
}
}
}


Error Handling



This section explains the possible errors responses that could be returned on failure of the Copy Database API call.

XML Format:

<response uri="/api/abc@zoho.com" action="COPYDATABASE">
<error> <code>7103</code>
<message>Database not found! Please check whether the database exists</message>
</error>
</response>


JSON Format:

{
"response":
{
"uri": "\/api\/abc@zoho.com",
"action": "COPYDATABASE",
"error":
{ "code":6021,
"message": "Database not found! Please check whether the database exists"
}
}
}

Error Codes:

The below table shows the list of error codes sent from server on Copy Database API Request along with the reason and the solution for the same.

ERROR CODEREASONSOLUTION
7103The database specified does not exists
Check the name of the database to be copied


In case you encounter any other errors, please mail the API request URL parameters and error response details to support@zohoreports.com. We will get back to you shortly with the best possible solution.





    Post a comment

    Your Name or E-mail ID (mandatory)

    Note: Your comment will be published after approval of the owner.




     RSS of this page