
TrustMate is a tool that enables building online brand image through management of reviews of your online shop or company. Use this integration to build workflows that will automatically pass information about purchased products. In return, TrustMate will give back the survey link which you can use in a seasonal communication to your customers.  

This node is recommended for generating an invitation to review a single product. To generate invitation links for multiple products simultaneously, use ["Create Invitation" node](/docs/automation/integration/trustmate/create-invitation)

## Prerequisites
---
Contact TrustMate support in order to receive the API key required for authorization.

## Node configuration
---
1. Click the node. 
2. Click **Select connection**.  
3. From the dropdown list, select the connection.  
   If you haven't established a connection yet, see [Create a connection](/docs/automation/integration/trustmate/get-survey-link#create-a-connection).

### Create a connection
After you generate an API key in TrustMate, use it to establish a connection.

1. At the bottom of the **Select connection** dropdown list, click **Add connection**.  
2. In the **API key** field, enter API key generated by TrustMate.   
3. Click **Next**.  
4. In the **Connection name** field, enter the name for the access token you generated. 
5. Click **Apply**.  
        **Result**: A connection is created and selected. 

### Define the integration settings  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/get-survey-link.png" class="medium" alt="A blank configuration form in the Get Survey Link node"><figcaption>A blank configuration form in the Get Survey Link (Single Product) node</figcaption></figure>  


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Fields marked with the <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/snippet-icon.png" alt="Snippet icon" class="icon" > icon accept [snippets](/docs/assets/snippets) or [inserts](/developers/inserts). This integration allows usage of profile-related inserts.

</div></div></div>


1. In the **Customer’s firstname** field, enter the name of your customer. You can use the following insert to extract it from the customer's attribute: `{{ customer['firstname'] }}`.
2. In the **Customer’s email** field, enter the email of your customer. You can use the following insert to extract it from the customer's attribute: `{{ customer['email'] }}`. 
3. In the **Order Id** field, enter the order Id of the purchase that triggers the workflow. Use the following insert to extract it from the profile event trigger: `{{ event.params['$orderId'] }}`. 
4. In the **Product’s name** optional field, enter the name of the purchased product. Use the following insert to extract it from the profile event trigger: `{{ event.params['$name'] }}`.
5. In the **Product’s category** optional field, enter the category of the purchased product. Use the following insert to extract it from the profile event trigger: `{{ event.params['$category']|join(' / ') }}`. 
    
   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Read the article about the [Automation inserts](/developers/inserts/automation).

   </div></div></div>

6. In the **Product's SKU** field, enter the SKU of the purchased product. Use the following insert to extract it from the profile event trigger: `{{ event.params['$sku'] }}`
7. In the **Product's image URL** optional field, enter the URL of the image of the purchased product. Use the following insert to extract it from the profile event trigger: `{{ event.params['image-link'] }}`
8. In the **Product's URL** optional field, enter the URL of the purchased product. Use the following insert to extract it from the profile event trigger:  `{{ event.params['$url'] }}`

6. Confirm by clicking **Apply**.  
    **Result**: When the Get Survey Link node is executed, a [`trustmate.getSurveyLinks` event](/docs/assets/events/event-reference/integration#trustmategetsurveylinks) is generated on the activity list of the profile who is the actor in the workflow.

### Test integration
---

You can run a test request. If the request body contains a dynamic reference to a profile attribute and/or an event data from preceding nodes, then you can define the context using [test profile data](/docs/settings/configuration/test-profiles). 


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Complete description of the feature is available in [Testing outgoing integrations](/docs/automation/test-requests-for-outgoing-integrations).

</div></div></div>



1. In the **Test integration** section, click **Send test request**.  
    **Result**: A test request builder opens. If:
    - a request body contains dynamic references, the request preview appears after you select the context of test profiles and events.
    - a request body contains static data, the preview of the body request appears immediately.
    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/test-request-builder-empty.png" class="large" alt="An empty test request builder"><figcaption>An empty test request builder</figcaption></figure>
2. If your request contains dynamic references (otherwise, the options aren't available):   
    - From the **Test profile** dropdown, select a test profile in the context of whom the test request will be performed.  
    - From the **Event context** dropdown list, you can select a particular occurrence of an event  whose values/information will be used for the test request.  
        1. Select a test profile.  
            **Result**: A history of test profile events appears.  
            <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/event-stream-test-profile.png" class="large" alt="A stream of events of a test profile"><figcaption>A stream of events of a test profile</figcaption></figure> 
        2. From the list of events, select one whose data you want use as a context. If there is no event you can use, in the upper-right corner of the pop-up, click **Define own event** and provide the body of the event.
        3. Confirm by clicking **Apply**. 
3. Verify the request body. If there is something you want to change, come back to the node settings from previous steps.  
3. If the request body is ready to test, in the upper-right corner, click **Send request**.  
    **Result**: The response section appears and the **Update response event** button becomes active.  
4. Optionally, you can update response event with new parameters by clicking **Update response event** in the upper-right corner.

## Example of use
---
For an example of use, refer to our [use case](/use-cases/trustmate-integration).