Case & Topic

Get Available Topics

You can get the list of available topics by calling getTopicList.

YourActivity.java
import io.taptalk.taptalklive.TapTalkLive;
import io.taptalk.taptalklive.Listener.TTLGetTopicListListener;

...

TapTalkLive.getTopicList(new TTLGetTopicListListener() {
    @Override
    public void onSuccess(List<TTLTopicModel> topics) {
        // Successfully fetched topics
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
        
    }
});

Get Active User's Case List

To use this method, you need to first finish authentication process.

Once authenticated, you can obtain the active user's case list by calling getUserCaseList.

YourActivity.java
import io.taptalk.taptalklive.TapTalkLive;
import io.taptalk.taptalklive.Listener.TTLGetCaseListListener;

...

TapTalkLive.getUserCaseList(new TTLGetCaseListListener() {
    @Override
    public void onSuccess(List<TTLCaseModel> cases) {
        // Successfully fetched user cases
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
        
    }
});

Create a New Case

To use this method, you need to first finish authentication process.

Once authenticated, you can create a new case for the user by calling createNewCase, providing the topic ID and first message.

YourActivity.java
import io.taptalk.taptalklive.TapTalkLive;
import io.taptalk.taptalklive.Listener.TTLCreateCaseListener;

...

TapTalkLive.createNewCase(TOPIC_ID, FIRST_MESSAGE, new TTLCreateCaseListener() {
    @Override
    public void onSuccess(TTLCaseModel caseModel) {
        // Successfully created a new case
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
        
    }
});

Parameters TOPIC_ID: (int) ID of the selected topic, can be obtained from getTopicList FIRST_MESSAGE: (String) message to be sent by the user to start a case

Last updated