Skip to content

Commit 6be646e

Browse files
authored
docs: change security description within API docs (#1729)
merge apiKey & htttpBearer to one per make sure all endpoints refer to correct security adjust descriptions add admonitions
1 parent 7339efc commit 6be646e

20 files changed

+49
-84
lines changed
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
type: apiKey
22
name: token
33
in: query
4-
description: API authentication token.
4+
description: |-
5+
API token provided as a query parameter (e.g., `?token=your_token`—less secure).
6+
7+
Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console.
8+
9+
:::danger Security
10+
11+
Do not share your API token (or account password) with untrusted parties.
12+
13+
:::
14+
15+
_When is authentication required?_
16+
- _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors).
17+
- _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues).
18+
- _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token).
19+
20+
For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations).

apify-api/openapi/components/securitySchemes/apiKeyActorBuilds.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

apify-api/openapi/components/securitySchemes/apiKeyQueueId.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

apify-api/openapi/components/securitySchemes/apiKeyStoreId.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
type: http
22
scheme: bearer
3-
description: API authentication token.
3+
description: |-
4+
Bearer token provided in the `Authorization` header (e.g., `Authorization: Bearer your_token`—recommended). [More info](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization).
5+
6+
Use your API token to authenticate requests. You can find it on the [Integrations page](https://console.apify.com/account#/integrations) in Apify Console. This method is more secure than query parameters, as headers are not logged in browser history or server logs.
7+
8+
:::danger Security
9+
10+
Do not share your API token (or account password) with untrusted parties.
11+
12+
:::
13+
14+
_When is authentication required?_
15+
- _Required_ for private Actors, tasks, or resources (e.g., builds of private Actors).
16+
- _Required_ when using named formats for IDs (e.g., `username~store-name` for stores or `username~queue-name` for queues).
17+
- _Optional_ for public Actors or resources (e.g., builds of public Actors can be queried without a token).
18+
19+
For more information, see our [integrations documentation](https://docs.apify.com/platform/integrations).

apify-api/openapi/components/securitySchemes/httpBearerActorBuilds.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

apify-api/openapi/components/securitySchemes/httpBearerQueueId.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

apify-api/openapi/components/securitySchemes/httpBearerStoreId.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

apify-api/openapi/openapi.yaml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,22 @@ info:
1414
[JSON](http://www.json.org/) format with UTF-8 encoding,
1515
with a few exceptions that are explicitly described in the reference.
1616
17-
To access the API using [Node.js](https://nodejs.org/en/), we recommend the
18-
[`apify-client`](https://docs.apify.com/api/client/js) [NPM
17+
- To access the API using [Node.js](https://nodejs.org/en/), we recommend the [`apify-client`](https://docs.apify.com/api/client/js) [NPM
1918
package](https://www.npmjs.com/package/apify-client).
20-
21-
To access the API using [Python](https://www.python.org/), we recommend the
22-
[`apify-client`](https://docs.apify.com/api/client/python) [PyPI
19+
- To access the API using [Python](https://www.python.org/), we recommend the [`apify-client`](https://docs.apify.com/api/client/python) [PyPI
2320
package](https://pypi.org/project/apify-client/).
21+
2422
The clients' functions correspond to the API endpoints and have the same
2523
parameters. This simplifies development of apps that depend on the Apify
2624
platform.
2725
28-
**Note:** All requests with JSON payloads need to specify the `Content-Type:
29-
application/json` HTTP header!
30-
All API endpoints support the `method` query parameter that can override the
31-
HTTP method.
32-
For example, if you want to call a POST endpoint using a GET request, simply
33-
add the query parameter `method=POST` to the URL and send the GET request.
34-
This feature is especially useful if you want to call Apify API endpoints
35-
from services that can only send GET requests.
26+
:::note Important Request Details
27+
28+
- `Content-Type` header: For requests with a JSON body, you must include the `Content-Type: application/json` header.
29+
30+
- Method override: You can override the HTTP method using the `method` query parameter. This is useful for clients that can only send `GET` requests. For example, to call a `POST` endpoint, append `?method=POST` to the URL of your `GET` request.
31+
32+
:::
3633
3734
## Authentication
3835
<span id="/introduction/authentication"></span>
@@ -627,20 +624,8 @@ components:
627624
securitySchemes:
628625
httpBearer:
629626
$ref: components/securitySchemes/httpBearer.yaml
630-
httpBearerActorBuilds:
631-
$ref: components/securitySchemes/httpBearerActorBuilds.yaml
632-
httpBearerStoreId:
633-
$ref: components/securitySchemes/httpBearerStoreId.yaml
634-
httpBearerQueueId:
635-
$ref: components/securitySchemes/httpBearerQueueId.yaml
636627
apiKey:
637628
$ref: components/securitySchemes/apiKey.yaml
638-
apiKeyActorBuilds:
639-
$ref: components/securitySchemes/apiKeyActorBuilds.yaml
640-
apiKeyStoreId:
641-
$ref: components/securitySchemes/apiKeyStoreId.yaml
642-
apiKeyQueueId:
643-
$ref: components/securitySchemes/apiKeyQueueId.yaml
644629
security:
645630
- httpBearer: []
646631
- apiKey: []

apify-api/openapi/paths/actor-builds/actor-builds@{buildId}.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ get:
1313
This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However,
1414
if you access the endpoint without the token, certain attributes, such as `usageUsd` and `usageTotalUsd`, will be hidden.
1515
operationId: actorBuild_get
16-
security:
17-
- apiKeyActorBuilds: []
18-
- httpBearerActorBuilds: []
16+
security: []
1917
parameters:
2018
- name: buildId
2119
in: path

0 commit comments

Comments
 (0)