Method assetlinks.check

Determines whether the specified (directional) relationship exists between the specified source and target assets.

The relation describes the intent of the link between the two assets as claimed by the source asset. An example for such relationships is the delegation of privileges or permissions.

This command is most often used by infrastructure systems to check preconditions for an action. For example, a client may want to know if it is OK to send a web URL to a particular mobile app instead. The client can check for the relevant asset link from the website to the mobile app to decide if the operation should be allowed.

A note about security: if you specify a secure asset as the source, such as an HTTPS website or an Android app, the API will ensure that any statements used to generate the response have been made in a secure way by the owner of that asset. Conversely, if the source asset is an insecure HTTP website (that is, the URL starts with http:// instead of https://), the API cannot verify its statements securely, and it is not possible to ensure that the website's statements have not been altered by a third party. For more information, see the Digital Asset Links technical design specification.

HTTP request

GET https://digitalassetlinks.googleapis.com/v1/assetlinks:check

Query parameters

Parameter name Type Description
source object(Asset) The source hosting the statement list. This is used to route the Check() call to the proper source.
relation string

Query string for the relation.

We identify relations with strings of the format <kind>/<detail>, where <kind> must be one of a set of pre-defined purpose categories, and <detail> is a free-form lowercase alphanumeric string that describes the specific use case of the statement.

Refer to our API documentation for the current list of supported relations.

For a query to match an asset link, both the query's and the asset link's relation strings must match exactly.

Example: A query with relation delegate_permission/common.handle_all_urls matches an asset link with relation delegate_permission/common.handle_all_urls.

target object(Asset) The target asset of the statement.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Response message for the CheckAssetLinks call.

JSON representation
{
  "linked": boolean,
  "maxAge": string,
  "debugString": string,
}
Field name Type Description
linked boolean Set to true if the assets specified in the request are linked by the relation specified in the request. REQUIRED
maxAge string

From serving time, how much longer the response should be considered valid barring further updates. REQUIRED

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

debugString string

Human-readable message containing information intended to help end users understand, reproduce and debug the result.

The message will be in English and we are currently not planning to offer any translations.

Please note that no guarantees are made about the contents or format of this string. Any aspect of it may be subject to change without notice. You should not attempt to programmatically parse this data. If you feel that you need to do this because the information you need is not otherwise exposed by the API, please contact us first.

Try it!

Use the APIs Explorer to call this method on live data and see the response.