Skip to the page

Links for every item

Metadata API

The endpoint that gives each shared link its title, description and image.

When a chat app or social network asks for a link, Beck Links needs the title, description and image of that item. They live in your system, so you provide one read-only endpoint per resource type, and Beck Links calls it, validates the answer, caches it and renders the card as server-side HTML.

The endpoint#

One GET per type, for example https://api.example.com/public/share/challenge/{id}.

  • https on port 443, on a public address. Private, loopback and link-local addresses are refused, and redirects are not followed.
  • Optional authentication: none, Authorization: Bearer <secret>, or a header of your choice such as X-Api-Key. The secret is stored encrypted, shown once as a hint, and never returned by the API.
  • Beck Links sends Accept: application/json and User-Agent: BeckLink/1.
  • Answer with Content-Type: application/json, at most 256 KiB, within the time you configure (200 to 3000 ms; two quick retries on network errors, timeouts and 5xx while the budget lasts).
  • Use only the item id to find the item. Never expect or accept a referral or a user identifier here: the answer is cached and shared by everyone who opens a link to the item.
JSON

Map your fields#

The field names are yours. You tell Beck Links where each value is with a simple path:

Beck Links fieldExample pathRule
title$.titleRequired; shown up to 90 characters
description$.descriptionUp to 200 characters
image_url$.images[0].urlhttps only, on a host in your allowed list; recommended 1200 by 630 pixels
canonical_url$.canonical_urlYour public web page of the item
deep_link_path$.app_pathThe in-app route
web_fallback_url$.web_urlWhere web visitors go
resource_status$.statusSee below

A path is $ followed by dotted names, ['names'] and array positions ($.data.name, $.images[0].url). No wildcards, filters or scripts. You can set defaults for missing values and choose which fields are required (the default is the title).

Status. You say which of your values mean published, unpublished and deleted, for example published: ["active", "live"]. An unpublished or deleted item gets a plain "not available" card without your data. 404 and 410 answers mean the item does not exist and are remembered for a few minutes (default 5).

Settings#

SettingDefaultRange
Timeout1500 ms200 to 3000 ms
Cache time (ttl_seconds)900 s30 s to 24 h
Remember "not found" (negative_ttl_seconds)300 s0 to 1 h
Serve an old copy when your API fails (stale_if_error_seconds)24 h0 to 7 days
Parallel calls41 to 20
Calls per minute1201 to 6000
Allowed image hostsnoneUp to 20 (cdn.example.com or *.example.com)

Beck Links calls your endpoint at most once per item per cache period, protects it with a circuit breaker when it keeps failing, and never calls it for a person who taps a link.

Escaping and safety#

All text is HTML-escaped by Beck Links. Do not return HTML. An image that is not https, not on an allowed host, or that points at a private address is dropped (the card then uses your app's icon). The first request of a crawler is answered with the card in the initial HTML, with no JavaScript needed; the og:url is the link without its query, so a referral never ends up in the card.

Verify it works#

In Resources, open the type's Metadata API, use Test with a real id (it shows the status, latency and the mapped fields, or the exact reason it failed), then Preview a link. From a terminal, act as a crawler:

Bash

Look for og:title, og:description, og:image and an og:url that ends in /c/4521. Change a ref and the card does not change, and your endpoint logs one call.