Publish APIs



This topic is deprecated. Please access the new set of "Publish APIs" from over here: "https://www.zoho.com/docs/zoho-docs-api.html#publish





Publish APIs


Zoho's Publish APIs allow you to make a document, spreadsheet or presentation public and available to the external world. There's also a method in place that provides from canceling the public sharing access to a document. As these methods involve a write request, you are required to do a HTTPs multi-part form POST with a few additional parameters.

Methods List:
  1. Make a document public.
  2. Cancel public access for a document.
Make a document public

Request URI : (HTTPs POST)

To make a particular document public, Developers need to send the request in the following URI format :

 Zoho Sheet (Spreadsheets):
https://sheet.zoho.com/api/<access>/<format>/makepublic/[workbookId]?apikey=[API Key]&authtoken=[AuthToken]&scope=DataAPI
Zoho Show (Presentations):
https://show.zoho.com/api/<access>/<format>/makepublic/[presentationId]?apikey=[API Key]&authtoken=[AuthToken]&scope=DataAPI
Access: private

HTTPs Method: POST

Response Formats : xml, json

Form Request Parameters Reference

The following are the parameters that needs to be passed in multi-part HTTPs POST request for Sheet/Show:

ParameterValue
Description
workbookId / presentationId
integer
Mandatory. Unique ID of the document that is to be made public.

Note: You can get the 'documentId' from document list api.
listInPublic*
boolean
Optional. If set to true, the presentation gets listed in Zoho's public presentation list.

Multi-part Form Submit - Sample
<form method="POST" action="https://show.zoho.com/api/private/xml/makepublic" enctype="multipart/form-data" 
target="_self" accept-charset="UTF-8">
<input type="hidden" name="apikey" value="[Zoho_API_Key]">
<input type="hidden" name ="authtoken" id="authtoken" value="bad18eba1ff45jk7858b8ae88a77fa30">
<input type="hidden" name ="scope" id="scope" value="DataAPI">
<input type="hidden" name="presentationId" value="[id of the public presentation]">
<input type="hidden" name="listPublic" value="[true/false]">
<input type="submit" name="submit" value="Make Public">
</form>
Response Parameters Reference

 
Parameter Value
Description
workbookId / presentationId
integer
Unique ID associated with the spreadsheet or presentation that is being made public.
workbookName / presentationName
string
Name of the spreadsheet or presentation that is being made public.
publicUrl
string
Displays the url of the document that's been made public.
embedUrl
string
Embed public documents to your website by using the iframe code snippet.

Sample Response :

The following is a response (both in XML & JSON) for publish document method:

XML
<?xml version="1.0" encoding="UTF-8" ?> 
<response uri="/api/private/xml/makepublic">
<result>

<presentationId>1526506107454322</presentationId>
<presentationName>inventions</presentationName>
<publicUrl>https://show.zoho.com/public/johnmason/inventions</publicUrl>
<embedUrl>
<iframe src=https://show.zoho.com/ViewURL.sas?USER=johmason&DOC=inventions&IFRAME=yes height='370' width='480'
name=inventions scrolling=no frameborder='0'></iframe>
</embedUrl>

</result>
</response>
JSON
{
"response":
{
"uri": "/api/private/json/makepublic",
"result":
{
"presentationId":"152650107454322",
"presentationName":"inventions",
"publicUrl":"https://show.zoho.com/public/johnmason/inventions",
"embedUrl":"<iframe src=https://show.zoho.com/ViewURL.sas?USER=geetha&DOC=inventions&IFRAME=yes
height='370' width='480' name=inventions scrolling=no frameBorder='0'></iframe>"
}
}
}


Cancel public access for a document

Request URI : (HTTPs POST)

To cancel the public sharing access of a document, Developers need to send the request in the following URI format :

 Zoho Sheet (Spreadsheets) :
https://sheet.zoho.com/api/<access>/<format>/removepublic/[workbookId]?apikey=[API Key]&authtoken=[AuthToken]&scope=DataAPI
Zoho Show (Presentations) :
https://show.zoho.com/api/<access>/<format>/removepublic/[presentationId]?apikey=[API Key]&authtoken=[AuthToken]&scope=DataAPI
Access: private

HTTPs Method: POST

Response Formats : xml, json

Form Request Parameters Reference

The following are the parameters that needs to be passed in multi-part HTTPs POST request for Sheet/Show:

Parameter Value
Description
workbookId / presentationId
integer
Mandatory. Unique ID associated with the document whose public access is being revoked.

Note: You can get the 'documentId' from document list api.

Multi-part Form Submit - Sample
<form method="POST" action="https://sheet.zoho.com/api/private/xml/removePublic" enctype="multipart/form-data" 
target="_self" accept-charset="UTF-8">
<input type="hidden" name="apikey" value="[Zoho_API_Key]">
<input type="hidden" name ="authtoken" id="authtoken" value="bad18eba1ff45jk7858b8ae88a77fa30">
<input type="hidden" name ="scope" id="scope" value="DataAPI">
<input type="hidden" name="workbookId" value="[id of the public spreadsheet]">
<input type="submit" name="submit" value="Cancel Public Share">
</form>
Response Parameters Reference


Parameter Value
Description
workbookId / presentationId
integer
Unique ID associated with the document whose public access is being revoked. 
workbookName / presentationName
string
Name of the document.


 
Sample Response :

The following is a response (both in XML & JSON) for revoking public access of a document method:

XML
<?xml version="1.0" encoding="UTF-8" ?> 
<response uri="/api/private/xml/removePublic">
<result>

<workbookId>23499007454322</workbookId>
<workbookName>Financials - A History</workbookName>

</result>
</response>
JSON
{
"response":
{
"uri": "/api/private/json/removePublic",
"result":
{
"workbookId":"23499007454322",
"workbookName":"Financials - A History",
}
}
}




    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