Skip to content

Commit 68b2fbd

Browse files
authored
fix: Add a paragraph about authentication to Actor Standby (#1282)
This is a quite important part of sending Standby requests, and it was missing. I'm having a hard time coming up with some nice formatting, @TC-MO feel free to restructure as you deem fit. ![Screenshot 2024-11-12 at 11 42 33](https://github.com/user-attachments/assets/5065abbc-a2d8-4187-8313-9ded8aa8f394)
1 parent 36c1e19 commit 68b2fbd

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

sources/platform/actors/running/actor_standby.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Traditional Actors are designed to run a single job and then stop. They're mostl
1414
However, in some applications, waiting for an Actor to start is not an option. Actor Standby mode solves this problem by letting you have the Actor ready
1515
in the background, waiting for the incoming HTTP requests. In a sense, the Actor behaves like a real-time web server or standard API server.
1616

17-
## How do I know if Standby mode is enabled?
17+
## How do I know if Standby mode is enabled
1818

1919
You will know that the Actor is enabled for Standby mode if you see the **Standby** tab on the Actor's detail page.
2020
In the tab, you will find the hostname of the server, the description of the Actor's endpoints,
@@ -31,6 +31,26 @@ If you're using an Actor built by someone else, see its Information tab to find
3131

3232
Generally speaking, Actors in Standby mode behave as standard HTTP servers. You can use any of the existing [HTTP request methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) like GET, POST, PUT, DELETE, etc. You can pass the input via [HTTP request query string](https://en.wikipedia.org/wiki/Query_string) or via [HTTP request body](https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages#body).
3333

34+
## How do I authenticate my requests
35+
36+
To authenticate requests to Actor Standby, follow the same process as [authenticating requests to the Apify API](../../integrations/programming/api.md).
37+
You can provide your [API token](../../integrations/programming/api.md#api-token) in one of two ways:
38+
39+
1. _Recommended_: Include the token in the `Authorization` header of your request as `Bearer <token>`. This approach is recommended because it prevents your token from being logged in server logs.
40+
41+
```shell
42+
curl -H "Authorization: Bearer my_apify_token" \
43+
https://rag-web-browser.apify.actor/search?query=apify
44+
```
45+
46+
2. Append the token as a query parameter named `token` to the request URL.
47+
This approach can be useful if you cannot modify the request headers.
48+
49+
```text
50+
https://rag-web-browser.apify.actor/search?query=apify&token=my_apify_token
51+
```
52+
53+
3454
## Can I still run the Actor in normal mode
3555

3656
Yes, you can still modify the input and click the Start button to run the Actor in normal mode. However, note that the Standby Actor might

0 commit comments

Comments
 (0)