> For the complete documentation index, see [llms.txt](https://docs.sharelogic.com/unifi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sharelogic.com/unifi/3.1/how-to-guides/how-to-handle-attachments/test-addattachment.md).

# Test AddAttachment

{% hint style="success" %}
If necessary, create at least one bonded record in order to test the AddAttachment Message.
{% endhint %}

## Update Bonded Record (Originating Instance)

In the originating instance, **select one** **bonded ticket** and **Add** an **attachment** to the record .

![](/files/pwamRUvIm3UYvwH1AS88)

## Review Outbound Transport Data

From the bonded record, navigate to the **Unifi Integrations related list** and click to **open** the **Bond**.

![](/files/8bkSD7wh4ivxvzQE6dVV)

{% hint style="success" %}
The External reference is populated.  The State is "Open" and the Status is "OK".
{% endhint %}

From the Bond, navigate to the following related lists:

Navigate to the **Bonded Attachments related list** and verify that a **Bonded Attachment** record has been **created**.

![](/files/6YNENSYMqMyAU0T342mG)

{% hint style="success" %}
The State is "Complete".
{% endhint %}

Navigate to the **Transactions related list** and click to **open** the **AddAttachment Transaction**.

![](/files/5kvuNB0POc6DosQLTrVd)

{% hint style="success" %}
The Transaction state is "Complete" and the Process state is "Accepted".
{% endhint %}

From the Transaction, navigate to the **HTTP Requests related list** and click to **open** the **HTTP Request**.

![](/files/SPItNACjDjqwhGxrQtYR)

{% hint style="success" %}
The Request state is "OK".
{% endhint %}

Note the following about the HTTP Request:

![](/files/8ya1G8e9lnsWZdLXeRhj)

{% hint style="success" %}
**Endpoint URL**: A concatenation of the Connection URL appended with the [Path](broken://pages/-MlF11qsQnsdZIO6UG3k#outbound-settings-fields) defined on the Message.

**Request headers**\*: Contains the mime\_type.

**Request payload**\*: The payload contains the "sys\_attachment:\<sysid>" (the format which Unifi expects & automatically triggers outbound streaming).

\*These  objects were defined in the [Stage to Request script](broken://pages/-MlF11qsQnsdZIO6UG3k#stage-to-request-outbound).
{% endhint %}

{% hint style="info" %}
You will never see the attachment data in the payload itself.
{% endhint %}

## View Bonded Record (Receiving Instance)

In the receiving instance, navigate to the **corresponding** **bonded ticket** and verify the **attachment** has been **added** to the record.

![](/files/Uz0EIiWbiAsrAb5lPWqq)

{% hint style="success" %}
The attachment has been added to the bonded record.
{% endhint %}

## Review Inbound Transport Data

From the bonded record, navigate to the **Unifi Integrations related list** and click to **open** the **Bond**.

![](/files/Wl36BCXUZZtmOwqL2mDN)

{% hint style="success" %}
The External reference is populated *(note: the Internal/External reference values are opposite to the originating bond)*.  The State is "Open" and the Status is "OK".
{% endhint %}

From the Bond, navigate to the following related lists:

Navigate to the **Bonded Attachments related list** and verify that a **Bonded Attachment** record has been **created**.

![](/files/U2z0xr9622LbETi6hitF)

{% hint style="success" %}
The State is "Complete".
{% endhint %}

Navigate to the **Transactions related list** and click to **open** the **AddAttachment Transaction**.

![](/files/MTJ7XRcaCGXpq85GSGDT)

{% hint style="success" %}
The Transaction state is "Complete" and the Process state is "Accepted".
{% endhint %}

From the Transaction, navigate to the **HTTP Requests related list** and click to **open** the **HTTP Request**.

![](/files/Ffwv3lhqMIfyuECONcRP)

{% hint style="success" %}
The Request state is "OK".
{% endhint %}

Note the following about the HTTP Request:

![](/files/tA1JuvaZN7WJySH16QF0)

{% hint style="success" %}
**Endpoint URL**: This is defined on the Resource path of the automatically generated Scripted REST Resource.

**Request payload**: The payload structure is defined in the [Scripted REST Resource script](broken://pages/-MlF1G5z0vvRrAokLihc#attachment-resource).
{% endhint %}

**Congratulations!**  You have successfully configured & tested a dedicated Message to stream inbound and outbound attachments.
