Script Hash
Send the sha256 of a challenge script as scriptHash instead of the full script, and retry with the script when the API answers 422 script_required.
Endpoints that take a challenge script also accept scriptHash: the lowercase hex sha256 of the script exactly as the site served it. Challenge scripts are about 600 to 800 KB; the hash is 64 bytes. Once any client has sent a script, every client can send its hash instead.
Which endpoints accept it
Akamai
/v2/sensor, /sbsd, /v1/telemetry, /v1/telemetry/params
script, scriptHash and context are mutually exclusive. The first request of a chain sends script or scriptHash, later ones send context.
DataDome
/interstitial, /slider
Never both. Without either, a fixed bundle version is used; always send one.
Incapsula
/reese84
Exactly one of script and scriptHash is required.
Akamai v1.75 sensors take no script. /utmvc, /tags and the Kasada endpoints are unchanged.
How it works
Compute the sha256 of the script: the UTF-8 bytes of the exact string you would otherwise send as
script, encoded as 64 lowercase hex characters. Do not trim, reformat or re-encode the script first.Send the request with
scriptHashin place ofscript.If the API answers HTTP 422 with
{"error": "script_required"}, repeat the same request once withscriptinstead ofscriptHash. The 422 is not billed.
After that retry, the API has the script and the hash works for every client. A script is kept for at least 7 days. If it has expired, the API answers script_required again and the same retry stores it once more.
Some requests are solved in a real browser on our side. Those need the script itself and also answer script_required to a hash-only request; the same retry handles them, so treat every script_required the same way.
Errors
422
{"error": "script_required"}
The API needs the script for this request. Retry once with script.
400
{"error": "..."}
script and scriptHash sent together, or on Akamai scriptHash with context.
400
{"error": "..."}
scriptHash is not 64 lowercase hex characters.
400
{"error": "missing script or scriptHash"}
Incapsula: neither was sent.
Example
The examples call Incapsula's /reese84; the same pattern works for every endpoint above. body holds the rest of the request fields.
On Akamai, only the first request of a chain carries script or scriptHash; keep sending context on the requests after it as before.
Last updated

