Package zendesk.answerbot
Interface AnswerBotProvider
-
public interface AnswerBotProvider
import 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 aVoid
in 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.ErrorResponse
For example, you can get the
DeflectionResponse
which contains a list ofDeflectionArticle
s 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 void
getDeflectionForQuery(java.lang.String query, <any> callback)
Gets aDeflectionResponse
for the given query String.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 issuevoid
resolveWithArticle(long deflectionId, long articleId, java.lang.String interactionAccessToken, <any> callback)
Marks aDeflectionArticle
as helpful and indicates that the article successfully resolved the user's issue.
-
-
-
Method Detail
-
getDeflectionForQuery
void getDeflectionForQuery(java.lang.String query, <any> callback)
Gets aDeflectionResponse
for the given query String. TheDeflectionResponse
contains a list ofDeflectionArticle
s 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 aDeflectionArticle
as 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
-
-