class Projects::Api::ForumsAPI

Public Class Methods

new(authToken,portalId) click to toggle source
  • Construct a new FoumsAPI using User's authToken and portalId.

Parameters

  • authToken
    • User's authToken.

  • portalId
    • User's prtalId.

Calls superclass method Projects::Api::API::new
# File lib/projects/api/ForumsAPI.rb, line 42
def initialize(authToken,portalId)
        super(authToken,portalId)
end

Public Instance Methods

add(projectId, forum) click to toggle source
  • 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
addCategory(projectId, category) click to toggle source
  • 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
addComment(projectId, forumId, comment) click to toggle source
  • 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(projectId, forumId) click to toggle source
  • 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
getCategories(projectId) click to toggle source
  • 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
getComments(projectId, forumId, queryMap) click to toggle source
  • 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
getForums(projectId, queryMap) click to toggle source
  • 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(projectId, forum) click to toggle source
  • 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