Interface HelpCenterProvider
-
public interface HelpCenterProvider
A provider which will offer a higher level of abstraction compared to the
HelpCenterService
.
You can create an instance of HelpCenterProvider like this:import zendesk.support.HelpCenterProvider; import zendesk.support.Support; ... HelpCenterProvider provider = Support.INSTANCE.provider().helpCenterProvider(); ...
Once you have an instance of the provider you can call methods on it and handle the results in callbacks. A success callback will give you the resource(s) that you are requesting, like categories, sections, votes, and so on. The error callback will be called if there was some issue with the method call and it will define details about the error in an
For example you can list the Categories in your Help Center like this:ErrorResponse
provider.getCategories(new ZendeskCallback <List<Category>>() { @Override public void onSuccess(List<Category> categories) { // Handle the success } @Override public void onError(ErrorResponse errorResponse) { // Handle the error } });
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
deleteVote(java.lang.Long voteId, <any> callback)
This method will delete a vote with the given ID As of 1.6.0.1, the Callback is of `Void` type.void
downvoteArticle(java.lang.Long articleId, <any> callback)
This method marks as article as unhelpfulvoid
getArticle(java.lang.Long articleId, <any> callback)
This method returns a single article from a Help Center instance based on the articleId providedvoid
getArticles(java.lang.Long sectionId, <any> callback)
Fetch a list of articles for a given sectionId from a Help Center instancevoid
getArticles(java.lang.Long sectionId, java.lang.String labelNames, <any> callback)
Fetch a list of articles for a given sectionId from a Help Center instancevoid
getAttachments(java.lang.Long articleId, AttachmentType attachmentType, <any> callback)
This method returns a list of attachments for a single article.void
getCategories(<any> callback)
Fetch a list of categories from a Help Center instance.void
getCategory(java.lang.Long categoryId, <any> callback)
This method searches your Help Center instance for a category that matches the specified category ID.void
getHelp(HelpRequest request, <any> callback)
Gets a list of help items representing a flattened Help Center structure.void
getSection(java.lang.Long sectionId, <any> callback)
This method searches your Help Center instance for a section that matches the specified section ID.void
getSections(java.lang.Long categoryId, <any> callback)
Fetch a list of sections for a given categoryId from a Help Center instancevoid
getSuggestedArticles(SuggestedArticleSearch suggestedArticleSearch, <any> callback)
This method returns a list of suggested articles.void
listArticles(ListArticleQuery query, <any> callback)
Lists articles that match the parameters in the query.void
listArticlesFlat(ListArticleQuery query, <any> callback)
This method returns a list of flatArticles which are objects containing an article, section and category all relevant to each other from a Help Center instance.void
searchArticles(HelpCenterSearch search, <any> callback)
This method searches your Help Center instance for articles that match the specified parametersvoid
submitRecordArticleView(Article article, java.util.Locale locale, <any> callback)
This method submits a record article view that is used for reporting.void
upvoteArticle(java.lang.Long articleId, <any> callback)
This method marks as article as helpful
-
-
-
Method Detail
-
getHelp
void getHelp(HelpRequest request, <any> callback)
Gets a list of help items representing a flattened Help Center structure.- Parameters:
request
- The requestcallback
- Callback that will deliver a list of view items
-
getCategories
void getCategories(<any> callback)
Fetch a list of categories from a Help Center instance.- Parameters:
callback
- Callback that will deliver a list of categories available on the instance of the Help Center for the provided locale- Since:
- 1.0.0.1
-
getSections
void getSections(java.lang.Long categoryId, <any> callback)
Fetch a list of sections for a given categoryId from a Help Center instance- Parameters:
categoryId
- Long to specify what sections should be returned, only sections belonging to the category will be returnedcallback
- Callback that will deliver a list of sections available on the instance of the Help Center for the provided locale and categoryId- Since:
- 1.0.0.1
-
getArticles
void getArticles(java.lang.Long sectionId, <any> callback)
Fetch a list of articles for a given sectionId from a Help Center instance- Parameters:
sectionId
- Long to specify what articles should be returned, only articles belonging to the section will be returnedcallback
- Callback that will deliver a list of articles available on the instance of the Help Center for the provided locale and sectionId- Since:
- 1.0.0.1
-
getArticles
void getArticles(java.lang.Long sectionId, java.lang.String labelNames, <any> callback)
Fetch a list of articles for a given sectionId from a Help Center instance- Parameters:
sectionId
- Long to specify what articles should be returned, only articles belonging to the section will be returnedlabelNames
- The label names to include in the query as a CSV stringcallback
- Callback that will deliver a list of articles available on the instance of the Help Center for the provided locale and sectionId- Since:
- 1.0.0.1
-
listArticles
void listArticles(ListArticleQuery query, <any> callback)
Lists articles that match the parameters in the query.- Parameters:
query
- The querycallback
- The callback which will be called upon a successful or an erroneous response.- Since:
- 1.1.0.1
-
listArticlesFlat
void listArticlesFlat(ListArticleQuery query, <any> callback)
This method returns a list of flatArticles which are objects containing an article, section and category all relevant to each other from a Help Center instance.- Parameters:
query
- The querycallback
- The callback which will be called upon a successful or an erroneous response.- Since:
- 1.4.0.1
-
searchArticles
void searchArticles(HelpCenterSearch search, <any> callback)
This method searches your Help Center instance for articles that match the specified parameters- Parameters:
search
- The search parameters used to perform the searchcallback
- The callback which will be called upon a successful or an erroneous response.- Since:
- 1.0.0.1
-
getArticle
void getArticle(java.lang.Long articleId, <any> callback)
This method returns a single article from a Help Center instance based on the articleId providedThis method will also sideload users so that there is a User model available for the author of the article
See:Article.getAuthor()
For more information on Side-Loading
- Parameters:
articleId
- the identifier to be used to retrieve an article from a Help Center instancecallback
- the callback that is invoked when a request has either completed successfully or has errors- Since:
- 1.0.0.1
-
getSection
void getSection(java.lang.Long sectionId, <any> callback)
This method searches your Help Center instance for a section that matches the specified section ID.- Parameters:
sectionId
- The section Id will specify the ID of the particular section to be retrieved.callback
- The callback which will be called upon a successful or an erroneous response.- Since:
- 1.4.0.1
-
getCategory
void getCategory(java.lang.Long categoryId, <any> callback)
This method searches your Help Center instance for a category that matches the specified category ID.- Parameters:
categoryId
- The category Id will specify the ID of the particular category to be retrieved.callback
- The callback which will be called upon a successful or an erroneous response.- Since:
- 1.4.0.1
-
getAttachments
void getAttachments(java.lang.Long articleId, AttachmentType attachmentType, <any> callback)
This method returns a list of attachments for a single article.This method can fetch a variety of attachment types, see
See:AttachmentType
- Parameters:
articleId
- the identifier to be used to retrieve an article from a Help Center instanceattachmentType
- the type of attachments to retrieve for the given articlecallback
- the callback that is invoked when a request is either successful or has errors- Since:
- 1.0.0.1
-
upvoteArticle
void upvoteArticle(java.lang.Long articleId, <any> callback)
This method marks as article as helpful- Parameters:
articleId
- The id of the article to mark as helpfulcallback
- The callback that is invoked when a request is either successful or has errors- Since:
- 1.2.0.1
-
downvoteArticle
void downvoteArticle(java.lang.Long articleId, <any> callback)
This method marks as article as unhelpful- Parameters:
articleId
- The id of the article to mark as unhelpfulcallback
- The callback that is invoked when a request is either successful or has errors- Since:
- 1.2.0.1
-
deleteVote
void deleteVote(java.lang.Long voteId, <any> callback)
This method will delete a vote with the given ID As of 1.6.0.1, the Callback is of `Void` type.- Parameters:
voteId
- The ID of the vote to deletecallback
- The callback that is invoked when a request is either successful or has errors- Since:
- 1.2.0.1
-
getSuggestedArticles
void getSuggestedArticles(SuggestedArticleSearch suggestedArticleSearch, <any> callback)
This method returns a list of suggested articles.- Parameters:
suggestedArticleSearch
- The search parameters used to perform the searchcallback
- The callback that is invoked when a request is either successful or has errors- Since:
- 1.2.0.1
-
submitRecordArticleView
void submitRecordArticleView(Article article, java.util.Locale locale, <any> callback)
This method submits a record article view that is used for reporting. As of 1.6.0.1, the Callback is of `Void` type.- Parameters:
article
- The viewed article.locale
- The locale of the viewed articlecallback
- The callback that is invoked when a request is either successful or has errors.- Since:
- 1.3.1.1
-
-