Consuming a statement

Every statement is designed with a consumer in mind; the statement consumer is the one who reads and verifies a statement made by a principal, then takes action based on that statement. More specifically, a consumer performs these basic steps:

  1. Request the statement list from a specific principal
  2. Check to see if the list contains a given statement against a given target
  3. Validate that the target in the statement is the target (website or app) that you think it is
  4. Perform the action specified by the statement, if you choose to

Many use cases consume statements for you behind the scenes. For example, Android App Linking consumes link permission statements made by a website to enable links directly into an app. An app indicates that it agrees to be a target to any such statements by adding special code (an intent handler) in its manifest.

You can perform steps 1 and 2 above — requesting and validating a statement — in two ways: using our API or manually (using your own implementation).

Consuming statements using the Digital Asset Links API

The Digital Asset Links API supports two methods: Check() and List() to find or validate statements:

  • Check() takes a source, target, and relationship and verifies that the source makes the submitted statement about the target.
  • List() lists all statements made by a given source.

Consuming statements manually

The Digital Asset Links protocol is open, so you can create an implementation of it for yourself.

To consume statements made by web sites, you can make an HTTP GET request for the corresponding statement list and parse it yourself. For example, the corresponding statement list for the web site http://example.digitalassetlinks.org is at http://example.digitalassetlinks.org/.well-known/assetlinks.json.

To consume statements made by Android apps, you need to access the manifest of the corresponding APK package. On Android devices, this can be accomplished using the PackageManager interface.

Please pay special attention to the specific meanings of Digital Asset Links statements. Refer to the Asset Links Specification if you are unsure.