Resource Aliases

You can refer to all the resources with their system-generated IDs. In some cases, however, it may be easier to identify resources via more readily available aliases such as email addresses or via identifiers present in the UI. The Core API provides the following methods to make identifying resources simpler for you:

  • Resource aliases—A subset of resources can be accessed via more human readable aliases, such as an email address or phone number. This means you can make API requests to retrieve or update these resources using identifiers that might be more readily available to you.
  • Converting UI identifiers to system-generated identifiers—Refer to this section to learn how to take a UI identifier and convert it to its corresponding system-generated ID.

Resource aliases

Syntax

alt:ALIAS_NAME:ALIAS_VALUE

Example
https://api2.frontapp.com/teammates/alt:email:[email protected]

When you include the resource alias in the API endpoint, you will receive an HTTP 20X Success status if the resource exists with the specified alias. If you receive HTTP 404 Not Found, then the resource does not exist.

Supported API resources

You can use an alias for the following resources:

Resource

Alias

Example

Teammates

email

alt:email:@planet-express.com for the teammate with the email address [email protected]

Channels

address

alt:address:[email protected] for the channel with the address [email protected]

Contacts

Contacts can be identified with their source and handle. Refer to the list of sources on the Contacts page. You can also identify a contact's source/handles in the handles array returned in a Contact response.

alt:twitter:@leela for the contact having the twitter handle @leela


alt:phone:+12345678900 for the contact having the phone number +12345678900

Messages

Messages can be identified with their uid, which can be obtained from certain endpoints such as Receive custom messages .

alt:uid:1eab543f84a0785f7b6b8967cck18f4d for the message with the uid 1eab543f84a0785f7b6b8967cck18f4d

Accounts

Accounts can be identified with their domain or external ID (ext_id).

alt:domain:example.com for the Account with the domain example.com


alt:ext_id:abc123 for the Account with the external ID abc123

Convert UI identifiers to system-generated IDs

❗️

This is method is a useful tip, but is not officially supported

Front may opt to change how UI identifiers relate to system-generated identifiers, so do not build any critical logic based on this conversion.

If you have an identifier you have found in the Front UI via the URL, such as an inbox ID, you can convert this to the system-generated ID necessary for API calls using the following method:

  • Convert the numeric (base-10) URL ID into a base-36 string.
  • Attach the resource prefix to the converted string followed by an underscore
    • The following are the prefixes for commonly used resources, but you can refer to the response examples in the Core API Reference to identify the prefixes for other resources.

      cnv_ → Conversations

      tag_ → Tags

      msg_ → Messages

      tea_ → Teammates

      rul_ → Rules

  • <resource prefix>_<base-36 converted string>

Example

  1. The URL ID of your inbox is 30231326
  2. Converting it to base-36 gives hzyn2
  3. Adding the inbox prefix inb_ results in the system-generated ID necessary for API calls: inb_hzyn2