Zoho Writer > Writer - REST API Methods > ZW - Add set of tags to a document

ZW - Add set of tags to a document

Tags:  



Add set of tags to a particular document.



Request URL POST Method

                            XML : http://export.writer.zoho.com/api/private/xml/addTags/[documentID]?apikey=[API Key]&ticket=[Ticket]

                            JSON : http://export.writer.zoho.com/api/private/json/addTags/[documentID]?apikey=[API Key]&ticket=[Ticket]
 

Request parameters :

To add a set of tags to a particular document we need to submit a form data to Writer with the following fields:

Field
Description
documentId
Unique ID of the document for which tags are to be added.
tags
[string] - One or more tag(s) to be associated with this document. For adding multiple tags, separate them by 'space'.


Sample Form (POST Method)


<form method="POST"    action="http://export.writer.zoho.com/api/private/xml/addTags/[documentId]?apikey=[APIKEY]&ticket=[Ticket]">

<input type="hidden" name="tagname" value="tag1 tag2 tag3">

<input type="submit" value="AddTag" class="divbutton" name="submit">

</form>



* It is mandatory to pass the apikey and ticket parameters to access the addTags api.


Response fields

The schema document for the API response is located at: http://export.writer.zoho.com/schema/restapi/addtags.xsd

Field
Description
documentId
Unique ID associated with the document.
tag
Name of one or more tag(s) that is being associated with the document.


Sample Response

The following is the sample XML response for the above method:


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

     <documentId>
8892000000064009</documentId>
        <tag>
        <tag name="search" /> 
             <tag name="forecast" />
        <tag name="
figures" />
     </tag>
    </result>
</response>


Equivalent JSON response


{
  "response":
   {
        "uri": "/api/private/json/addTags/8892000000064009",
        "result":
        {
           "documentId":"8892000000064009",
           "tags":
            {
                "tag":
                [
                     {

                        "name":"search"
                     },
                     {
                        "name":"forecast"
                     },
                     {
                        "name":"figures"
                     }
                ]
            }
         }
    }
}  



Errors


Adding a set of tags to a document method may return general errors. Other HTTP error code may be 1404.
 


 RSS of this page