需要帮助来实施 Apify webhook。完成一项任务需要一些时间。我想添加一个 Apify webhook 它将运行另一个任务但不知道如何做到这一点。
$.ajax({
url : 'https://api.apify.com/v2/actor-tasks/XXXXXXX/runs?token=XXXXXXXX&waitForFinish=120',
method : 'POST',
contentType: 'application/json',
dataType: 'json',
data : JSON.stringify ({
"queries" : "Outreach link building"
}),
success:function(result) {
console.log(result);
}
});
然后 webhook 将调用以下任务:
$.ajax({
url : `https://api.apify.com/v2/datasets/${datasetId}/items?format=json`,
method : 'GET',
contentType: 'application/json; charset=utf-8',
success:function(response) {
console.log(response); // Items from dataset
}
});
顺便说一句,如果我想实现我需要的方式有误,请告诉我你的建议。