Skip to content

Commit

Permalink
feat: add more tasks samples
Browse files Browse the repository at this point in the history
  • Loading branch information
m-murasovs committed Dec 10, 2024
1 parent 1c68faa commit d78401d
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
// Replace apify~my-sample-task with your task's ID or technical name
const input = await apifyClient.task('apify~my-sample-task').getInput();

console.log(input);
10 changes: 10 additions & 0 deletions apify-api/openapi/code_samples/javascript/actorTask_input_put.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
// Replace apify~my-sample-task with your task's ID or technical name
const updatedInput = await apifyClient.task('apify~my-sample-task')
.updateInput({
// Your input here
});

console.log(updatedInput);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
// Replace apify~my-sample-task with your task's ID or technical name
const { items } = await apifyClient.task('apify~my-sample-task')
.runs()
.list();

console.log(items);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
// Replace apify~my-sample-task with your task's ID or technical name
const run = await apifyClient.task('apify~my-sample-task').start();

console.log(run);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
// Replace apify~my-sample-task with your task's ID or technical name
const { items } = await apifyClient.task('apify~my-sample-task')
.webhooks()
.list();

console.log(items);

0 comments on commit d78401d

Please sign in to comment.