Power Webhook Integration avatar
Power Webhook Integration
Try for free

14 days trial then $5.00/month - No credit card required now

View all Actors
Power Webhook Integration

Power Webhook Integration

pocesar/run-webhook-digest
Try for free

14 days trial then $5.00/month - No credit card required now

Allows you to provide multiple HTTP endpoints, that receive a more complete JSON from the run, and allow you to hit those endpoints using a proxy, and enable you to do conditional webhook calls with some lines of Javascript code and you can link/chain one actor to another

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "method": "POST",
11    "statuses": [
12        "ACTOR.RUN.SUCCEEDED",
13        "ACTOR.RUN.FAILED",
14        "ACTOR.RUN.TIMED_OUT"
15    ],
16    "customData": {},
17    "transformEndpoint": async ({ Apify, url, dataset, requestQueue, keyValueStore, abort, data, input: { customData } }) => {
18      return data;
19    },
20    "triggerCondition": async ({ Apify, dataset, requestQueue, keyValueStore, abort, data, input: { customData } }) => {
21     return true;
22    }
23};
24
25(async () => {
26    // Run the Actor and wait for it to finish
27    const run = await client.actor("pocesar/run-webhook-digest").call(input);
28
29    // Fetch and print Actor results from the run's dataset (if any)
30    console.log('Results from dataset');
31    console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
32    const { items } = await client.dataset(run.defaultDatasetId).listItems();
33    items.forEach((item) => {
34        console.dir(item);
35    });
36})();
37
38// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Community
Actor metrics
  • 1 monthly user
  • 1 star
  • 99.9% runs succeeded
  • Created in Aug 2021
  • Modified over 1 year ago