Get one scan
const url = 'https://api.us.headerhawk.com/v1/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/scans/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.us.headerhawk.com/v1/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/pages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/scans/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>'One scheduled scan with its full graded result and, for a payment page on a plan with script authorization, the scripts its HTML named.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The site’s id.
The monitored page’s id.
The scan’s id.
Responses
Section titled “Responses”The scan
object
object
The URL fetched, as the page named it when it was scanned.
complete, or failed with a failureReason. An open enum.
As on LatestPageScan.
The scan rubric’s version: a grade is compared only with one given under the same rubric.
The letter grade HeaderHawk’s scan rubric gave the page’s headers:
A+, A, B, C, D or F. Null for a failed scan.
The score behind the grade, 0 to 100; null for a failed scan.
Where the fetch ended after redirects.
The watched security headers in comparable form, each null when the
page did not send it; null for a failed scan. A policy’s directives
are sorted with every nonce replaced by 'nonce-*'; other values are
lowercased with whitespace collapsed. A header sent more than once is
its lines, sorted, joined with a newline.
object
What differs from the page’s last complete scan.
object
One watched header that differs from the last complete scan.
object
The header’s name, lowercase. An open enum.
An open enum.
The last complete scan’s grade, when this one is lower under the same rubric; otherwise null.
The rubric changed since the last complete scan, so the grade was not compared.
The graded result, as HeaderHawk’s free header scanner gives it: grade, score, headline, the finding for each header and what to do next. Null for a failed scan. Its shape follows the scanner’s and may gain fields.
object
The page’s script tags with a src, in document order, each
fetched and hashed. Only a payment page on a plan with script
authorization has its scripts fetched: null for every other scan,
and for a failed one.
One script tag with a src the scan found, and what fetching it gave.
object
The src attribute as written.
Resolved against the page, query kept; null when it does not resolve.
The script inventory’s identity for it, query and fragment dropped.
The tag’s integrity attribute.
hashed: fetched and hashed. failed: fetched, and what came
back was not a script that could be hashed. refused: not
fetched, because its URL or a redirect led where scans do not go,
or it has no URL (data:). skipped: not fetched, past the
per-page limit or because the scan ran out of time. An open enum.
sha256-<base64> of the bytes served; null unless outcome is hashed.
Bytes hashed.
Why there is no hash; null when there is one.
object
A string, so a new reason does not break a client.
Whether the page’s own origin could integrity-check it, asked with that origin; null unless it was fetched.
object
An open enum.
object
Example
{ "data": { "status": "complete", "changes": { "headers": [ { "header": "content-security-policy", "change": "added" } ] }, "scripts": [ { "outcome": "hashed", "cors": { "verdict": "readable" } } ] }}Headers
Section titled “Headers”The budget nearest to running out, per minute.
What is left of that budget this minute.
Seconds until that budget starts again.
A parameter was refused, or one the operation does not take was sent. The message names it.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}invalid_api_key: no key, or one that is malformed, unknown, revoked
or expired. One answer for all of them.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}plan_upgrade_required: the tenant’s plan does not include API access
(the key works again when it does), or does not include what this
operation reads.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}No such resource in your tenant.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}rate_limited: over a budget. Wait Retry-After seconds.
object
object
What went wrong. An open enum: treat a code you do not know by its HTTP status.
For people. Branch on code.
Quote it when you write to us about this request.
Example
{ "error": { "code": "bad_request" }}Headers
Section titled “Headers”Seconds to wait before trying again.