### Install Fax.Plus Python SDK with Setuptools Source: https://github.com/alohihq/faxplus-python/blob/master/README.md Install the package using Setuptools after cloning the repository. Use `--user` for user-specific installation or `sudo` for system-wide installation. ```sh git clone https://github.com/alohi/faxplus-python.git cd faxplus-python python setup.py install --user ``` ```sh sudo python setup.py install ``` -------------------------------- ### Install Fax.Plus Python SDK Source: https://github.com/alohihq/faxplus-python/blob/master/README.md Install the package using pip. You can install from PyPi or directly from GitHub. ```sh pip install faxplus-api ``` ```sh pip install git+https://github.com/alohi/faxplus-python.git ``` -------------------------------- ### Initialize Fax.Plus API Client and List Faxes Source: https://github.com/alohihq/faxplus-python/blob/master/README.md Example of initializing the Fax.Plus API client with an access token and listing faxes from the inbox. Ensure you replace 'YOUR_ACCESS_TOKEN' with your actual token. ```python from faxplus import ApiClient, Configuration, FaxesApi configuration = Configuration() configuration.access_token = "YOUR_ACCESS_TOKEN" client = ApiClient(configuration) api = FaxesApi() faxes = api.list_faxes("self", category=FaxCategory.INBOX) ``` -------------------------------- ### Configuration and ApiClient Setup Source: https://context7.com/alohihq/faxplus-python/llms.txt Set up the Configuration and ApiClient for the Fax.Plus Python SDK. This includes setting your access token, enabling debug logging, and configuring SSL or proxy options. ```APIDOC ## Configuration and ApiClient Setup ### Description Set up the Configuration and ApiClient for the Fax.Plus Python SDK. This includes setting your access token, enabling debug logging, and configuring SSL or proxy options. ### Method ```python from faxplus import ApiClient, Configuration # Basic OAuth2 / PAT setup config = Configuration() config.access_token = "YOUR_OAUTH2_OR_PAT_TOKEN" # Optional: enable debug logging to stderr config.debug = True # Optional: log to a file instead # config.logger_file = "/var/log/faxplus.log" # Optional: disable SSL verification (not recommended for production) # config.verify_ssl = False # Optional: route through a proxy # config.proxy = "http://proxy.example.com:8080" client = ApiClient(configuration=config) # Print SDK/API debug info print(config.to_debug_report()) ``` ### Response Example ```json { "example": "Python SDK Debug Report:\nOS: linux\nPython Version: 3.11.0\nVersion of the API: 3.0.3\nSDK Package Version: 3.0.4" } ``` ``` -------------------------------- ### Get Account Information Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md Retrieves information about a specific account. Use 'self' for your own account. ```APIDOC ## GET /accounts/{user_id} ### Description Get account information. Get information about an account. For members user_id can only be self. For admin it can be either self, or a user_id of any corporate member. ### Method GET ### Endpoint /accounts/{user_id} ### Parameters #### Path Parameters - **user_id** (str) - Required - User ID to get information about. For your own account use 'self' ### Response #### Success Response (200) - **Account** (Account) - Description of the Account model. ### Request Example ```python import faxplus from faxplus.rest import ApiException from pprint import pprint configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) user_id = 'user_id_example' try: api_response = api_instance.get_user(user_id) pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->get_user: %s\n" % e) ``` ``` -------------------------------- ### Get Account Information using AccountsApi Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md Fetch information about a specific account. For members, you can only query 'self'. Admins can query 'self' or any corporate member's user ID. Ensure proper authentication. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) user_id = 'user_id_example' # str | User ID to get information about. For your own account use **'self'** try: # Get account information api_response = api_instance.get_user(user_id) pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->get_user: %s\n" % e) ``` -------------------------------- ### Get Fax Confirmation Report - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Retrieve the confirmation report for a specific fax. Ensure your access token and client ID are configured. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FilesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member fax_id = 'fax_id_example' # str | ID of the fax which you want to download try: # Get fax confirmation report api_response = api_instance.get_fax_report(user_id, fax_id) pprint(api_response) except ApiException as e: print("Exception when calling FilesApi->get_fax_report: %s\n" % e) ``` -------------------------------- ### Get Fax Record Details - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FaxesApi.md Retrieve details of a specific fax record, such as duration and pages, by providing the user ID and fax ID. Requires authentication and client ID setup. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FaxesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member fax_id = 'fax_id_example' # str | try: # Get a fax record api_response = api_instance.get_fax(user_id, fax_id) pprint(api_response) except ApiException as e: print("Exception when calling FaxesApi->get_fax: %s\n" % e) ``` -------------------------------- ### Get Account Information using AccountsApi Source: https://context7.com/alohihq/faxplus-python/llms.txt Retrieve your own account details or a corporate member's account information using the AccountsApi. Supports synchronous, asynchronous, and raw HTTP info retrieval. ```python from faxplus import ApiClient, Configuration, AccountsApi config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = AccountsApi(api_client=client) # Get your own account details account = api.get_user("self") print(account.id) # e.g. "usr_abc123" print(account.account_type) # AccountType enum print(account.status) # AccountStatus enum # Get a corporate member's account (admin only) member_account = api.get_user("usr_xyz789") # Async variant — returns a multiprocessing.pool.ApplyResult thread = api.get_user("self", async_req=True) account_async = thread.get() # With full HTTP info (data, status_code, headers) data, status, headers = api.get_user_with_http_info("self") print(status) # 200 ``` -------------------------------- ### List and Retrieve Fax Records with FaxesApi Source: https://context7.com/alohihq/faxplus-python/llms.txt Use `list_faxes` to get paginated fax history filtered by category and date. `get_fax` retrieves metadata for a single fax. ```python from faxplus import ApiClient, Configuration, FaxesApi, FaxCategory config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = FaxesApi(api_client=client) # List inbox faxes with date range and page limit (max 50) fax_list = api.list_faxes( user_id="self", category=FaxCategory.INBOX, after="2024-01-01 00:00:00", before="2024-06-30 23:59:59", limit=20 ) for fax in fax_list.data.faxes: print(fax.id, fax.from_number, fax.pages, fax.status) # List sent faxes for a corporate member sent = api.list_faxes("usr_xyz789", category=FaxCategory.SENT, limit=10) # Retrieve a single fax record fax = api.get_fax("self", "fax_abc123") print(fax.id) print(fax.direction) # FaxDirection enum print(fax.status) # FaxStatus enum print(fax.duration) # duration in seconds print(fax.cost_details) # FaxCostDetails object ``` -------------------------------- ### Get Number Information - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/NumbersApi.md Use this method to retrieve details about a specific purchased or assigned fax number. Ensure your access token and client ID are configured. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.NumbersApi(api_client) user_id = 'user_id_example' # str | ID of the number owner number = 'number_example' # str | Fax number to get information about try: # Get number information api_response = api_instance.get_number(user_id, number) pprint(api_response) except ApiException as e: print("Exception when calling NumbersApi->get_number: %s\n" % e) ``` -------------------------------- ### Get Fax Report Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Retrieves the confirmation report for a specific fax. ```APIDOC ## GET /accounts/{user_id}/report/{fax_id} ### Description Get fax confirmation report Retrieve fax confirmation report ### Method GET ### Endpoint /accounts/{user_id}/report/{fax_id} ### Parameters #### Path Parameters - **user_id** (str) - Required - self or user id of a corporate member - **fax_id** (str) - Required - ID of the fax which you want to download ### Response #### Success Response (200) - **Binary** (Binary) - fax confirmation report ### Authorization [OAuth2](../README.md#OAuth2), [PAT](../README.md#PAT) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/pdf, application/json ``` -------------------------------- ### Get Member Details Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md Retrieves the role and faxing quota for a specific corporate member. ```APIDOC ## GET /accounts/self/member-details/{member_user_id} ### Description Get member details. Get corporate member's role and faxing quota. ### Method GET ### Endpoint /accounts/self/member-details/{member_user_id} ### Parameters #### Path Parameters - **member_user_id** (str) - Required - Member user ID ### Response #### Success Response (200) - **MemberDetail** (MemberDetail) - Description of the MemberDetail model. ### Request Example ```python import faxplus from faxplus.rest import ApiException from pprint import pprint configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) member_user_id = 'member_user_id_example' try: api_response = api_instance.get_member_details(member_user_id) pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->get_member_details: %s\n" % e) ``` ``` -------------------------------- ### Get Member Details using AccountsApi Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md Retrieve specific details for a corporate member, including their role and faxing quota. You need to provide the member's user ID. Ensure authentication is set up correctly. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) member_user_id = 'member_user_id_example' # str | Member user ID try: # Get member details api_response = api_instance.get_member_details(member_user_id) pprint(api_response) except ApiException as e: print("Exception when calling AccountsApi->get_member_details: %s\n" % e) ``` -------------------------------- ### Configure ApiClient and SDK Settings Source: https://context7.com/alohihq/faxplus-python/llms.txt Set up the Configuration object with your access token and optional settings like debug logging, SSL verification, and proxy. The ApiClient is then instantiated with this configuration. ```python from faxplus import ApiClient, Configuration # Basic OAuth2 / PAT setup config = Configuration() config.access_token = "YOUR_OAUTH2_OR_PAT_TOKEN" # Optional: enable debug logging to stderr config.debug = True # Optional: log to a file instead # config.logger_file = "/var/log/faxplus.log" # Optional: disable SSL verification (not recommended for production) # config.verify_ssl = False # Optional: route through a proxy # config.proxy = "http://proxy.example.com:8080" client = ApiClient(configuration=config) # Print SDK/API debug info print(config.to_debug_report()) # Python SDK Debug Report: # OS: linux # Python Version: 3.11.0 # Version of the API: 3.0.3 # SDK Package Version: 3.0.4 ``` -------------------------------- ### Get Number Information Source: https://github.com/alohihq/faxplus-python/blob/master/docs/NumbersApi.md Retrieves information about a specific purchased or assigned fax number. ```APIDOC ## GET /accounts/{user_id}/numbers/{number} ### Description Get information about a single purchased/assigned fax number. ### Method GET ### Endpoint /accounts/{user_id}/numbers/{number} ### Parameters #### Path Parameters - **user_id** (str) - Required - ID of the number owner - **number** (str) - Required - Fax number to get information about ### Response #### Success Response (200) - **Number** (Number) - Details of the fax number ``` -------------------------------- ### List user webhooks for a specific event Source: https://github.com/alohihq/faxplus-python/blob/master/docs/WebhooksApi.md Use this to retrieve a list of all registered webhooks for a given event. Ensure your access token and client ID are configured. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.WebhooksApi(api_client) event = faxplus.WebhookEventType() # WebhookEventType | try: # List user webhooks api_response = api_instance.get_webhooks(event) pprint(api_response) except ApiException as e: print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) ``` -------------------------------- ### Register and Manage Webhooks with WebhooksApi Source: https://context7.com/alohihq/faxplus-python/llms.txt Use `create_webhook` to register callback URLs for fax events. `get_webhooks` lists registered hooks, and `delete_webhook` removes a hook. Webhook payloads conform to the `WebhookCallback` model. ```python from faxplus import ( ApiClient, Configuration, WebhooksApi, Webhook, WebhookEventType, WebhookCallback ) config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = WebhooksApi(api_client=client) # Register a webhook for received faxes new_hook = Webhook( event=WebhookEventType.RECEIVE_FAX, target="https://myapp.example.com/webhooks/fax-received" ) result = api.create_webhook(body=new_hook) print(result.hook_id) # e.g. "hook_abc123" # Register another webhook for sent fax confirmation sent_hook = Webhook( event=WebhookEventType.SENT_FAX, target="https://myapp.example.com/webhooks/fax-sent" ) api.create_webhook(body=sent_hook) # List all webhooks registered for receive_fax events hooks = api.get_webhooks(event=WebhookEventType.RECEIVE_FAX) for hook in hooks.hooks: print(hook.hook_id, hook.target) # Delete a webhook by ID api.delete_webhook("hook_abc123") print("Webhook deleted.") ``` -------------------------------- ### List and Manage Corporate Members with AccountsApi Source: https://context7.com/alohihq/faxplus-python/llms.txt Manage corporate members by listing them, retrieving their details (role, quota), and updating them. Also includes modifying your own account settings. ```python from faxplus import ApiClient, Configuration, AccountsApi, MemberDetail, PayloadAccountModification config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = AccountsApi(api_client=client) # List all corporate members (admin only) account_list = api.get_accounts() for member in account_list.accounts: print(member.id, member.account_type) # Get role and quota for a specific member member_detail = api.get_member_details("usr_xyz789") print(member_detail.role) # e.g. "admin" | "member" print(member_detail.quota) # faxing quota info # Update member role and quota updated = MemberDetail(role="member", quota=member_detail.quota) api.update_member_details("usr_xyz789", body=updated) # Modify your own account's settings payload = PayloadAccountModification( settings=None, # pass an AccountSettings object to update settings notifications=None ) api.update_user("self", body=payload) ``` -------------------------------- ### Register a new webhook Source: https://github.com/alohihq/faxplus-python/blob/master/docs/WebhooksApi.md Use this to register a new webhook that will be called on a specific event. Ensure your access token and client ID are configured. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.WebhooksApi(api_client) body = faxplus.Webhook() # Webhook | Request to create new webhook (optional) try: # Register new webhook api_response = api_instance.create_webhook(body=body) pprint(api_response) except ApiException as e: print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) ``` -------------------------------- ### Get Outgoing Fax Details - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/OutboxApi.md Retrieve details of a specific outgoing fax using its ID. This requires proper authentication and client identification. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.OutboxApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member outbox_fax_id = 'outbox_fax_id_example' # str | ID of the outgoing fax to get try: # List outgoing faxes api_response = api_instance.get_outbox_fax(user_id, outbox_fax_id) pprint(api_response) except ApiException as e: print("Exception when calling OutboxApi->get_outbox_fax: %s\n" % e) ``` -------------------------------- ### WebhooksApi — Register, List, and Delete Webhooks Source: https://context7.com/alohihq/faxplus-python/llms.txt This section describes how to manage webhooks, including registering new webhooks for specific events, listing existing webhooks, and deleting webhooks. ```APIDOC ## WebhooksApi — Register, List, and Delete Webhooks `WebhooksApi.create_webhook(body)` registers a callback URL for a specific `WebhookEventType` (`sent_fax`, `receive_fax`). `get_webhooks(event)` lists all registered hooks for an event. `delete_webhook(hook_id)` removes a hook. Webhook payloads received by your server conform to the `WebhookCallback` model. ```python from faxplus import ( ApiClient, Configuration, WebhooksApi, Webhook, WebhookEventType, WebhookCallback ) config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = WebhooksApi(api_client=client) # Register a webhook for received faxes new_hook = Webhook( event=WebhookEventType.RECEIVE_FAX, target="https://myapp.example.com/webhooks/fax-received" ) result = api.create_webhook(body=new_hook) print(result.hook_id) # e.g. "hook_abc123" # Register another webhook for sent fax confirmation sent_hook = Webhook( event=WebhookEventType.SENT_FAX, target="https://myapp.example.com/webhooks/fax-sent" ) api.create_webhook(body=sent_hook) # List all webhooks registered for receive_fax events hooks = api.get_webhooks(event=WebhookEventType.RECEIVE_FAX) for hook in hooks.hooks: print(hook.hook_id, hook.target) # Delete a webhook by ID api.delete_webhook("hook_abc123") print("Webhook deleted.") ``` ``` -------------------------------- ### Get Fax Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FaxesApi.md Retrieves the details of a specific fax record, including information such as duration and page count. This is useful for auditing or reviewing past fax transmissions. ```APIDOC ## GET /accounts/{user_id}/faxes/{fax_id} ### Description Get a specific fax record details like duration, pages etc. ### Method GET ### Endpoint /accounts/{user_id}/faxes/{fax_id} ### Parameters #### Path Parameters - **user_id** (str) - Required - self or user id of a corporate member - **fax_id** (str) - Required - ### Return Type [Fax](Fax.md) ### Authorization [OAuth2](../README.md#OAuth2), [PAT](../README.md#PAT) ### HTTP Request Headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Send a Fax with Options Source: https://context7.com/alohihq/faxplus-python/llms.txt Sends a fax using previously uploaded files. Allows specifying sender, recipients, files, cover page, scheduled time, and retry/notification options. Handles potential sending failures. ```python from faxplus import ( ApiClient, Configuration, FilesApi, OutboxApi, PayloadOutbox, OutboxOptions, OutboxCoverPage, OutboxComment, RetryOptions ) config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) # Step 1: Upload the document files_api = FilesApi(api_client=client) with open("invoice.pdf", "rb") as f: uploaded = files_api.upload_file("self", fax_file=f, format="pdf") # Step 2: Send the fax outbox_api = OutboxApi(api_client=client) payload = PayloadOutbox( from_number="+12015551234", # Your Fax.Plus number to=["+14155550100", "+14155550101"], # One or more recipients files=[uploaded.file_path], # Files uploaded in step 1 comment=OutboxComment(text="Please review the attached invoice."), options=OutboxOptions( retry=RetryOptions(count=2, delay=5) ), send_time="2024-09-01 09:00:00 +0000", # Schedule (optional) return_ids=True, cover_page=OutboxCoverPage( to="Acme Corp", from_field="Your Company", subject="Invoice #1042", message="Attached please find invoice #1042." ) ) try: response = outbox_api.send_fax(user_id="self", body=payload) print(response.ids) # List of scheduled fax IDs except Exception as e: print(f"Failed to send fax: {e}") # Corporate member without an assigned number payload_no_number = PayloadOutbox( from_number="no_number", to=["+14155550200"], files=[uploaded.file_path] ) outbox_api.send_fax("usr_member123", body=payload_no_number) ``` -------------------------------- ### Upload a PDF file for faxing Source: https://context7.com/alohihq/faxplus-python/llms.txt Uploads a PDF document to be used for sending a fax. The returned file path should be used when constructing the `PayloadOutbox`. ```python with open("/path/to/document.pdf", "rb") as f: file_path_obj = api.upload_file( user_id="self", fax_file=f, format="pdf" ) print(file_path_obj.file_path) ``` -------------------------------- ### OutboxOptions Source: https://github.com/alohihq/faxplus-python/blob/master/docs/OutboxOptions.md Defines additional configuration parameters for sending faxes. ```APIDOC ## OutboxOptions Additional configuration for sending a fax ### Properties - **enhancement** (bool): Text enhancement. Set to True to optimize fax file for text. Optional, defaults to True. - **retry** (RetryOptions): Configuration for retrying fax sending. Optional. ``` -------------------------------- ### AccountSettings Properties Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountSettings.md Defines the structure for account settings, allowing configuration of various account-related features. ```APIDOC ## AccountSettings ### Description Represents the configuration settings for a user's account. ### Properties - **caller_id_name** (str) - Optional - The caller ID name associated with the account. - **options** (object) - Optional - General options for the account. - **send_fax** (AccountSettingsSendFax) - Optional - Settings related to sending faxes. - **should_enhance** (bool) - Optional - A flag to indicate if fax enhancement is enabled. ``` -------------------------------- ### Upload a File using FilesApi Source: https://context7.com/alohihq/faxplus-python/llms.txt Upload documents (PDF or TIFF) to the Fax.Plus server using FilesApi. The uploaded file's path is returned and needed for sending faxes. ```python from faxplus import ApiClient, Configuration, FilesApi config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = FilesApi(api_client=client) ``` -------------------------------- ### OutboxFileChanges Properties Source: https://github.com/alohihq/faxplus-python/blob/master/docs/OutboxFileChanges.md The OutboxFileChanges model includes 'at' and 'files' properties. 'at' is an optional string representing a timestamp, and 'files' is an optional list of OutboxFiles objects. ```APIDOC ## OutboxFileChanges ### Description Represents changes related to files in the outbox. ### Properties #### `at` - **Type**: `str` - **Description**: Timestamp of the change. - **Notes**: [optional] #### `files` - **Type**: `list[OutboxFiles]` - **Description**: List of files associated with the outbox change. - **Notes**: [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) ``` -------------------------------- ### Download Fax File and Confirmation Report Source: https://context7.com/alohihq/faxplus-python/llms.txt Downloads a sent or received fax as a PDF or TIFF, or downloads the confirmation report for a sent fax. Both methods return a `Binary` object containing the file data. ```python from faxplus import ApiClient, Configuration, FilesApi config = Configuration() config.access_token = "YOUR_TOKEN" client = ApiClient(config) api = FilesApi(api_client=client) # Download a received fax as PDF fax_binary = api.get_file(user_id="self", fax_id="fax_abc123", format="pdf") with open("received_fax.pdf", "wb") as out: out.write(fax_binary.data) # Download as TIFF tiff_binary = api.get_file("self", "fax_abc123", format="tiff") with open("received_fax.tiff", "wb") as out: out.write(tiff_binary.data) # Download the confirmation report for a sent fax report = api.get_fax_report(user_id="self", fax_id="fax_sent456") with open("confirmation_report.pdf", "wb") as out: out.write(report.data) ``` -------------------------------- ### List Fax Records - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FaxesApi.md Fetch a list of fax records for yourself or your subordinates. Supports filtering by category, date range (after/before), and a limit for the number of records. Ensure authentication is configured. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FaxesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member category = faxplus.FaxCategory() # FaxCategory | Category parameter. Valid values: **inbox**, **sent**, **spam** (optional) after = 'after_example' # str | Start date to get records from that date. Format: *YYYY-MM-DD HH:mm:ss* (optional) before = 'before_example' # str | End date to get records before that date. Format: *YYYY-MM-DD HH:mm:ss* (optional) limit = 50 # int | Limit of fax records you want to get per request (optional) (default to 50) try: # List fax records api_response = api_instance.list_faxes(user_id, category=category, after=after, before=before, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling FaxesApi->list_faxes: %s\n" % e) ``` -------------------------------- ### Upload a File using FilesApi Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Use this snippet to upload a file to the FaxPlus service. Ensure you have initialized the ApiClient and FilesApi with your credentials. The `fax_file` parameter can be a file path or file-like object, and `format` can be 'pdf' or 'tiff'. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # create an instance of the API class configuration = faxplus.Configuration() api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FilesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member fax_file = 'fax_file_example' # str | (optional) format = faxplus.FileType() # FileType | Can be 'pdf' or 'tiff' (optional) try: # Upload a file api_response = api_instance.upload_file(user_id, fax_file=fax_file, format=format) pprint(api_response) except ApiException as e: print("Exception when calling FilesApi->upload_file: %s\n" % e) ``` -------------------------------- ### Upload File for Fax - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Upload a file to be used for sending a fax. This requires a multipart/form-data request. The response provides a file_path for subsequent fax sending. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' ``` -------------------------------- ### OutboxInitiatedFrom Model Properties Source: https://github.com/alohihq/faxplus-python/blob/master/docs/OutboxInitiatedFrom.md The OutboxInitiatedFrom model has two optional string properties: from_id and type. ```APIDOC ## OutboxInitiatedFrom ### Description Represents the initiator of an outbox message. ### Properties #### from_id - **Type**: str - **Description**: The ID of the initiator. - **Notes**: [optional] #### type - **Type**: str - **Description**: The type of the initiator. - **Notes**: [optional] ``` -------------------------------- ### Update User Details in Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md This code allows modification of personal account information for yourself or a subordinate. Use 'self' for your own user ID. Configure your access token and client ID before execution. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) user_id = 'user_id_example' # str | User ID to get information about. For your own account use **'self'** body = faxplus.PayloadAccountModification() # PayloadAccountModification | Request object for making changes in account (optional) try: # Modify account information api_instance.update_user(user_id, body=body) except ApiException as e: print("Exception when calling AccountsApi->update_user: %s\n" % e) ``` -------------------------------- ### Upload File Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Uploads a file to be used for sending a fax. Returns a file path upon successful upload. ```APIDOC ## POST /accounts/{user_id}/files ### Description Upload a file Before sending a fax you need to upload your files using this API. In order to upload your fax file, you have to send a `multipart/form-data` request with your file. Set the `name` to `fax_file`, `filename` to your file's name with extension, and the Content-Type to the file's MIME type. In most cases, the `filename` directive will be automatically added by your library of choice. If the upload was successful you would receive a `file_path` which you can use to send your fax. ### Method POST ### Endpoint /accounts/{user_id}/files ### Parameters #### Path Parameters - **user_id** (str) - Required - self or user id of a corporate member #### Request Body - **fax_file** (file) - Required - The fax file to upload - **format** (FileType) - Optional - Specifies the desired output format for the fax file ### Response #### Success Response (200) - **FilePath** (FilePath) - The path to the uploaded file, which can be used to send a fax. ### Authorization [OAuth2](../README.md#OAuth2), [PAT](../README.md#PAT) ### HTTP request headers - **Content-Type**: multipart/form-data - **Accept**: application/json ``` -------------------------------- ### AccountNotifications Model Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountNotifications.md Represents the structure for account notification settings. ```APIDOC ## AccountNotifications ### Description Represents the structure for account notification settings. ### Properties - **black_list** ([AccountNotificationsBlacklist](AccountNotificationsBlacklist.md)) - Optional - Represents the blacklist settings for notifications. - **settings** ([AccountNotificationsSettings](AccountNotificationsSettings.md)) - Optional - Represents general notification settings. ``` -------------------------------- ### Upload a PDF file for faxing Source: https://context7.com/alohihq/faxplus-python/llms.txt Uploads a PDF file to be used for sending faxes. The returned file path should be used when constructing the fax payload. ```APIDOC ## upload_file ### Description Uploads a file (PDF or TIFF) to be used for faxing. Returns a FilePath object containing the path to the uploaded file. ### Method `api.upload_file(user_id, fax_file, format)` ### Parameters - **user_id** (string) - Required - The ID of the user uploading the file. Use "self" for the authenticated user. - **fax_file** (file object) - Required - The file object to upload. - **format** (string) - Required - The format of the file, either "pdf" or "tiff". ### Response Example ```json { "file_path": "usr_abc123/uploads/document.pdf" } ``` ``` -------------------------------- ### List user webhooks Source: https://github.com/alohihq/faxplus-python/blob/master/docs/WebhooksApi.md This method returns a list of all currently registered webhooks for a specified event type. ```APIDOC ## GET /hooks ### Description List user webhooks ### Method GET ### Endpoint /hooks ### Parameters #### Query Parameters - **event** (WebhookEventType) - Required - The event type to filter webhooks by. ### Response #### Success Response (200) - **WebhookList** (WebhookList) - Description of the returned WebhookList object ### Request Example ```python import faxplus from faxplus.rest import ApiException from pprint import pprint configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.WebhooksApi(api_client) event = faxplus.WebhookEventType() try: api_response = api_instance.get_webhooks(event) pprint(api_response) except ApiException as e: print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) ``` ### Response Example ```json { "example": "WebhookList object" } ``` ``` -------------------------------- ### Upload a TIFF file for faxing Source: https://context7.com/alohihq/faxplus-python/llms.txt Uploads a TIFF document for faxing. The returned file path is used in the `PayloadOutbox`. ```python with open("/path/to/scan.tiff", "rb") as f: tiff_path = api.upload_file("self", fax_file=f, format="tiff") ``` -------------------------------- ### Download Fax File - Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Download a sent or received fax file. You can specify the desired format, which overrides the Accept header. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FilesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member fax_id = 'fax_id_example' # str | ID of the fax which you want to download format = faxplus.FileType() # FileType | This parameter overrides the Accept header (optional) try: # Download fax file api_response = api_instance.get_file(user_id, fax_id, format=format) pprint(api_response) except ApiException as e: print("Exception when calling FilesApi->get_file: %s\n" % e) ``` -------------------------------- ### AccountSettingsSendFax Model Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountSettingsSendFax.md The AccountSettingsSendFax model allows for optional configuration of retry options when sending faxes. ```APIDOC ## AccountSettingsSendFax ### Description Represents settings related to sending faxes, specifically allowing for the configuration of retry options. ### Properties #### retry (RetryOptions) - **Type**: [RetryOptions](RetryOptions.md) - **Description**: Optional. Configuration for retrying fax sending operations. - **Notes**: This property is optional. ``` -------------------------------- ### Upload File Source: https://github.com/alohihq/faxplus-python/blob/master/docs/FilesApi.md Uploads a file to be used for faxing. Supports PDF and TIFF formats. ```APIDOC ## Upload File ### Description Uploads a file to be used for faxing. Supports PDF and TIFF formats. ### Method POST ### Endpoint /files ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **user_id** (str) - Required - self or user id of a corporate member - **fax_file** (str) - Optional - The file to upload - **format** (FileType) - Optional - Can be 'pdf' or 'tiff' ### Request Example ```python # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.FilesApi(api_client) user_id = 'user_id_example' # str | self or user id of a corporate member fax_file = 'fax_file_example' # str | (optional) format = faxplus.FileType() # FileType | Can be 'pdf' or 'tiff' (optional) try: # Upload a file api_response = api_instance.upload_file(user_id, fax_file=fax_file, format=format) pprint(api_response) except ApiException as e: print("Exception when calling FilesApi->upload_file: %s\n" % e) ``` ### Response #### Success Response (200) - **FilePath** (FilePath) - Details about the uploaded file path #### Response Example ```json { "example": "response body" } ``` ### Authorization [OAuth2](../README.md#OAuth2), [PAT](../README.md#PAT) ### HTTP request headers - **Content-Type**: multipart/form-data - **Accept**: application/json ``` -------------------------------- ### Register a new webhook Source: https://github.com/alohihq/faxplus-python/blob/master/docs/WebhooksApi.md This method registers a new webhook that will be called when a specific event occurs. You can optionally provide a Webhook object in the request body. ```APIDOC ## POST /hooks ### Description Register new webhook ### Method POST ### Endpoint /hooks ### Parameters #### Request Body - **body** (Webhook) - Optional - Request to create new webhook ### Response #### Success Response (200) - **WebhookId** (WebhookId) - Description of the returned WebhookId object ### Request Example ```python import faxplus from faxplus.rest import ApiException from pprint import pprint configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.WebhooksApi(api_client) body = faxplus.Webhook() try: api_response = api_instance.create_webhook(body=body) pprint(api_response) except ApiException as e: print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) ``` ### Response Example ```json { "example": "WebhookId object" } ``` ``` -------------------------------- ### WebhookCallbackHook Properties Source: https://github.com/alohihq/faxplus-python/blob/master/docs/WebhookCallbackHook.md The WebhookCallbackHook model includes properties for event identification and details. ```APIDOC ## WebhookCallbackHook ### Description Represents a webhook callback event with details about the event and its context. ### Properties #### id (str) - Optional Fax ID associated with the event. #### event (str) - Optional The type of event that occurred. #### event_time (str) - Optional The timestamp when the event occurred. Format: YYYY-MM-DD HH:mm:ss. #### target (str) - Optional The configured URL target for this webhook. ``` -------------------------------- ### FilesApi — Download Fax File and Confirmation Report Source: https://context7.com/alohihq/faxplus-python/llms.txt Downloads sent or received faxes as PDF or TIFF, and downloads fax confirmation reports. ```APIDOC ## FilesApi.get_file ### Description Downloads a sent or received fax as a PDF or TIFF file. Returns a Binary object containing the fax data. ### Method `api.get_file(user_id, fax_id, format)` ### Parameters - **user_id** (string) - Required - The ID of the user whose fax is being downloaded. Use "self" for the authenticated user. - **fax_id** (string) - Required - The ID of the fax to download. - **format** (string) - Required - The desired format of the fax file, either "pdf" or "tiff". ### Response Example Returns a Binary object with a `data` attribute containing the file content. ```python # Example of writing the binary data to a file with open("received_fax.pdf", "wb") as out: out.write(fax_binary.data) ``` ## FilesApi.get_fax_report ### Description Downloads the confirmation report for a sent fax as a PDF file. Returns a Binary object containing the report data. ### Method `api.get_fax_report(user_id, fax_id)` ### Parameters - **user_id** (string) - Required - The ID of the user whose fax report is being downloaded. Use "self" for the authenticated user. - **fax_id** (string) - Required - The ID of the fax for which to retrieve the confirmation report. ### Response Example Returns a Binary object with a `data` attribute containing the report content. ```python # Example of writing the binary data to a file with open("confirmation_report.pdf", "wb") as out: out.write(report.data) ``` ``` -------------------------------- ### Webhook Model Properties Source: https://github.com/alohihq/faxplus-python/blob/master/docs/Webhook.md The Webhook model contains the following properties: id, target, and event. ```APIDOC ## Webhook Model ### Properties - **id** (str) - Optional - Webhook ID - **target** (str) - Required - Webhook target URL - **event** (WebhookEventType) - Required - The type of event that triggers the webhook. ``` -------------------------------- ### Update Member Details in Python Source: https://github.com/alohihq/faxplus-python/blob/master/docs/AccountsApi.md Use this snippet to modify a corporate member's role and faxing quota. Ensure you have configured your access token and client ID. ```python import faxplus from faxplus.rest import ApiException from pprint import pprint # Configure access token for authorization: OAuth2, PAT configuration = faxplus.Configuration() configuration.access_token = 'YOUR_ACCESS_TOKEN' # create an instance of the API class api_client = faxplus.ApiClient(configuration) api_client.set_default_header('x-fax-clientid', 'YOUR_CLIENT_ID') api_instance = faxplus.AccountsApi(api_client) member_user_id = 'member_user_id_example' # str | Member user ID body = faxplus.MemberDetail() # MemberDetail | Request object for making changes in member details (optional) try: # Modify member details api_instance.update_member_details(member_user_id, body=body) except ApiException as e: print("Exception when calling AccountsApi->update_member_details: %s\n" % e) ```