File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed
apify-api/openapi/code_samples/javascript Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ import { ApifyClient } from 'apify-client' ;
2+
3+ const apifyClient = new ApifyClient ( { token : 'my-token' } ) ;
4+ // Replace apify~my-sample-task with your task's ID or technical name
5+ await apifyClient . task ( 'apify~my-sample-task' ) . delete ( ) ;
Original file line number Diff line number Diff line change 1+ import { ApifyClient } from 'apify-client' ;
2+
3+ const apifyClient = new ApifyClient ( { token : 'my-token' } ) ;
4+ // Replace apify~my-sample-task with your task's ID or technical name
5+ const task = await apifyClient . task ( 'apify~my-sample-task' ) . get ( ) ;
6+
7+ console . log ( task ) ;
Original file line number Diff line number Diff line change 1+ import { ApifyClient } from 'apify-client' ;
2+
3+ const apifyClient = new ApifyClient ( { token : 'my-token' } ) ;
4+ // Replace apify~my-sample-task with your task's ID or technical name
5+ const task = await apifyClient . task ( 'apify~my-sample-task' ) . update ( {
6+ title : 'New title' ,
7+ } ) ;
8+
9+ console . log ( task ) ;
Original file line number Diff line number Diff line change 1+ import { ApifyClient } from 'apify-client' ;
2+
3+ const apifyClient = new ApifyClient ( { token : 'my-token' } ) ;
4+ const { items } = await apifyClient . tasks ( ) . list ( ) ;
5+
6+ console . log ( items ) ;
Original file line number Diff line number Diff line change 1+ import { ApifyClient } from 'apify-client' ;
2+
3+ const apifyClient = new ApifyClient ( { token : 'my-token' } ) ;
4+ const { items } = await apifyClient . tasks ( ) . create ( {
5+ /**
6+ * Replace apify~my-sample-actor with the ID or technical name
7+ * of the Actor this task will be based on
8+ */
9+ actId : 'apify~my-sample-actor' ,
10+ name : 'my-sample-task' ,
11+ } ) ;
12+
13+ console . log ( items ) ;
You can’t perform that action at this time.
0 commit comments