Package zendesk.answerbot
Interface AnswerBotProvider
-
public interface AnswerBotProviderimport zendesk.answerbot.AnswerBotProvider; ... AnswerBotProvider provider = AnswerBot.INSTANCE.provider(); ...Once you have an instance of the provider you can call methods on it and handle the results in
ZendeskCallback.ZendeskCallback#onSuccess(Object)will give you the deflections in the case of#getDeflectionForQuery(String, ZendeskCallback), and aVoidin the case of#resolveWithArticle(long, long, String, ZendeskCallback)and#rejectWithArticle(long, long, String, RejectionReason, ZendeskCallback).ZendeskCallback#onError(ErrorResponse)will be called if there was an issue with the method call and it will provide details about the error in ancom.zendesk.service.ErrorResponseFor example, you can get the
DeflectionResponsewhich contains a list ofDeflectionArticles to present to the user for a given query.provider.getDeflectionForQuery(query, new ZendeskCallback <DeflectionResponse>() { @Override public void onSuccess(DeflectionResponse categories) { // Handle the successful query } @Override public void onError(ErrorResponse errorResponse) { // Handle the error } });
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidgetDeflectionForQuery(java.lang.String query, <any> callback)Gets aDeflectionResponsefor the given query String.voidrejectWithArticle(long deflectionId, long articleId, java.lang.String interactionAccessToken, RejectionReason rejectionReason, <any> callback)Marks a deflection article as unhelpful and indicates that it did not resolve the user's issuevoidresolveWithArticle(long deflectionId, long articleId, java.lang.String interactionAccessToken, <any> callback)Marks aDeflectionArticleas helpful and indicates that the article successfully resolved the user's issue.
-
-
-
Method Detail
-
getDeflectionForQuery
void getDeflectionForQuery(java.lang.String query, <any> callback)Gets aDeflectionResponsefor the given query String. TheDeflectionResponsecontains a list ofDeflectionArticles that match the query. The list is empty if no articles matched the query, and a maximum of 3 articles can be returned.- Parameters:
query- the query sent to Answer Botcallback- Callback that will deliver aDeflectionResponse
-
resolveWithArticle
void resolveWithArticle(long deflectionId, long articleId, java.lang.String interactionAccessToken, <any> callback)Marks aDeflectionArticleas helpful and indicates that the article successfully resolved the user's issue.- Parameters:
deflectionId- the deflectionId fromDeflection.getId().articleId- the id of the article the user selected as helpful,DeflectionArticle.getArticleId().interactionAccessToken- the access token returned fromDeflectionResponse.getInteractionAccessToken()callback- Callback that will return success or error
-
rejectWithArticle
void rejectWithArticle(long deflectionId, long articleId, java.lang.String interactionAccessToken, RejectionReason rejectionReason, <any> callback)Marks a deflection article as unhelpful and indicates that it did not resolve the user's issue- Parameters:
deflectionId- the deflectionId fromDeflection.getId().articleId- the id of the article the user selected as helpful,DeflectionArticle.getArticleId().interactionAccessToken- the access token returned fromDeflectionResponse.getInteractionAccessToken()callback- Callback that will return success or error
-
-