# Case & Topic

### Get Available Topics

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

{% tabs %}
{% tab title="Objective-C" %}
{% code title="YourViewController.m" %}

```csharp
#import <TapTalkLive/TapTalkLive.h>

[[TapTalkLive sharedInstance] getTopicListWithSuccess:^(NSArray<TTLTopicModel *> *topicListArray) {
    // Successfully fetched topics
}
failure:^(NSError *error) {
    
}];
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Get Active User's Case List

To use this method, you need to first finish [authentication](/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-ios/authentication.md#authenticate-user-optional) process.

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

{% tabs %}
{% tab title="Objective-C" %}
{% code title="YourViewController" %}

```csharp
#import <TapTalkLive/TapTalkLive.h>

[[TapTalkLive sharedInstance] getUserCaseListListWithSuccess:^(NSArray<TTLCaseModel *> *caseListArray) {
    // Successfully fetched user cases
}
failure:^(NSError *error) {
    
}];
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Create a New Case

To use this method, you need to first finish [authentication](/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-ios/authentication.md#authenticate-user-optional) process.

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

{% tabs %}
{% tab title="Objective-C" %}
{% code title="YourViewController" %}

```csharp
#import <TapTalkLive/TapTalkLive.h>

[[TapTalkLive sharedInstance] createNewCaseWithTopicID:TOPIC_ID
                                          firstMessage:FIRST_MESSAGE
success:^(TTLCaseModel *caseModel) {
    // Successfully created a new case
}
failure:^(NSError *error) {
    
}];
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Parameters**\
\&#xNAN;**`TOPIC_ID`**: (String) ID of the selected topic, can be obtained from [**`getTopicList`**](#get-available-topics)\
\&#xNAN;**`FIRST_MESSAGE`**: (String) message to be sent by the user to start a case
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-ios/case-and-topic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
