Redirections
With the EVRYTHNG API, you can easily create a permanent short URL and associated QR code for every Thng and product on the Platform. Every request to this short URL (such as someone scanning the QR code with their mobile phone) is automatically redirected to the URL of any web application bound to that Thng or product.
Use Case Example
As an example, imagine a museum storing its entire catalog on the EVRYTHNG Platform. A Thng is created for each item, which can then be displayed in the museum's mobile web application at the URL:
https://museum.com/displayWorks/catalogue.php?catalogue_id=UVpfh4EFsBpasUmnVDWdktKs
The catalogue_id
parameter identifies the catalog item for which to display data. The catalogue_id
corresponds to that item's Thng on the EVRYTHNG Platform. This long URL is printed on a label next to each item on display in the museum. Changing the URL would require reprinting all the labels. Our redirection service lets you assign a much shorter URL for the application that can be easily typed on a mobile device or encoded in a QR code or near-field communication (NFC) tag. A short URL typically looks like this:
https://tn.gg/:shortId
The shortId
is an alphanumeric, case-sensitive, random string of 8 characters (default). After the redirection has been created, any HTTP request to the short URL is automatically forwarded to the target URL (the default app URL with or without the Thng ID), using the HTTP status code 307 Temporary Redirect
.
Our official short URL domain is tn.gg
, though other domains can be used for custom projects. Using custom domains lets you define custom short IDs that are unique under the domain and meet EVRYTHNG standards (see the requirements below).
Custom Domains Available
Besides the built-in short domain shown above, we offer the ability to name your short domain or use your own domain entirely.
Contact us to find out more about this Enterprise feature.
To setup and manage redirections, use the corresponding POST
/GET
/PUT
/DELETE
endpoints provided by the redirection service under the appropriate short domain (by default, https://tn.gg
).
Example Redirections
Read Redirections in the API Reference section for API examples.
Beyond Simple Redirections: the Redirector
Redirections help you start serving content for a particular Thng or product. The Redirector service is a powerful tool for creating
- Default redirections for an account or for applications
- Conditional redirections (for example, depending on the time of the day).
Updated almost 2 years ago