API providers reference

The Support SDK has the following API providers:

Each provider has a number of methods that allow you to access features of Zendesk Support SDK without our UI.

Before you start

Here is some useful information to know before you start: * All API providers assume that you have correctly initialized the SDK, including a valid identity. * API providers return a result asynchronously through a callback provided in the request. * On success, onSuccess(T result) is called containing the result of the request. * On failure, onError(ErrorResponse error) is called containing the error that occurred. * If the calling context is destroyed before the request completes, then you won't receive a callback. * We have some sample apps on Github which demonstrate how to use the Zendesk mobile SDKs in different ways. These can serve as useful references when integrating with the API providers.

ZendeskCallback

All requests made using providers require a ZendeskCallback for handling the response. For example, you can create a callback for a Request request:

ZendeskCallback<Request> requestCallback = new ZendeskCallback<Request>() {
    @Override
    public void onSuccess(Request request) {
        Log.d(LOG_TAG, request.getDescription());
    }

    @Override
    public void onError(ErrorResponse errorResponse) {
        Log.e(LOG_TAG, errorResponse.getReason());
    }
}

RequestProvider

You can use this provider to: * Fetch a list of requests or to create new requests * Fetch a list of comments or add additional comments to an existing request

To create a request provider, use requestProvider:

RequestProvider requestProvider = Support.INSTANCE.provider().requestProvider();

HelpCenterProvider

You can use this provider to: * Fetch categories, sections, and articles * Search for articles * Vote on articles

To create a Help Center provider, use helpCenterProvider:

HelpCenterProvider provider = Support.INSTANCE.provider().helpCenterProvider();

UploadProvider

Can be used to: * Upload attachments * Delete attachments

To create an upload provider, use uploadProvider:

UploadProvider uploadProvider = Support.INSTANCE.provider().uploadProvider();