# Support Tools Integration

To debug support tickets effortlessly, all you have to do is extract the session URL from Luciq and send it as a custom attribute to your preferred support tools. This enables your support team to view Session Replays for every issue reported, assisting in the debugging process. You can use the below API to extract the session URL.

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
val callback = object: OnSessionReplayLinkReady{
    override fun onSessionReplayLinkReady(link: String?){
        //TODO: Do something with the link
    }
}
// or
val callback = {link: String? -> 
    //TODO: Do something with the link
}


SessionReplay.getSessionReplayLink(callback)

// or

SessionReplay.getSessionReplayLink{link->
    //TODO: Do something with the link
}
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
OnSessionReplayLinkReady callback = new OnSessionReplayLinkReady() {
    @Override
    public void onSessionReplayLinkReady(@Nullable String id) {
        //TODO: Do something with the link     
    }
};

SessionReplay.getSessionReplayLink(callback)

// or

SessionReplay.getSessionReplayLink((String)->{
    //TODO: Do something with the link
})
```

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

#### Zendesk Example

To automatically attach the session URL to every support ticket submitted through Zendesk, insert the following snippet into your application's code.

![](https://files.readme.io/396c47e-image.png)

#### ***Send Session URLs as tags:***

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
var zendeskRequest: CreateRequest? = null
SessionReplay.getSessionReplayLink { replayLink ->
     zendeskRequest = CreateRequest().apply {
        subject = "Session replay"
        description = "Adding session replay url"
        tags = listOf(replayLink)
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
CreateRequest zendeskRequest = new CreateRequest();
SessionReplay.getSessionReplayLink((replayLink) -> {
    zendeskRequest.setSubject("Session replay");
    zendeskRequest.setDescription("Adding session replay url");
    zendeskRequest.setTags(Collections.singletonList(replayLink));
});
```

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

***Send Session URLs as custom fields:***

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
var zendeskRequest: CreateRequest? = null
SessionReplay.getSessionReplayLink { replayLink ->
        zendeskRequest = CreateRequest().apply {
            subject = "Session replay"
            description = "Adding session replay url"
            val field = CustomField(1234, replayLink)
            customFields = listOf(field)
        }
}
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
CreateRequest zendeskRequest = new CreateRequest();
SessionReplay.getSessionReplayLink((replayLink) -> {
    zendeskRequest.setSubject("Session replay");
    zendeskRequest.setDescription("Adding session replay url");
    CustomField linkField = new CustomField(1234L, replayLink);
    zendeskRequest.setCustomFields(Collections.singletonList(linkField));
});
```

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

#### Intercom Example

To automatically include the Session URL with each support ticket received via Intercom, integrate the following code snippet into your application. This will send the session URL to the recent events section.

![](https://files.readme.io/96eaa38-image.png)

{% tabs %}
{% tab title="Kotlin" %}
{% code overflow="wrap" %}

```kotlin
SessionReplay.getSessionReplayLink { replayLink ->
            Intercom.client().apply {
                logEvent("session-replay-url", mapOf("url" to replayLink))
                present()
            }
        }
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code overflow="wrap" %}

```java
SessionReplay.getSessionReplayLink((replayLink) -> {
    Intercom client = Intercom.client();
    client.logEvent("session-replay-url", Collections.singletonMap("url", replayLink));
    client.present();
});
```

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


---

# 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.luciq.ai/android/set-up-luciq-for-android/set-up-session-replay/support-tools-integration.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.
