The two cookies
Akamai sets two cookies on the first response and reads them on every request.
Send every other cookie the site sets as well, exactly as a browser would. Keeping one cookie jar per session does this for you.
The script and its data
The page contains one script tag whose path is unique per site and changes over time. Read it from each page response, fetch it through the same session, and send its body to/parse. The result, called the script data, is a small object with four fields: ver, key, dvc and din. Every sensor for this site needs it.
The result stays valid for as long as the site serves the same script. Cache it on your side keyed by the script URL, and refresh it when the URL changes.
Nearly every site today runs sensor version 3, which needs the script data. On the rare site still on version 2, omit scriptData from the sensor request.
Generating and posting
Call/sensor with the page URL, your User-Agent, the two cookies, the script URL and the script data. Post the returned string to the script path as {"sensor_data": "<sensor>"} with a text/plain;charset=UTF-8 content type and the page as referer. Akamai answers {"success": true} and sets a new _abck.
Then read _abck:
- It contains
~0~. You are trusted. Make the protected request. - It still contains
~-1~. Generate and post another sensor with the new cookie values.
~0~ and still accept the protected request after three posts, so make the request anyway before concluding you are blocked.
After the protected action
Most sites invalidate_abck when you complete a protected action such as adding to cart or logging in. Expect to run the generate-and-post cycle again before the next one. You do not need to fetch or parse the script again unless its URL has changed.
Request fields
Stepper mode
Setstepper: true on every /sensor call and pass index starting at 0 and increasing by one per post. In this mode the sensors in a session describe one continuous visit: the first covers arriving on the page, the next covers what happens after the first post, and so on. It is how our own tooling runs, and it is what the Quickstart does.
Without stepper, each call produces a complete, self-contained sensor and index is ignored. That is fine for a single post, but sites that read the second or third sensor notice when each one starts from scratch.
Troubleshooting
Roolink answers 422 with no device profile for user agent
Roolink answers 422 with no device profile for user agent
Roolink builds sensors from real browser profiles and needs a User-Agent it has one for. Current desktop Chrome on Windows or macOS is the safe choice; send the identical string to the site. See Supported browsers.
Roolink answers 400 from /parse
Roolink answers 400 from /parse
The body was not a complete Akamai script. Send the script exactly as fetched, as
text/plain, without trimming or re-encoding.The site does not answer success true to the sensor post
The site does not answer success true to the sensor post
The post itself is being refused, so the sensor never reached Akamai. Check that you post to the current script path, with the page as referer and
text/plain;charset=UTF-8 as content type, through the same session that loaded the page._abck flips to ~0~ and back to ~-1~ immediately
_abck flips to ~0~ and back to ~-1~ immediately
Expected after a protected action. If it happens on a plain page load, the IP changed or the User-Agent differs between requests.