Advanced context links
Note: this article focuses on advanced context links use cases. If you're just getting started with context links, please review the general context links article first.
Overview
Context links allow you to transform URLs or strings found in comments or messages into structured Orders, Shipments, Itineraries, Tasks etc. that are easy to access right from a conversation in Front.
That core functionality is available on the latest Growth plan and up, but customers on the Scale and Premier plans have access to advanced context links, which includes the ability to set Description and Owner fields for their links, and enrich those fields using information retrieved by a third party API. For example, the owner, customer, company, and priority information for the link below are synced from an API using an advanced context link:
A few examples where advanced context links are useful:
- The reference ID found in your messages or comments does not match the ID used to generate a URL to that record in your system. In this case, basic context links aren't viable because the reference ID must be mapped to a different ID
- You want to see metadata about the objects you're dealing with, directly within Front. For example, the expected arrival date of a shipment, the completion status of a task, or the teammate that owns an itinerary could be synced onto the link and visible from Front without opening any external tools.
- You want to use object metadata to power rules in Front. For example, routing conversations to a particular teammate depending on the owner of an associated load in your CRM.
Context links make these use cases possible without writing any API code or hosting your own server, so long as you have access to an API that allows you to retrieve the context link data you're looking for.
Advanced context links are currently limited to a private beta — if you're interested in access, please reach out to your account manager.
Configuration
Creating a Server
At a high level, advanced context links work by allowing you to connect Front with an external API to fetch relevant data for your context links. Using Front's Servers feature, no code or self-hosting is required.
Step 1
After you've created an app, select the Servers tab and then click Create server
Step 2
Set the Origin field to the URL origin of your API. Don't worry about the particular API endpoint you'll be using yet — this field should just include the origin. For example, if the API endpoint you want to use is https://api.airtable.com/v0/{baseId}/{tableIdOrName}/{recordId}
, the origin would be https://api.airtable.com
Step 3
Set the Authentication strategy used by your API. Today, Basic, Bearer, and OAuth2 authentication are supported. Depending on the strategy you select, you may be asked to provide additional configuration fields. Finally, click Create.
Step 4
After creating the Server, open it once more to set the Local credentials. These credentials should be the ones that allow you to connect to the third party API. For example, if you selected Bearer as the Authentication strategy in Step 3, you would save the particular bearer token you use to access the API in Local credentials.
That's it! Your Server is now ready to make API requests.
Using your Server to enrich Context link metadata
Note: the following steps assume you already have a basic context link set up. If you haven't, follow the instructions in the general context links help center article.
Step 1
On the context link configuration page, click Create new under the Dynamic variables widget on the right sidebar. Then select Start dynamic variable path and then Fetch from server.
Step 2
Use the dynamic variable to configure the API request to your server. The Fetch from server field should include the full address of the API endpoint you want to use, with any relevant variables filled in using variables from the original Target string of your context link.
For example, let's imagine we wanted to use Airtable's Get record endpoint: https://api.airtable.com/v0/{baseId}/{tableIdOrName}/{recordId}.
The base ID and table ID would be static for all of our links, but the record ID would be pulled from the target string. Therefore, we'd configure Fetch from server as follows:
Note that "appti123" and "tbl23" are set statically, whereas the dynamic portion of the URL ("ALPHANUMERICS1") comes from the Letters or digits variable we created in the Target string.
When a matching string is identified by the context link, Front will make a GET request to the URL specified in the Fetch from server field using the Local credentials you previously configured.
Depending on the response format of the API you are using, you may need to further extract particular elements of payload you receive from the API. In our example using Airtable, we'll receive a payload formatted like this:
{
"createdTime": "2022-09-12T21:03:48.000Z",
"fields": {
"Expected arrival date": "4/13/2023",
"Name": "Engine",
"Team": "Red Bull"
},
"id": "rec123"
}
To extract the fields from the API response, we would add an Extract object property step and enter the name of the object property we're interested in ("fields").
Step 3
For each piece of metadata you want to add to your context link, create a new dynamic variable to extract it from the variable we created for the API payload. For example, to extract the "Expected arrival date" from our example above as its own variable, we'd click Create new in the dynamic variables manager, then Start dynamic variable path and then Use result of variable. This will allow us to use the value of the value we extracted in Step 2. Next, we'll configure the arrival date variable as follows:
Note that we are using the "Fetch from Airtable" variable we created in Step 2, and extracting the "Expected arrival date" object property from it. We also added a step to "Parse as string" since we know that this property will be a string.
Step 4
Once you've set up your dynamic variables, they can be inserted into the link's preview properties using the "+" button.
In our example, since we extracted the Arrival date from the Airtable API, we can now insert it into the description of our link:
Step 5
Finally, test your context link using the previewer widget. If properly configured, you should see the data from your API enriched on the link:
Advanced context links and rules
Once you've configured an advanced context link that syncs metadata onto your links, you can use that metadata in Smart rules by creating conditions that check against the Links attached to the conversation.
For more details, check out our articles on Smart Rule variables and How to build a Smart Rule.
FAQ
When is metadata for a particular link updated/refreshed?
Metadata will be refreshed for a particular link each time it is encountered in a message or comment. For example, if you create a context link that matches shipments with IDs like #123 and sync the order status from your CRM, the order status will only be refreshed when #123 is found in a message or comment. This means that it is possible for information to be out of date if data changes in your CRM for a particular record after a link is created for that record in Front. To guarantee that the information is up to date, you can manually send an email or post a comment with the reference ID.