You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*OpenFgaApi* | [**batch_check**](https://github.com/openfga/python-sdk/blob/main/docs/OpenFgaApi.md#batch_check) | **POST** /stores/{store_id}/batch-check | Send a list of `check` operations in a single request
1046
1056
*OpenFgaApi* | [**check**](https://github.com/openfga/python-sdk/blob/main/docs/OpenFgaApi.md#check) | **POST** /stores/{store_id}/check | Check whether a user is authorized to access an object
1047
1057
*OpenFgaApi* | [**create_store**](https://github.com/openfga/python-sdk/blob/main/docs/OpenFgaApi.md#create_store) | **POST** /stores | Create a store
1048
1058
*OpenFgaApi* | [**delete_store**](https://github.com/openfga/python-sdk/blob/main/docs/OpenFgaApi.md#delete_store) | **DELETE** /stores/{store_id} | Delete a store
**correlation_id** | **str** | correlation_id must be a string containing only letters, numbers, or hyphens, with length ≤ 36 characters. |
11
+
12
+
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
**result** | [**dict[str, BatchCheckSingleResult]**](BatchCheckSingleResult.md) | map keys are the correlation_id values from the BatchCheckItems in the request | [optional]
8
+
9
+
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
[[Back to Model list]](../README.md#documentation-for-models)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to README]](../README.md)
Copy file name to clipboardExpand all lines: docs/OpenFgaApi.md
+85Lines changed: 85 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ All URIs are relative to *api.fga.example*
4
4
5
5
Method | HTTP request | Description
6
6
------------- | ------------- | -------------
7
+
[**batch_check**](OpenFgaApi.md#batch_check) | **POST** /stores/{store_id}/batch-check | Send a list of `check` operations in a single request
7
8
[**check**](OpenFgaApi.md#check) | **POST** /stores/{store_id}/check | Check whether a user is authorized to access an object
8
9
[**create_store**](OpenFgaApi.md#create_store) | **POST** /stores | Create a store
9
10
[**delete_store**](OpenFgaApi.md#delete_store) | **DELETE** /stores/{store_id} | Delete a store
[**write_authorization_model**](OpenFgaApi.md#write_authorization_model) | **POST** /stores/{store_id}/authorization-models | Create a new authorization model
23
24
24
25
26
+
# **batch_check**
27
+
> BatchCheckResponse batch_check(body)
28
+
29
+
Send a list of `check` operations in a single request
30
+
31
+
The `BatchCheck` API functions nearly identically to `Check`, but instead of checking a single user-object relationship BatchCheck accepts a list of relationships to check and returns a map containing `BatchCheckItem` response for each check it received. An associated `correlation_id` is required for each check in the batch. This ID is used to correlate a check to the appropriate response. It is a string consisting of only alphanumeric characters or hyphens with a maximum length of 36 characters. This `correlation_id` is used to map the result of each check to the item which was checked, so it must be unique for each item in the batch. We recommend using a UUID or ULID as the `correlation_id`, but you can use whatever unique identifier you need as long as it matches this regex pattern: `^[\\w\\d-]{1,36}$` For more details on how `Check` functions, see the docs for `/check`. ### Examples #### A BatchCheckRequest ```json { \"checks\": [ { \"tuple_key\": { \"object\": \"document:2021-budget\" \"relation\": \"reader\", \"user\": \"user:anne\", }, \"contextual_tuples\": {...} \"context\": {} \"correlation_id\": \"01JA8PM3QM7VBPGB8KMPK8SBD5\" }, { \"tuple_key\": { \"object\": \"document:2021-budget\" \"relation\": \"reader\", \"user\": \"user:bob\", }, \"contextual_tuples\": {...} \"context\": {} \"correlation_id\": \"01JA8PMM6A90NV5ET0F28CYSZQ\" } ] } ``` Below is a possible response to the above request. Note that the result map's keys are the `correlation_id` values from the checked items in the request: ```json { \"result\": { \"01JA8PMM6A90NV5ET0F28CYSZQ\": { \"allowed\": false, \"error\": {\"message\": \"\"} }, \"01JA8PM3QM7VBPGB8KMPK8SBD5\": { \"allowed\": true, \"error\": {\"message\": \"\"} } } ```
32
+
33
+
### Example
34
+
35
+
```python
36
+
import time
37
+
import openfga_sdk
38
+
from openfga_sdk.rest import ApiException
39
+
from pprint import pprint
40
+
# To configure the configuration
41
+
# host is mandatory
42
+
# api_scheme is optional and default to https
43
+
# store_id is mandatory
44
+
# See configuration.py for a list of all supported configuration parameters.
**400** | Request failed due to invalid input. | - |
101
+
**401** | Not authenticated. | - |
102
+
**403** | Forbidden. | - |
103
+
**404** | Request failed due to incorrect path. | - |
104
+
**409** | Request was aborted due a transaction conflict. | - |
105
+
**422** | Request timed out due to excessive request throttling. | - |
106
+
**500** | Request failed due to internal server error. | - |
107
+
108
+
[[Back to top]](#)[[Back to API list]](../README.md#documentation-for-api-endpoints)[[Back to Model list]](../README.md#documentation-for-models)[[Back to README]](../README.md)
0 commit comments