Skip to content

Commit 6bbe640

Browse files
honzajavorekdaveomri
authored andcommitted
fix: Actor ID is not in settings anymore (apify#1850)
Fix apify#1849, thanks for the report, @JMatej! This is more of a hotfix, not a rewrite of the whole article. I didn't aim for perfection and better stylistics, I just wanted to fix the most glaring issues which get people stuck. I did run `apify create` and `apify push` locally to verify the workflow, but I didn't test anything else, webhooks, API calls, etc.
1 parent ef7ddef commit 6bbe640

File tree

4 files changed

+78
-13
lines changed

4 files changed

+78
-13
lines changed
-59.8 KB
Binary file not shown.
-59.9 KB
Binary file not shown.

sources/academy/platform/expert_scraping_with_apify/solutions/integrating_webhooks.md

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,32 @@ slug: /expert-scraping-with-apify/solutions/integrating-webhooks
1111

1212
---
1313

14-
In this lesson we'll be writing a new Actor and integrating it with our beloved Amazon scraping Actor. First, we'll navigate to the same directory where our **demo-actor** folder lives, and run `apify create filter-actor` _(once again, you can name the Actor whatever you want, but for this lesson, we'll be calling the new Actor **filter-actor**)_. When prompted for which type of boilerplate to start out with, select **Empty**.
14+
In this lesson we'll be writing a new Actor and integrating it with our beloved Amazon scraping Actor. First, we'll navigate to the same directory where our **demo-actor** folder lives, and run `apify create filter-actor` _(once again, you can name the Actor whatever you want, but for this lesson, we'll be calling the new Actor **filter-actor**)_. When prompted about the programming language, select **JavaScript**:
1515

16-
![Selecting an empty template to start with](./images/select-empty.jpg)
16+
```text
17+
$ apify create filter-actor
18+
? Choose the programming language of your new Actor:
19+
❯ JavaScript
20+
TypeScript
21+
Python
22+
```
1723

18-
Cool! Now, we're ready to get started.
24+
Then use the arrow down key to select **Empty JavaScript Project**:
25+
26+
```text
27+
$ apify create filter-actor
28+
✔ Choose the programming language of your new Actor: JavaScript
29+
? Choose a template for your new Actor. Detailed information about the template will be shown in the next step.
30+
Crawlee + Playwright + Chrome
31+
Crawlee + Playwright + Camoufox
32+
Bootstrap CheerioCrawler
33+
Cypress
34+
❯ Empty JavaScript Project
35+
Standby JavaScript Project
36+
...
37+
```
38+
39+
As a last step, confirm the choices by **Install template** and wait until our new Actor is ready.
1940

2041
## Building the new Actor {#building-the-new-actor}
2142

@@ -40,7 +61,11 @@ const dataset = await Actor.openDataset(datasetId);
4061
// ...
4162
```
4263

43-
> Tip: You will need to use `forceCloud` option - `Actor.openDataset(<name/id>, { forceCloud: true });` - to open dataset from platform storage while running Actor locally.
64+
:::tip Accessing Cloud Datasets Locally
65+
66+
You will need to use `forceCloud` option - `Actor.openDataset(<name/id>, { forceCloud: true });` - to open dataset from platform storage while running Actor locally.
67+
68+
:::
4469

4570
Next, we'll grab hold of the dataset's items with the `dataset.getData()` function:
4671

@@ -121,15 +146,36 @@ Cool! But **wait**, don't forget to configure the **INPUT_SCHEMA.json** file as
121146
}
122147
```
123148
124-
Now we're done, and we can push it up to the Apify platform with the `apify push` command.
149+
Now we're done, and we can push it up to the Apify platform with the `apify push` command:
150+
151+
```text
152+
$ apify push
153+
Info: Created Actor with name filter-actor on Apify.
154+
Info: Deploying Actor 'filter-actor' to Apify.
155+
Run: Updated version 0.0 for Actor filter-actor.
156+
Run: Building Actor filter-actor
157+
(timestamp) ACTOR: Extracting Actor documentation from README.md
158+
(timestamp) ACTOR: Building Docker image.
159+
...
160+
(timestamp) ACTOR: Pushing Docker image to repository.
161+
(timestamp) ACTOR: Build finished.
162+
Actor build detail https://console.apify.com/actors/Yk1bieximsduYDydP#/builds/0.0.1
163+
Actor detail https://console.apify.com/actors/Yk1bieximsduYDydP
164+
Success: Actor was deployed to Apify cloud and built there.
165+
```
125166
126167
## Setting up the webhook {#setting-up-the-webhook}
127168
128-
Since we'll be calling the Actor via the [Apify API](/academy/api/run-actor-and-retrieve-data-via-api), we'll need to grab hold of the ID of the Actor we just created and pushed to the platform. The ID is always accessible through the **Settings** page of the Actor.
169+
We'll use the [Apify API](/academy/api/run-actor-and-retrieve-data-via-api) to set up the webhook. To compose the HTTP request, we'll need either the ID of our Actor or its technical name. Let's take a second look at the end of the output of the `apify push` command:
129170
130-
![Actor ID in Actor settings](./images/actor-settings.jpg)
171+
```text
172+
...
173+
Actor build detail https://console.apify.com/actors/Yk1bieximsduYDydP#/builds/0.0.1
174+
Actor detail https://console.apify.com/actors/Yk1bieximsduYDydP
175+
Success: Actor was deployed to Apify cloud and built there.
176+
```
131177
132-
With this `actorId`, and our `token`, which is retrievable through **Settings > Integrations** on the Apify Console, we can construct a link which will call the Actor:
178+
The URLs tell us that our Actor's ID is `Yk1bieximsduYDydP`. With this `actorId`, and our `token`, which is retrievable through **Settings > Integrations** on the Apify Console, we can construct a link which will call the Actor:
133179
134180
```text
135181
https://api.apify.com/v2/acts/Yk1bieximsduYDydP/runs?token=YOUR_TOKEN_HERE

sources/academy/platform/expert_scraping_with_apify/solutions/using_api_and_client.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,32 @@ slug: /expert-scraping-with-apify/solutions/using-api-and-client
1111

1212
---
1313

14-
Since we need to create another Actor, we'll once again use the `apify create` command and start from an empty template.
15-
16-
![Selecting an empty template to start with](./images/select-empty.jpg)
14+
Since we need to create another Actor, we'll once again use the `apify create` command and start from an empty template. This time, let's call our project **actor-caller**:
15+
16+
```text
17+
$ apify create filter-caller
18+
? Choose the programming language of your new Actor:
19+
❯ JavaScript
20+
TypeScript
21+
Python
22+
```
1723

18-
This time, let's call our project **actor-caller**.
24+
Again, use the arrow down key to select **Empty JavaScript Project**:
25+
26+
```text
27+
$ apify create filter-actor
28+
✔ Choose the programming language of your new Actor: JavaScript
29+
? Choose a template for your new Actor. Detailed information about the template will be shown in the next step.
30+
Crawlee + Playwright + Chrome
31+
Crawlee + Playwright + Camoufox
32+
Bootstrap CheerioCrawler
33+
Cypress
34+
❯ Empty JavaScript Project
35+
Standby JavaScript Project
36+
...
37+
```
1938

20-
Let's also set up some boilerplate, grabbing our inputs and creating a constant variable for the task:
39+
Confirm the choices by **Install template** and wait until our new Actor is ready. Now let's also set up some boilerplate, grabbing our inputs and creating a constant variable for the task:
2140

2241
```js
2342
import { Actor } from 'apify';

0 commit comments

Comments
 (0)