Appearance
Files API
All URIs are relative to https://api.syntheticusers.com/api/v1
| Method | HTTP request | Description |
|---|---|---|
| create_file | POST /files | Create File |
| delete_file | DELETE /files/ | Delete File |
| get_file | GET /files/ | Get File |
| get_file_download_url | POST /files/{file_id}/download | Get File Download Url |
| list_files | GET /files | List Files |
| start_processing | POST /files/{file_id}/process | Start Processing |
| upload_file_proxy | POST /files/{file_id}/upload | Upload File Proxy |
create_file
FileWithPresignedURL create_file(file_create)
Create File
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file_create import FileCreate
from syntheticusers.models.file_with_presigned_url import FileWithPresignedURL
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_create = syntheticusers.FileCreate() # FileCreate |
try:
# Create File
api_response = api_instance.create_file(file_create)
print("The response of FilesApi->create_file:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->create_file: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_create | FileCreate |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
delete_file
object delete_file(file_id)
Delete File
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_id = 'file_id_example' # str |
try:
# Delete File
api_response = api_instance.delete_file(file_id)
print("The response of FilesApi->delete_file:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->delete_file: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_id | str |
Return type
object
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
get_file
File get_file(file_id)
Get File
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file import File
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_id = 'file_id_example' # str |
try:
# Get File
api_response = api_instance.get_file(file_id)
print("The response of FilesApi->get_file:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->get_file: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
get_file_download_url
FileDownloadURL get_file_download_url(file_id)
Get File Download Url
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file_download_url import FileDownloadURL
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_id = 'file_id_example' # str |
try:
# Get File Download Url
api_response = api_instance.get_file_download_url(file_id)
print("The response of FilesApi->get_file_download_url:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->get_file_download_url: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
list_files
PageFile list_files(id=id, uses=uses, project_id=project_id, page=page, size=size)
List Files
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_file import PageFile
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
id = 'id_example' # str | Comma-separated list of file IDs (optional)
uses = 'uses_example' # str | Filter by file usage (optional)
project_id = 'project_id_example' # str | Comma-separated list of project IDs (optional)
page = 1 # int | Page number (optional) (default to 1)
size = 50 # int | Page size (optional) (default to 50)
try:
# List Files
api_response = api_instance.list_files(id=id, uses=uses, project_id=project_id, page=page, size=size)
print("The response of FilesApi->list_files:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->list_files: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | Comma-separated list of file IDs | [optional] |
| uses | str | Filter by file usage | [optional] |
| project_id | str | Comma-separated list of project IDs | [optional] |
| page | int | Page number | [optional] [default to 1] |
| size | int | Page size | [optional] [default to 50] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
start_processing
File start_processing(file_id)
Start Processing
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file import File
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_id = 'file_id_example' # str |
try:
# Start Processing
api_response = api_instance.start_processing(file_id)
print("The response of FilesApi->start_processing:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->start_processing: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_id | str |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
upload_file_proxy
object upload_file_proxy(file_id, file=file)
Upload File Proxy
Proxy endpoint for file uploads when clients cannot access S3 directly. This endpoint mimics S3 presigned POST behavior, accepting form data with the file blob.
Example
- Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
host = "https://api.syntheticusers.com/api/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = syntheticusers.FilesApi(api_client)
file_id = 'file_id_example' # str |
file = None # bytearray | (optional)
try:
# Upload File Proxy
api_response = api_instance.upload_file_proxy(file_id, file=file)
print("The response of FilesApi->upload_file_proxy:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling FilesApi->upload_file_proxy: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| file_id | str | ||
| file | bytearray | [optional] |
Return type
object
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |