> 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/4.2/configure/how-to-guides/how-to-handle-attachments/test-addattachment.md).

# Test AddAttachment

Follow these steps to test the AddAttachment Message.

{% 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 .

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/xEiKLLpk8m8WhN1DEp4C/HTHAG%20-%20Test%20AddAttachment%201.png)

## Review Outbound Transport Data

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

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/2pcxW89B7XqDP3KNdAR0/HTHAG%20-%20Test%20AddAttachment%202.png)

{% 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**.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/SiPXfioGWZhq4qTXxUAM/HTHAG%20-%20Test%20AddAttachment%203.png)

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

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

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/R1BdGtKQvRtkvqd7KvYu/HTHAG%20-%20Test%20AddAttachment%204.png)

{% 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**.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/oQnH65bSNb0WEiwCjaiv/HTHAG%20-%20Test%20AddAttachment%205.png)

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

Note the following about the HTTP Request:

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/oKuRs3LVPydbbJI2t3kp/HTHAG%20-%20Test%20AddAttachment%206.png)

{% hint style="success" %}
**Endpoint URL**: A concatenation of the Connection URL appended with the [Path](https://github.com/sharelogic/unifi-docs/blob/dev/how-to-guides/how-to-handle-attachments/broken-reference/README.md) 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](https://github.com/sharelogic/unifi-docs/blob/dev/how-to-guides/how-to-handle-attachments/broken-reference/README.md).
{% 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.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/v5u5KGbIa2qZyBEJmzKB/HTHAG%20-%20Test%20AddAttachment%207.png)

{% 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**.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/HycdineLzItrPAMyIrXV/HTHAG%20-%20Test%20AddAttachment%208.png)

{% 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**.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/p948WyUNLsZCpLw5Q7RU/HTHAG%20-%20Test%20AddAttachment%209.png)

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

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

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/VwHTaEEMRSpv3hGDyapP/HTHAG%20-%20Test%20AddAttachment%2010.png)

{% 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**.

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/qjMtNB98F7srR1CIVkWI/HTHAG%20-%20Test%20AddAttachment%2011.png)

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

Note the following about the HTTP Request:

![](https://content.gitbook.com/content/2EJsRh73QF1TvP9eLF8k/blobs/PrDPWeYWh2keaN0e79n5/HTHAG%20-%20Test%20AddAttachment%2012.png)

{% 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](https://github.com/sharelogic/unifi-docs/blob/dev/how-to-guides/how-to-handle-attachments/broken-reference/README.md).
{% endhint %}

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