How can I use Unlocker for Asynchronous requests?

Gal El Al
Gal El Al
  • Updated
Send requests without waiting for a response. Collect results via a designated endpoint or a webhook.

To initiate a request, perform:


Request via proxy interface:

RESPONSE_ID=`curl -i --silent --proxy --proxy-user lum-customer-<YOUR_CUSTOMER_ID>-zone-<YOUR_ZONE>:<PASS> -k "<Target site>" | sed -En 's/^x-response-id: (.*)/\1/p' | tr -d '\r'`


Request via API interface:


RESPONSE_ID=`curl -i --silent --compressed "<Accound ID>&zone=<ZONE>" -H "Content-Type: application/json" -H "Authorization: Bearer <API token>" -d "{\"country\":\"us\",\"url\":\"<Target site>\"}" | sed -En 's/^x-response-id: (.*)/\1/p' | tr -d '\r'`


Get response (same for both proxy and API interface):

curl -v --compressed "<YOUR_CUSTOMER_ID>&zone=<YOUR_ZONE>&response_id=${RESPONSE_ID}" -H "Authorization: Bearer <API token>"


You can adjust your zone async settings on the zones page.
Optional settings:
Result lifetime (days) - number of days to keep results
Web Hook URL - address to deliver results
Web Hook Request Method - HTTP method to use to deliver response, GET or POST are optional