Asista SDK for Android

Last updated on: March 19th, 2019

View Demo App based on Asista Android SDK here.

About Asista SDK for Android

The Asista SDK for Android lets you use asista services in your own Android application, allowing you to provide your customers the ability to view your knowledge base as well as create/view/update tickets.

The Asista SDK for Android comes with its own UI (asista-ui), or you can build your own using the asista services provided by asista-core.

The Asista SDK for Android is divided into two main modules – asista-core and asista-ui. The asista-core provides asista functionalities without a UI, i.e., you can make service requests through asista-core from your own UI and receive the response back to where the request was made. Through asista-ui we provide you with UI which includes all of the asista SDK’s features. asista-ui makes use of asista-core to make service requests and populates the UI with the received response.

Features of asista SDK

  • Register & Authenticate with asista.
  • View Knowledge Base content.
  • Create/update tickets.
  • List user tickets.
  • List user Assets.

Getting Started

Gradle based project

Add the following Bintray maven repository url to your project’s(root) build.gradle file.

allprojects {
    repositories {
        ....
        maven { url 'https://dl.bintray.com/asista/asista-sdk-android' }
    }
}

The SDK uses some Java 8 features. Make sure to add the following to the module’s (app) build.gradle file.

android{
...
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

asista SDK uses a few external libraries as well, so add the following dependencies to your module’s (app) build.gradle file.

To include asista-core

dependencies {
         implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
         implementation 'com.squareup.retrofit2:retrofit:2.4.0'
         implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

         //dependency for asista-core
         implementation 'com.asista:asista-core:1.0.0'
}

To include asista-ui

dependencies {
         //include dependencies for asista-core
        implementation 'com.android.support:design:27.1.1'
         implementation 'de.hdodenhof:circleimageview:2.2.0'
         implementation 'com.github.markomilos:paginate:0.5.1'
         implementation 'pub.devrel:easypermissions:1.1.1'
         implementation 'com.github.bumptech.glide:glide:4.6.1'
        
         //dependency for asista-ui
         implementation 'com.asista:asista-ui:1.0.0'
}

NOTE: To use asista-ui the project must also include asista-core, since asista-ui makes use of asista-core functionalities.

Using asista SDK

Following the previous steps ‘asista SDK’ is now integrated into your app and can be used.

Initialize asista SDK

To be able to use the asista SDK, the SDK has to be initialized with three values.

  • TenantUrl : url to access the registered asista Application.
  • AppId : unique Id given to the registered Application.
  • AppSecret : Unique Secret given for the registered Application.


These values can be initialized in two ways:

1.  Adding asista properties as string resources:

Add values (Tenant’s Url, AppKey & AppSecret) as string values in the application’s string resource file (strings.xml).

NOTE: If your project does not have a strings.xml file under project(app) > res > values folder, create a Values resource file and name it ‘strings.xml’ file, and add the following values.

strings.xml

<resources>
  <string name=”TENANT_URL”>{tenant_url}</string>
  <string name=”APP_KEY”>{app_key}</string>
  <string name=”APP_SECRET”>{app_secret}</string>
</resources>

NOTE: Make sure to use the same string names.

After adding the string resources, from your Application/Activity call AsistaCore.init(Context)(under asista-core > core package) to set the values to the SDK.

AsistaCore.init(MainActivity.this);        

2. Initializing using AsistaProperties (under asista-core > core > model package) instance

From your Application/Activity populate an instance of AsistaProperties with values(Tenant’s Url, AppKey & AppSecret).

AsistaProperties properties = new AsistaProperties();
properties.setTenantUrl(TENANT_URL);
properties.setAppKey(APP_KEY);
properties.setAppSecret(APP_SECRET);

From your application/activity call the AsistaCore.init(AsistaProperties)(under asista-core > core package)  by passing the populated AsistaProperties(under asista-core > core > model package)instanceas parameter to set  the values to AsistaCore.

AsistaCore.init(properties); 

NOTE: Anyone of the two AsistaCore.init() method needs to be called before using anyother function of the sdk.

Minimum Android version

The minimum Android version supported by asista is 15.

Permissions needed by asista SDK

asista Android SDK requires the following permissions

  • INTERNET
  • WRITE_EXTERNAL_STORAGE
  • READ_EXTERNAL_STORAGE
  • CAMERA
  • ACCESS_NETWORK_STATE

NOTE: Make sure to add the above permissions in your AndroidManifest.xml

Additional Configuration

If you are using Progaurd, you will need to add the following to your project’s proguard-project.txt file.

 -keep class android.support.v7.widget.SearchView { *; }
-keep class android.support.** { *; }
-keep interface android.support.** { *; }

-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn retrofit2.Platform$Java8
-dontwarn com.googlecode.mp4parser.**

-dontwarn org.xmlpull.v1.**
-dontwarn okhttp3.**
-keep class okhttp3.** { *; }

-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-dontwarn javax.annotation.GuardedBy
-dontwarn java.lang.invoke.**

# Platform calls Class.forName on types which do not exist on Android to determine platform.
#-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

Excepted Errors

1. project build failure

Since few java 8 features have been used in the SDK the following errors might occur during project build:

Invoke-customs are only supported starting with Android O (–min-api 26)
Message{kind=ERROR, text=Invoke-customs are only supported starting with Android O (–min-api 26), sources=[Unknown source file], tool name=Optional.of(D8)}

(or)

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\asista-ui-0.1.49.aar\12a960b591c01c157f20c6fb0aeb7f29\jars\classes.jar

(or)

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.

(or)

Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

(or)

Caused by: com.android.tools.r8.utils.AbortException

Solution

Add the following to the module level build.gradle file:

android {
                
.....

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

2. Crash due to missing color attribute

This crash occurs due to a missing color attribute value.

error: style attribute ‘attr/textColorError (aka com.thinkfactory.android.asistalibtestapk:attr/textColorError)’ not found.

Solution

Create a new xml file <your_app_module>/src/main/res/values/apptentive-attrs.xml with the following content:

Apptentive-attrs.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="ApptentiveThemeTemplate">
        <attr name="textColorError" format="color|reference"/>
    </declare-styleable>
</resources>

Authentication

Almost all asista functionalities can be performed only on successful authentication with asista.

After successfully including the asista SDK to your project and intializing the asista-core with the required asista properties (tenant url, appId, appSecret), based on your requirement user ‘registration’ or ‘authentication’ can be performed.

Accessing through AsistaCore

Registering a new user

New Users can be registered by calling the register() function of the AuthService class in asista-core.

Declaration

AsistaCore.getInstance().getAuthService().register(properties, callback);
Name Type Comment
properties RegisterProperties Register model object
Callback Callback<Boolean> The callback invoked when the request is either successful or has failed. If registeration is successful then success(true) will be returned to the onSuccess() of the callback, else an exception will be returned to the onFailed() of the callback.

Usage:

RegisterProperties properties = new RegisterProperties();
properties.setFirstName("Mark");
properties.setUserId("9975586938");
properties.setPhone("9975586938");
properties.setLastName("Zoe");                  //optional
properties.setEmail("Mark990@gmail.com");       //optional

AsistaCore.getInstance().getAuthService().register(properties, new Callback<Boolean>() {
            @Override
            public void onSuccess(Result<Boolean> result) {
                //handle registration success
            }
            @Override
            public void onFailed(AsistaException e) {
                //handle registration failure
            }
})
User Authentication

Once user registration is successful, user authentication can be done by calling  the authenticate() function of the AuthService class in asista-core.

Declaration

AsistaCore.getInstance().getAuthService().authenticate(activity, userId, callback);
Name Type Comment
Activity Activity instance of the class extending to Activity.
userId String userId used during user registration
callback Callback<Boolean> The callback invoked when the request is either successful or has failed, if authentication is successful then success(true) will be returned to onSuccess() of the callback, else an exception will be returned to the onFailed() of the callback

Logo of a registered asista application can be fetched by calling the fetchTenantLogo() function of the AuthService class in asista-core.

Declaration

AsistaCore.getInstance().getAuthService().fetchTenantLogo(activity, tenantImageUrl, callback);
Name Type Comment
activity Activity instance of the class extending to Avtivity.
tenantImageUrl String userId used during user registration
callback Callback<Bitmap> The callback invoked when the request is either successful or has failed, if the fetch is successful the logo(Bitmap) will be returned to the onSuccess(Result<Bitmap> result) of the callback, and result.data would return the bitmap. If the fetch fails then an exception will be returned to the onFailed() of the callback.
SignOut User

User can be signedOut by calling the signOutUser() function of the AuthService class in asista-core.

Declaration:

AsistaCore.getInstance().getAuthService().signOutUser(activity, callback);
Name Type Comment
activity Activity instance of the class extending to Avtivity.
callback Callback<Boolean> The callback invoked when the request is either successful or has failed, if the fetch is successful then success(true) will be returned to the onSuccess() of the callback, else an exception will be returned to the onFailed() of the callback.

KnowledgeBase

Through the KnowledgeBase you can provide your customers with the information they want, you can publish documentation about pricing, features, services, frequent problems, and anything else you want to share about your app or business. Using the Asista SDK you can show a localised FAQ/Help to your customers, filter its contents to be more helpful to their specific use case

Knowledge Base can be accessed with and without authentication, when accessed without authentication the public KnowledgeBase content is accessible, whereas after successful authentication the authenticated Knowledge-base can be accessed.

Accessing through AsistaUi

The KB UI that is provided with the Asista SDK looks like this: 

KB Topics, KB Articles & KB Article
Display KnowledgeBase:

A page with KnowledgeBase Topics can be shown by calling the showKnowledgeBase() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showKnowledgeBase(activity);
Name Type Comment
activity Activity Context of the calling activity
Display Article List

A page with articles of a particular KnowledgeBase Topic can be shown by calling the showKbArticles() function of AsistaUi class in asista-ui.

Declaration

AsistaUi.showKbArticles(context, kbTopicId);
Name Type Comment
activity Activity Context of the calling activity
kbTopicId String Id of the KB Topic for which articles will be fetched.
Display Single Article

A page with the content of a particular KnowledgeBase Article can be shown by calling the showSingleArticle() function of AsistaUi class of asista-ui.

Declaration

AsistaUi.showSingleArticle(context, articleId);
Name Type Comment
activity Activity Context of the calling activity
articleId String Id of the KB Article for which content will be fetched.

Accessing through AsistaCore

Fetch KB Topics

KB Topics can be fetched by calling the fetchKbTopics() functionof the KbService class in asista-core.

Declaration

AsistaCore.getInstance().getKbService().fetchKbTopics(callback);
Name Type Comment
callback Callback<List<TopicDetails>> The callback invoked when the request is either successful or has failed, if the fetch is successful then KB topics list( I.e., List<TopicDetails>)  will be returned to the onSuccess(Result<List<TopicDetail>> result) of the callback, and result.data would return the KB topics list. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch KB Articles

The articles available under a particular KB Topic can be fetched by calling the fetchKbArticles() functionof the KbService class in asista-core.

Declaration

AsistaCore.getInstance().getKbService().fetchKbArticles(topicId, callback);
Name Type Comment
topicId String              Id of the KB Topic for which the KB Articles will be fetched.
callback Callback<KBArticles> The callback invoked when the request is either successful or has failed, if the fetch is successful then a list of KB articles model object will be returned to the onSuccess(Result<KBArticles> result) of the callback, and result.data would return the KBArticles model object from which the article list can be obtained. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Search KB Articles

A search on all available KB Articles can be done by calling the searchKbArticles() functionof the KbService class in asista-core.

Declaration

AsistaCore.getInstance().getKbService().searchKbArticles(query, callback);
Name Type Comment
Query String              Search query based on which KB Articles will be searched.
callback Callback<List<ArticleSearchResponse>> The callback invoked when the request is either successful or has failed, if the search is successful then a list of KB articles will be returned to the onSuccess(Result<List<ArticleSearchResponse>> result) of the callback, and result.data would return the KBArticles list. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch Article Content

A particular KB Article’s content can be fetched by calling the fetchArticleContent() functionof the KbService class in asista-core.

Declaration

AsistaCore.getInstance().getKbService().fetchArticleContent(articleId, callback);
Name Type Comment
articleId String              Id of the KB Article for which the content will be fetched.
callback Callback<ArticleContent> The callback invoked when the request is either successful or has failed, if the fetch is successful then the KB Article Content will be returned to the onSuccess(Result<ArticleContent> result) of the callback, and result.data would return the KB Article’s Content. Else if the fetch fails an exception will be returned to the onFailed() of the callback.

Assets

Assets are properties (items) that assigned to users. Using the Asista SDK, your users are able to see their list of assets and their details.

User’s assets related functions can be used only after successful user authentication.

Accessing through AsistaUi

The Asset UI that is provided with the Asista SDK looks like this:   

Assets List & Asset Details
Display Assets

A page with user’s Assets can be shown by calling the showAssets() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showAssets(activity);
Name Type Comment
activity Activity Context of the calling activity
Display Single Asset Details

A page with user’s  Assets can be shown by calling the showSingleAsset() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showSingleAsset(activity, assetId);
Name Type Comment
activity Activity Context of the calling activity
assetId Int Id of the asset for which the details should be fetch.

Accessing through AsistaCore

Fetching asset categories

Assets categories can be fetched by calling the fetchAssetCategories() functionof the AssetService class in asista-core.

Declaration

AsistaCore.getInstance().getAssetService().fetchAssetCategories(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<AssetCategory>> The callback invoked when the request is either successful or has failed, if the fetch is successful then a list of asset categories will be returned to the onSuccess(Result<List<AssetCategory>> result) of the callback, and result.data would return the list of asset categories. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetching asset types

Assets types can be fetched by calling the fetchAssetTypes() functionof the AssetService class in asista-core.

Declaration

AsistaCore.getInstance().getAssetService().fetchAssetTypes(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback< List<AssetType>> The callback invoked when the request is either successful or has failed, if the fetch is successful then a list of asset types will be returned to the onSuccess(Result<List<AssetType>> result) of the callback, and result.data would return the list of asset types. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetching Assets (without limiting the number of  assets to be fetched)

Assets can be fetched by calling the fetchAllAssets() functionof the AssetService class in asista-core. There are two overloading fetchAllAssets() methods to fetch assets based on query(search query), assetCategoryId, assetModelId.

Declaration

AsistaCore.getInstance().getAssetService().fetchAllAssets(activity, callback);
AsistaCore.getInstance().getAssetService().fetchAllAssets(activity, query, assetCategoryId, assetModelId, callback);
Name Type Comment
activity Activity Context of the calling activity
Query String Search query to filter assets
assetCategoryId Integer Id of assetCategory
assetModelId Integer Id of assetModel
callback Callback<AssetsFetchResponse> The callback invoked when the request is either successful or has failed, if the fetch is successful then AssetDetails model object will be returned to the onSuccess(Result<AssetDetails> result) of the callback, and result.data would return the AssetDetails model object from which the asset list can be obtained. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetching Assets (limiting the number of assets to be fetched)

Assets can be fetched by calling the fetchAssets() functionof the AssetService class in asista-core. There are six overloading fetchAssets() methods to fetch assets based on query(search query), assetCategoryId, assetModelId, assetsFrom & assetsTo(for fetching assets within a specified range).    

Declaration

AsistaCore.getInstance().getAssetService().fetchAssets(activity, callback);
AsistaCore.getInstance().getAssetService().fetchAssets(activity, query, callback);
AsistaCore.getInstance().getAssetService().fetchAssets(activity, assetCategoryId, callback);
AsistaCore.getInstance().getAssetService().fetchAssets(activity, assetCategoryId, assetModelId, callback);
AsistaCore.getInstance().getAssetService().fetchAssets(activity, query, assetsFrom, assetsTo, callback);
AsistaCore.getInstance().getAssetService().fetchAssets(activity, query, assetsFrom, assetsTo, assetCategoryId, assetModelId, callback);
Name Type Comment
activity Activity Context of the calling activity
Query String Search query to filter assets
assetsFrom Integer Starting index of the asset list to be fetched
assetsTo Integer Ending index of the asset list to be fetched
assetCategoryId Integer Id of assetCategory
assetModelId Integer Id of assetModel
callback Callback<AssetsFetchResponse> The callback invoked when the request is either successful or has failed, if the fetch is successful then AssetsFetchResponse model object will be returned to the onSuccess(Result<AssetsFetchResponse> result) of the callback, and result.data would return the AssetsFetchResponse model object from which the asset list can be obtained. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetching details of a particular Asset

The details of a particular asset can be fetched by calling the fetchAssetDetails() functionof the AssetService class in asista-core.

Declaration

AsistaCore.getInstance().getAssetService().fetchAssetDetails(activity, assetId,callback);
Name Type Comment
activity Activity            Context of the calling activity
topicId String              Id of the KB Topic for which the KB Articles will be fetched.
callback Callback<AssetEachDetail> The callback invoked when the request is either successful or has failed, if the fetch is successful then a AssetDetails model object will be returned to the onSuccess(Result<AssetEachDetail> result) of the callback, and result.data would return the asset details. Else if the fetch fails an exception will be returned to the onFailed() of the callback.

Tickets

Using the Asista SDK, your users can create new tickets, list them and update existing ones. Users can also see agents , comments on a ticket like a chat between agent and user and other ticket information.

Ticket related functions can be used only on successful user authentication.

Accessing through AsistaUi

Various Ticket related UI provided with the Asista SDK looks like this:   

Ticket Creation, Tickets List & Ticket Detail
Add Comment, Ticket State Update & Ticket Priority Update
Ticket Information, Filter Tickets & Search Tickets
Display Ticket Creation Page

Ticket creation page can be shown by calling the showTicketCreation() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showTicketCreation(activity);
Name Type Comment
activity Activity Context of the calling activity
Display Ticket List

Ticket list page can be shown by calling the showUserTickets() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showUserTickets(activity);
Name Type Comment
activity Activity Context of the calling activity
Display Single Ticket

Details of a ticket can be shown by calling the showSingleTicket() function of the AsistaUi class in asista-ui.

Declaration

AsistaUi.showSingleTicket(activity, ticketId);
Name Type Comment
activity Activity Context of the calling activity
ticketId String Id of the ticket for which the details will be fetched

Accessing through AsistaCore

Fetch Ticket Fields

Form fields can be fetched by calling the fetchTicketFields() functionof the TicketService class in asista-core.

Declaration

AsistaCore.getInstance().getTicketService().fetchTicketFields(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<SubmitTicketConfig>> The callback invoked when the request is either successful or has failed, if the fetch is successful then a list of form fields(i.e., List<SubmitTicketConfig>) will be returned to the onSuccess(Result<List<SubmitTicketConfig>> result) of the callback, and result.data would return the list of form fields. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch Ticket Categories

Ticket categories can be fetched by calling the fetchCategoryList() functionof the TicketService class in asista-core.

Declaration

AsistaCore.getInstance().getTicketService().fetchCategoryList(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<CategoryDetails>> The callback invoked when the request is either successful or has failed, if the fetch is successful then a list of ticket categories(i.e., List<CategoryDetails>) will be returned to the onSuccess(Result<List<CategoryDetails>> result) of the callback, and result.data would return the list of ticket categories. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Creating a Ticket

Ticket can be created by calling the createTicket() functionof the TicketService class in asista-core.

Declaration

AsistaCore.getInstance().getTicketService().createTicket(activity, createRequestDetails, callback);
Name Type Comment
activity Activity            Context of the calling activity
createRequestDetails CreateRequestDetails Data(form data) required for ticket creation
Callback Callback<Boolean > The callback invoked when the request is either successful or has failed, if the fetch is successful then success(true) will be returned to the onSuccess(Result<Boolean> result) of the callback, else an exception will be returned to the onFailed() of the callback.
Fetch Single Ticket

Details of a ticket can be fetched by calling the fetchTicketDetails() functionof the TicketService class in asista-core.

Declaration

AsistaCore.getInstance().getTicketService().fetchTicketDetails(activity, ticketId, callback);
Name Type Comment
activity Activity            Context of the calling activity
ticketId String Id of the ticket for which the details will be fetched.
callback Callback<RequestDetails> The callback invoked when the request is either successful or has failed, if the fetch is successful then the ticket details will be returned to the onSuccess(Result<RequestDetails> result) of the callback, and result.data would return the ticket details. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Add Comment to a Ticket

A comment to a particular ticket can be added by calling the addComment() functionof the TicketService class in asista-core.

Declaration

AsistaCore.getInstance().getTicketService().addComment(activity, ticketId, comment, attachmentList, callback);
Name Type Comment
activity Activity            Context of the calling activity
ticketId String Id of the ticket for which the details will be fetched.
comment String Comment to be added
attachmentList List<Attachment> Attachments added to the comment.
callback Callback<Boolean> The callback invoked when the request is either successful or has failed, if the comment addition is successful then success(true) will be returned to the onSuccess(Result<Boolean> result) of the callback, else an exception will be returned to the onFailed() of the callback.
Fetch dashboard count details

Dashboard count details can be fetched by calling the fetchDashboardCountDetails() functionof the MyTicketService class in asista-core.

Declaration

AsistaCore.getInstance().getMyTicketService().fetchDashboardCountDetails(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<DashboardCounter>> The callback invoked when the request is either successful or has failed, if the fetch is successful then the dashBoard count details(i.e., List<DashBoardCounter>) will be returned to the onSuccess(Result<List<DashboardCounter>> result) of the callback, and result.data would return the count details list. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch Ticket List

User Tickets can be fetched by calling the fetchTickets() functionof the MyTicketService class in asista-core. There are four overloading fetchTickets() methods to fetch user tickets based on requestStateId, ticketsFrom & ticketsTo(to fetch tickets within specified range). 

Declaration

AsistaCore.getInstance().getMyTicketService().fetchTickets(activity, callback);
AsistaCore.getInstance().getMyTicketService().fetchTickets(activity, requestStateId, callback);
AsistaCore.getInstance().getMyTicketService().fetchTickets(activity, ticketsFrom, ticketsTo, callback);
AsistaCore.getInstance().getMyTicketService().fetchTickets(activity,ticketsFrom, ticketsTo, requestStateId, callback);
Name Type Comment
activity Activity            Context of the calling activity
requestStateId Integer Id of the ticket-State based on which the tickets will be filtered
ticketsFrom Integer Starting index of the ticket list to be fetched
ticketsTo Integer Ending index of the ticket list to be fetched
callback Callback<MyTicketResponse > The callback invoked when the request is either successful or has failed, if the fetch is successful then MyTicketResponse model object will be returned to the onSuccess(Result<MyTicketResponse> result) of the callback, and result.data would return the MyTicketResponse object from which the ticket list can be obtained. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Search Tickets

User tickets can be Searched by calling the SearchTickets() functionof the MyTicketService class in asista-core.

Declaration

AsistaCore.getInstance().getMyTicketService().SearchTickets(activity, query, callback);
Name Type Comment
activity Activity            Context of the calling activity
query String Search query based on which tickets will be searched.
callback Callback<List<DashboardCounter>> The callback invoked when the request is either successful or has failed, if the search is successful then the ticket list(i.e., List<MyTicketData.Payload>) will be returned to the onSuccess(Result<List<MyTicketData.Payload>> result) of the callback, and result.data would return the ticket list. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Filter Tickets

Based on the ticket State and Prioirity User tickets can be Filtered by calling the fetchFilteredTickets() functionof the MyTicketService class in asista-core.

Declaration

AsistaCore.getInstance().getMyTicketService().fetchFilteredTickets(activity, priority, state, callback);
Name Type Comment
activity Activity            Context of the calling activity
priority Integer Priority Id to filter tickets.
state Integer State Id to filter tickets.
callback Callback<FilterDetails> The callback invoked when the request is either successful or has failed, if the fetch is successful then the FilterDetails model objectwill be returned to the onSuccess(Result<FilterDetails> result) of the callback, and result.data would return the FilterDetails model object from which the ticketList can be obtained . Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch Priority List

Ticket priorities can be Fetched by calling the fetchPriorityList() functionof the PriorityService class in asista-core.

Declaration

AsistaCore.getInstance().getPriorityService().fetchPriorityList(activity  callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<PriorityDetails>> The callback invoked when the request is either successful or has failed, if the fetch is successful then the list of priorities(i.e., List<PriorityDetails>)will be returned to the onSuccess(Result<List<PriorityDetails>> result) of the callback, and result.data would return the priority List. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Update Ticket Priority

Ticket priority can be updated by calling the updateTicketPriority() functionof the PriorityService class in asista-core.

Declaration

AsistaCore.getInstance().getPrioritytService().updateTicketPriority(activity, requestId, priorityId, callback);
Name Type Comment
activity Activity            Context of the calling activity
requestId Integer Id of the ticket for which the priority will be updated
priorityId Integer Id of the priority to which the ticket has to be updated.
callback Callback<Boolean> The callback invoked when the request is either successful or has failed, if the update is successful then success(true)will be returned to the onSuccess(Result<Boolean> result) of the callback, else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch State List

Ticket states can be Fetched by calling the fetchStateList() functionof the StateService class in asista-core.

Declaration

AsistaCore.getInstance().getStateService().fetchStateList(activity, callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<List<WorkflowState>> The callback invoked when the request is either successful or has failed, if the fetch is successful then the list of states(i.e., List<WorkflowState>)will be returned to the onSuccess(Result<List<WorkflowState>> result) of the callback, and result.data would return the statesList. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Fetch WorkFlow States

Workflow states for a particular ticket can be Fetched by calling the fetchWorkFlowStates() functionof the StateService class in asista-core.

Declaration

AsistaCore.getInstance().getStateService().fetchWorkFlowStates(activity, ticketId,  callback);
Name Type Comment
activity Activity            Context of the calling activity
ticketId String Id of the ticket for which the worflow states will be fetched.
callback Callback<List<WorkflowState>> The callback invoked when the request is either successful or has failed, if the fetch is successful then the list of states(i.e., List<WorkflowState>)will be returned to the onSuccess(Result<List<WorkflowState>> result) of the callback, and result.data would return the ticket’s workflow states List. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Update Ticket State

State of a particular ticket can be Updated by calling the UpdateTicketState() functionof the StateService class in asista-core.

Declaration

AsistaCore.getInstance().getStateService().UpdateTicketState(activity, requestId, stateId, stateUpdateRemark, callback);
Name Type Comment
activity Activity            Context of the calling activity
requestId String Id of the ticket for which the worflow states will be fetched.
stateId Integer Id of the state to which the ticket has to be updated to.
stateUpdateRemark String remark(note) entered for the state change.
callback Callback<Boolean> The callback invoked when the request is either successful or has failed, if the update is successful then success(true)will be returned to the onSuccess(Result<Boolean> result) of the callback, else an exception will be returned to the onFailed() of the callback.
Fetch Attachment Properties

Attachment properties can be Fetched by calling the fetchAttachmentProperties() functionof the AttachmentService class in asista-core.

Declaration

AsistaCore.getInstance().getAttachmentService().fetchAttachmentProperties(activity,
callback);
Name Type Comment
activity Activity            Context of the calling activity
callback Callback<FileProperties> The callback invoked when the request is either successful or has failed, if the fetch is successful then the fileProperties will be returned to the onSuccess(Result<FileProperties> result) of the callback, and result.data would return the fileProperties. Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Upload Attachment (Ticket and Comment)

Attachment can be Uploaded by calling the uploadAttachment() functionof the AttachmentService class in asista-core.

Declaration

AsistaCore.getInstance().getAttachmentService().uploadAttachment(activity, filePath, callback);
Name Type Comment
activity Activity            Context of the calling activity
filePath String Path to the attachment file.
callback Callback<Attachment> The callback invoked when the request is either successful or has failed, if the upload is successful then a response Attachment model objectwill be returned to the onSuccess(Result<Attachment> result) of the callback, and result.data would return the Attachment object from which the uploaded attachment’s ’id’ and ‘url’(server file url). Else if the fetch fails an exception will be returned to the onFailed() of the callback.
Download Attachment (Ticket and Comment)

Attachment can be Downloaded by calling the downloadAttachment() functionof the AttachmentService class in asista-core. The attachment will be downloaded to the internal storage of the device and then the path to the downloaded file will be returned, attachments will be saved under Internal Storage > Asista > Attachments folder.

Declaration

AsistaCore.getInstance().getAttachmentService().downloadAttachment(fileUrl, callback);
Name Type Comment
fileUrl String              url of the file to  be downloaded
callback Callback<String> The callback invoked when the request is either successful or has failed, if the upload is successful then filePath will be returned to the onSuccess(Result<String> result) of the callback, and result.data would return the path to the downloaded file. Else if the fetch fails an exception will be returned to the onFailed() of the callback.



View Demo App based on Asista Android SDK here.