Skip to main content
POST
Get Source Location
Use this API to find where a source comment’s evidence sits in a page’s stored HTML: the line number, the line, and the evidence’s offsets in it. Use it for a “Show in source” view. Render the answer as it comes: do not repeat the matching. The comment must be a source comment (its locationType is "source"). The HTML is the page’s capture in the site version asked for. See Checks Overview.

Endpoint

POST https://api.velt.dev/v2/agents/checks/source-location/get

Headers

string
required
Your API key.
string
required

Body

Params

object
required
The schema uses .strict(): unknown fields are rejected.

Example Requests

1. The comment’s own page

2. Another page and version of a site comment

Response

Success Response

The stored HTML is read up to 8 MB and within about 8 seconds. When the page has no capture for the version, or the read does not finish in time, the answer is the evidence with no offsets.

Failure Response

Errors:
  • INVALID_ARGUMENT for a body outside the schema (a missing or malformed annotationId, a pageUrl that is not a URL, a malformed versionId, or an unknown field), or with CHECKS_INVALID_PAGE_URL for a pageUrl that is not http(s), not on the comment’s site, or not one of its pages;
  • NOT_FOUND with CHECKS_COMMENT_NOT_FOUND (no such comment in the project) or CHECKS_WORKSPACE_NOT_FOUND (the workspace has no store database);
  • FAILED_PRECONDITION with CHECKS_NOT_A_CHECK_COMMENT (the comment carries no check) or CHECKS_SOURCE_LOCATION_UNAVAILABLE (the comment is not a source comment).