class Projects::Api::DocumentsAPI
-
DocumentsAPI
is used to: -
Get list of documents.
-
Get the details of a document.
-
Add a document.
-
Update the details of a document.
-
Delete an existing document.
Public Class Methods
-
Construct a new
DocumentsAPI
using User's authToken and portalId.
Parameters¶ ↑
- authToken
-
User's authToken.
-
- portalId
-
User's portalId.
-
Projects::Api::API::new
# File lib/projects/api/DocumentsAPI.rb, line 38 def initialize(authToken,portalId) super(authToken,portalId) end
Public Instance Methods
-
Add a document for the project.
Parameters¶ ↑
- projectId
-
Id of the project.
-
- document
-
Document object.
-
Returns¶ ↑
-
Document object.
# File lib/projects/api/DocumentsAPI.rb, line 95 def add(projectId, document) url = getBaseURL+"projects/"+String(projectId)+"/documents/" fileBody = Hash.new fileBody["uploaddoc"] = document.getUploaddoc response = ZohoHTTPClient.post(url, getQueryMap, document.toParamMAP, fileBody) return $documentParser.getDocument(response) end
-
Delete an existing document for the project.
Attributes¶ ↑
- projectId
-
ID of the project.
-
- documentId
-
ID of the document.
-
Returns¶ ↑
-
return Returns the String object.
# File lib/projects/api/DocumentsAPI.rb, line 138 def delete(projectId, documentId) url = getBaseURL+"projects/"+String(projectId)+"/documents/"+String(documentId)+"/" response = Projects::Util::ZohoHTTPClient.delete(url, getQueryMap) return $documentParser.getResult(response) end
-
Get the details of a document.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- documentId
-
ID of the document.
-
- queryMap
-
This queryMap contains the filters in the form of key-value pair.
-
Returns¶ ↑
-
Document object.
# File lib/projects/api/DocumentsAPI.rb, line 77 def get(projectId, documentId, queryMap) url = getBaseURL+"projects/"+String(projectId)+"/documents/"+String(documentId)+"/" response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) return $documentParser.getDocument(response) end
-
Get list of documents for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- queryMap
-
This queryMap contains the filters in the form of key-value pair.
-
Returns¶ ↑
-
List of Document object.
# File lib/projects/api/DocumentsAPI.rb, line 56 def getDocuments(projectId, queryMap) url = getBaseURL+"projects/"+String(projectId)+"/documents/" response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) return $documentParser.getDocuments(response) end
-
Update the details of a document.
Attributes¶ ↑
- projectId
-
ID of the project.
-
- document
-
Document object.
-
Returns¶ ↑
-
Document object.
# File lib/projects/api/DocumentsAPI.rb, line 116 def update(projectId, document) url = getBaseURL+"projects/"+String(projectId)+"/documents/"+String(document.getId)+"/" fileBody = Hash.new fileBody["uploaddoc"] = document.getUploaddoc response = ZohoHTTPClient.post(url, getQueryMap, document.toParamMAP, fileBody) return $documentParser.getDocument(response) end