Skip to content

Latest commit

 

History

History
165 lines (112 loc) · 4.84 KB

File metadata and controls

165 lines (112 loc) · 4.84 KB

hotdata.UploadsApi

All URIs are relative to https://app.hotdata.dev

Method HTTP request Description
list_uploads GET /v1/files List uploads
upload_file POST /v1/files Upload file

list_uploads

ListUploadsResponse list_uploads(status=status)

List uploads

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.list_uploads_response import ListUploadsResponse
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
    host = "https://app.hotdata.dev"
)

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.UploadsApi(api_client)
    status = 'status_example' # str | Filter by upload status (optional)

    try:
        # List uploads
        api_response = api_instance.list_uploads(status=status)
        print("The response of UploadsApi->list_uploads:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UploadsApi->list_uploads: %s\n" % e)

Parameters

Name Type Description Notes
status str Filter by upload status [optional]

Return type

ListUploadsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of uploads -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upload_file

UploadResponse upload_file(request_body)

Upload file

Upload a file to be used as a dataset source. Send the raw file bytes as the request body with an appropriate Content-Type header (e.g., text/csv, application/json, application/parquet). The returned upload ID can be passed to POST /v1/datasets to create a queryable table.

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.upload_response import UploadResponse
from hotdata.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.hotdata.dev
# See configuration.py for a list of all supported configuration parameters.
configuration = hotdata.Configuration(
    host = "https://app.hotdata.dev"
)

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.UploadsApi(api_client)
    request_body = [56] # List[int] | 

    try:
        # Upload file
        api_response = api_instance.upload_file(request_body)
        print("The response of UploadsApi->upload_file:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UploadsApi->upload_file: %s\n" % e)

Parameters

Name Type Description Notes
request_body List[int]

Return type

UploadResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 File uploaded -
400 Invalid request -

[Back to top] [Back to API list] [Back to Model list] [Back to README]