class Projects::Api::ForumsAPI
-
ForumsAPI
is used to: -
Get list of forums.
-
Add a forum.
-
Update the details of a forum.
-
Delete an existing forum.
-
Get list of categories.
-
Add a category.
-
Get list of comments.
-
Add a comment.
Public Class Methods
-
Construct a new FoumsAPI using User's authToken and portalId.
Parameters¶ ↑
- authToken
-
User's authToken.
-
- portalId
-
User's prtalId.
-
Projects::Api::API::new
# File lib/projects/api/ForumsAPI.rb, line 42 def initialize(authToken,portalId) super(authToken,portalId) end
Public Instance Methods
-
Add a forum for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- forum
-
Forum object.
-
Returns¶ ↑
-
Forum object.
# File lib/projects/api/ForumsAPI.rb, line 77 def add(projectId, forum) url = getBaseURL+"projects/"+String(projectId)+"/forums/" fileBody = Hash.new fileBody["uploadfile"] = forum.getUploadfile response = ZohoHTTPClient.post(url, getQueryMap, forum.toParamMAP, fileBody) return $forumParser.getForum(response) end
-
Add a category for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- category
-
Category object.
-
Returns¶ ↑
-
Category object.
# File lib/projects/api/ForumsAPI.rb, line 151 def addCategory(projectId, category) url = getBaseURL+"projects/"+String(projectId)+"/categories/" response = ZohoHTTPClient.post(url, getQueryMap, category.toParamMAP) return $forumParser.getCategory(response) end
-
Add comment for the forum.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- forumId
-
ID of the forum.
-
- comment
-
Comment object.
-
Returns¶ ↑
-
Comment object.
# File lib/projects/api/ForumsAPI.rb, line 191 def addComment(projectId, forumId, comment) url = getBaseURL+"projects/"+String(projectId)+"/forums/"+String(forumId)+"/comments/" response = ZohoHTTPClient.post(url, getQueryMap, comment.toParamMAP) return $forumParser.getComment(response) end
-
Delete an existing forum for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- forumId
-
ID of the forum.
-
Returns¶ ↑
-
String object.
# File lib/projects/api/ForumsAPI.rb, line 117 def delete(projectId, forumId) url = getBaseURL+"projects/"+String(projectId)+"/forums/"+String(forumId)+"/" response = ZohoHTTPClient.delete(url, getQueryMap) return $forumParser.getResult(response) end
-
Get list of categories for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
Returns¶ ↑
-
List of Category object.
# File lib/projects/api/ForumsAPI.rb, line 133 def getCategories(projectId) url = getBaseURL+"projects/"+String(projectId)+"/categories/" response = ZohoHTTPClient.get(url, getQueryMap) return $forumParser.getCategories(response) end
-
Get list of Comment for the forum.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- forumId
-
ID of the forum.
-
- queryMap
-
This queryMap contains the filters in the form of key-value pair.
-
Returns¶ ↑
-
List of Comment object.
# File lib/projects/api/ForumsAPI.rb, line 171 def getComments(projectId, forumId, queryMap) url = getBaseURL+"projects/"+String(projectId)+"/forums/"+String(forumId)+"/comments/" response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) return $forumParser.getComments(response) end
-
Get list of forum 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 Forum object.
# File lib/projects/api/ForumsAPI.rb, line 58 def getForums(projectId, queryMap) url = getBaseURL+"projects/"+String(projectId)+"/forums/" response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) return $forumParser.getForums(response) end
-
update the details of a forum.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- forum
-
Forum object.
-
Returns¶ ↑
-
Forum object.
# File lib/projects/api/ForumsAPI.rb, line 97 def update(projectId, forum) url = getBaseURL+"projects/"+String(projectId)+"/forums/"+String(forum.getId)+"/" fileBody = Hash.new fileBody["uploadfile"] = forum.getUploadfile response = ZohoHTTPClient.post(url, getQueryMap, forum.toParamMAP, fileBody) return $forumParser.getForum(response) end