Uploading Files

from obiguard import Obiguard

client = Obiguard(
    obiguard_api_key="OBIGUARD_API_KEY",  # Your Obiguard API key
)

upload_file_response = client.files.create(
  purpose="batch",
  file=open("file.pdf", "rb")
)

print(upload_file_response)

List Files

from obiguard import Obiguard

client = Obiguard(
  obiguard_api_key="OBIGUARD_API_KEY",  # Your Obiguard API key
)

files = client.files.list()

print(files)

Get File

 from obiguard import Obiguard

 client = Obiguard(
  obiguard_api_key="OBIGUARD_API_KEY",  # Your Obiguard API key
 )

file = client.files.retrieve(file_id="file_id")

print(file)

Get File Content

 from obiguard import Obiguard

 client = Obiguard(
  obiguard_api_key="OBIGUARD_API_KEY",  # Your Obiguard API key
 )

file_content = client.files.content(file_id="file_id")

print(file_content)

Delete File

 from obiguard import Obiguard

 client = Obiguard(
  obiguard_api_key="OBIGUARD_API_KEY",  # Your Obiguard API key
 )

delete_file_response = client.files.delete(file_id="file_id")

print(delete_file_response)