# Web/HTML Implementation

Legitimate's API can be used to redirect to custom web applications or even native app experiences via two different approaches. This page covers the simple flow when redirecting to another web-based application. For information on native app integration, please refer to [Native App Implementation](/technical-docs/native-app-implementation.md)

## Technical Architecture

The Legitimate Tags are pre-programmed to link to the Tap by Legitimate web app that then be configured to redirect to your own website.

## Tag URL Redirect

{% hint style="info" %}
To see a simple example of the tag URL Redirect and tag verification in action, please refer to the [Getting Started](/technical-docs/developer-resources/web-html-implementation/getting-started.md) document and [Simple HTML Example](/technical-docs/developer-resources/web-html-implementation/simple-html-example.md) .
{% endhint %}

Legitimate's NFC Tags can be configured to redirect to a different domain or URL with the verification parameters from the tag to create an entirely new user flow and digital experience. This is extremely useful to redirect users to a custom web experience, or redirect to a native mobile app experience.

```url
https://verify.legitimate.tech/?uid=XXXXXXXXXXXXXXX&ctr=YYYYYY&cmac=ZZZZZZZZZZZZZZZZ
```

By default, Legitimate's NFC Tags are pre-programmed to open Legitimate's web URL first and then redirect to another desired URL. Legitimate will collect analytics data before redirecting.

```url
https://www.yourdomain.com/experience/?uid=XXXXXXXXXXXXXX&ctr=YYYYYY&cmac=ZZZZZZZZZZZZZ
```

The URL parameters can then be used to call the tag related APIs.

Each time an NFC tag is scanned, a new set of verification parameters will be generated. Therefore, if you are intending to use the Tag URL Redirect features, it is extremely important to note that [**you must verify the parameters every time a scan occurs**](/technical-docs/api-resources/verify.md). This is meant to protect the connected products from counterfeit and ensure that each scan is unique.

To configure the redirect URL, please login to the [Legitimate Dashboard](https://dashboard.legitimate.tech), open the configuration page for the desired SKU, and set the Redirect URL field.

<figure><img src="/files/pIUt3dcUerxKsUT88Lul" alt=""><figcaption></figcaption></figure>

### (Tag URL Redirect) High Level User Interface Overview

* User taps the tag with their phone and opens the link popup
* The browser opens [`https://verify.legitimate.tech/?uid=XXXXXXXXXXXXXX&ctr=YYYYYY&cmac=ZZZZZZZZZZZZ`](https://tap.legitimate.tech/?uid=XXXXXXXXXXXXXX\&ctr=YYYYYY\&cmac=ZZZZZZZZZZZZZ)
* The `uid`, `ctr`, and `cmac` is used to verify the tag's authenticity and get information about the content for the tag.&#x20;
* The browser is then redirected to your own page with the same parameters [`https://www.yourdomain.com/page/name?uid=XXXXXXXXXXXXXX&ctr=YYYYYY&cmac=ZZZZZZZZZZZZ`](https://tap.legitimate.tech/?uid=XXXXXXXXXXXXXX\&ctr=YYYYYY\&cmac=ZZZZZZZZZZZZZ)
* Your own page must now call our APIs to verify the digital signature payload that is present in the query parameters.
  * Please reference our [Getting Started](/technical-docs/developer-resources/web-html-implementation/getting-started.md) guide to see how to implement this verification via a simple JS snippet
  * Alternatively, you can implement this verification yourself using our [API Resources](/technical-docs/api-resources.md) to create a more robust user-experience.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.legitimate.tech/technical-docs/developer-resources/web-html-implementation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
