API providers reference

The Support SDK has the following API providers:

Each provider has a number of methods that give you access to tickets or help center resources.

Sample apps

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.

Request provider

The request provider gives you access to support requests, which are also known as tickets in Zendesk. The provider has the following methods:

To create the request provider, see ZDKRequestProvider below.

ZDKRequestProvider

Creates a request provider.

Swift

let requestProvider = ZDKRequestProvider()

Objective-C

[[ZDKRequestProvider alloc] init];

Use the request provider to invoke the methods documented in the rest of this section. Example:

Swift

provider.createRequest(request) {...}

Objective-C

provider.createRequest(request) {...}

getRequestById

Gets the request specified by the id.

NameTypeComment
requestIdThe ID of a request in Zendesk Support
callbackReturns a ZDKRequest object on success

getAllRequestsWithCallback

Gets all requests the user has opened. Also gets an access token if one hasn't been stored previously. If you're using anonymous identities, it checks to see if you have any stored request ids.

NameTypeComment
callbackReturns a list of ZDKRequest objects on success

getRequestsByStatus

Filters requests the user has opened by ticket status. Also gets an access token if one hasn't been stored previously.

NameTypeComment
statusNSStringA comma-separated list of statuses to filter the results by
callbackReturns a list of ZDKRequestsWithCommentingAgents objects on success. This contains a list of ZDKRequests and a list of ZDKUsers. These are agents who have commented on the requests.

getCommentsWithRequestId

Gets all comments for a request. It also gets an access token if one hasn't been stored previously.

NameTypeComment
requestIdNSStringId of a ticket
callbackReturns a CommentsResponse model on success

addComment

Adds a comment message to a request. Also gets an access token if one hasn't been stored previously.

NameTypeComment
commentNSStringThe comment to create
requestIdNSStringId of the ticket to receive this comment
attachmentsNSArrayList of ZDKUploadResponse objects. Can be nil
callbackReturns a ZDKComment object on success

getTicketFormWithIds

Gets the contents of specified ticket forms. Fetches only the first 5 ticket form ids.

NameTypeComment
ticketFormIdsNSArray<NSNumber>An array of ticket form IDs
callbackThe callback is either successful or returns an error

Help Center provider

The Help Center provider gives you access to help center resources in Zendesk Guide. The provider has the following methods:

To create the Help Center provider, see ZDKHelpCenterProvider below.

ZDKHelpCenterProvider

Creates a Help Center provider.

Swift

let helpCenterProvider = ZDKHelpCenterProvider()

Objective-C

[[ZDKHelpCenterProvider alloc] init];

Use the request provider to invoke the methods documented in the rest of this section. Example:

Swift

provider.getCategoryById() {...}

Objective-C

provider.getCategoryById() {...}

initWithLocale

Creates a Help Center provider with a specified locale.

NameTypeComment
localeNSStringA help center locale such as "de", "es", or "ja"

getCategoryById

Gets a category.

NameTypeComment
categoryIdNSStringThe id of a help center category
callbackReturns a category object on success

getSectionById

Gets a section.

NameTypeComment
sectionIdNSStringThe id of a help center section
callbackThe callback that is invoked when a request is either successful or has an error

getArticleById

Gets an article.

NameTypeComment
articleIdNSStringThe id of a help center article
callbackReturns an article object on success

getFlatArticlesWithCallback

Gets a list of FlatArticle objects.

NameTypeComment
callbackReturns a list of FlatArticle objects on success

getArticlesByLabels

Gets a list of articles that have a given list of labels. The article must have all the labels to be included.

NameTypeComment
labelsNSArrayAn array of article labels
callbackReturns a list of articles on success

getSectionsWithCategoryId

Gets the sections in a given help center category.

NameTypeComment
categoryIdNSStringThe id of a help center category
callbackReturns a list of sections on success

getArticlesWithSectionId

Gets the articles in a given help center section.

NameTypeComment
sectionIdNSStringThe id of a help center section
callbackReturns a list of articles on success

searchForArticlesUsingQuery

Searches articles. You can filter the results by label. The method sideloads categories, sections, and users.

NameTypeComment
queryNSStringThe query text used to perform the search
andLabelsNSArrayAn array of labels to filter the query
callbackReturns a list of articles on success

searchArticles

Searches articles filtered by the parameters in a given ZDKHelpCenterSearch model. See Searching Help Center in the Help Center API docs.

NameTypeComment
searchZDKHelpCenterSearchThe search to perform
callbackReturns a list of articles on success

getAttachmentWithArticleId

Gets a list of attachments of a given article.

NameTypeComment
articleIdNSStringThe id of a help center article
callbackReturns a list of articles on success

submitRecordArticleView

Records in Zendesk Support that a specific article as being viewed by the client. Used for the purpose of reporting in Zendesk Support.

NameTypeComment
articleIdNSStringThe id of a help center article that's been viewed
callbackA completion callback. Can be nil

upvoteArticleWithId

Posts an upvote for a given article. If a vote already exists, it's updated.

NameTypeComment
articleIdNSStringThe id of a help center article
callbackReturns the vote object on success

downvoteArticleWithId

Posts a downvote for a given article. If a vote already exists, it's updated.

NameTypeComment
articleIdNSStringThe id of a help center article
callbackReturns the vote object on success

deleteVoteWithId

Deletes a vote.

NameTypeComment
voteIdNSStringThe id of the vote to delete
callbackReturns a status code