Faxes Python API Docs | dltHub

Build a Faxes-to-database pipeline in Python using dlt with AI Workbench support for Claude Code, Cursor, and Codex.

Last updated:

RingCentral Fax API is a REST API for sending, receiving and retrieving fax messages and fax attachments in business accounts. The REST API base URL is https://platform.ringcentral.com/restapi/v1.0 and all requests require a Bearer token for authentication.

dlt is an open-source Python library that handles authentication, pagination, and schema evolution automatically. dlthub provides AI context files that enable code assistants to generate production-ready pipelines. Install with uv pip install "dlt[workspace]" and start loading Faxes data in under 10 minutes.


What data can I load from Faxes?

Here are some of the endpoints you can load from Faxes:

ResourceEndpointMethodData selectorDescription
message_store/account//extension//message-storeGETrecordsList messages (use query params messageType=Fax, direction=Inbound/Outbound, dateFrom/dateTo, page, perPage). Returns paginated 'records'.
message/account//extension//message-store/{messageId}GET(single object)Get metadata for a single message (fax) by ID.
message_content/account//extension//message-store/{messageId}/content/{attachmentId}GET(binary / attachment resource)Retrieve a fax attachment (RenderedDocument PDF) for a message.
account_message_store/account/~/message-storeGETrecordsAccount-level message-store listing (supports messageType=Fax).
message_search/account//extension//message-store?messageType=Fax&dateFrom={dateFrom}&dateTo={dateTo}GETrecordsFiltered list of fax messages by date range (example of query usage).
send_fax/account//extension//faxPOST(object)Send a fax (multipart/form-data or multipart/mixed with JSON boundary and attachments). Included for context—response contains sent message id.

How do I authenticate with the Faxes API?

RingCentral APIs use OAuth2 bearer access tokens for authentication (SDKs also support user JWTs for login). Include Authorization: Bearer <access_token> header on requests. Apps must register to obtain client_id and client_secret and perform the OAuth flow (or use JWT for server-side auth via SDK).

1. Get your credentials

  1. Sign in to the RingCentral Developer Portal and create a new app. 2) Choose the app type (Server/Bot or Web App) and record the client_id and client_secret. 3) For server-to-server or automated flows, configure and use a JWT (or perform OAuth2 client credentials/authorization code flow) to obtain an access token. 4) Exchange credentials for an access token and add 'Authorization: Bearer <access_token>' to API requests.

2. Add them to .dlt/secrets.toml

[sources.faxes_source] access_token = "your_bearer_token_here" client_id = "your_client_id_here" client_secret = "your_client_secret_here"

dlt reads this automatically at runtime — never hardcode tokens in your pipeline script. For production environments, see setting up credentials with dlt for environment variable and vault-based options.


How do I set up and run the pipeline?

Set up a virtual environment and install dlt:

uv venv && source .venv/bin/activate uv pip install "dlt[workspace]"

1. Install the dlt AI Workbench:

dlt ai init --agent <your-agent> # <agent>: claude | cursor | codex

This installs project rules, a secrets management skill, appropriate ignore files, and configures the dlt MCP server for your agent. Learn more →

2. Install the rest-api-pipeline toolkit:

dlt ai toolkit rest-api-pipeline install

This loads the skills and context about dlt the agent uses to build the pipeline iteratively, efficiently, and safely. The agent uses MCP tools to inspect credentials — it never needs to read your secrets.toml directly. Learn more →

3. Start LLM-assisted coding:

Use /find-source to load data from the Faxes API into DuckDB.

The rest-api-pipeline toolkit takes over from here — it reads relevant API documentation, presents you with options for which endpoints to load, and follows a structured workflow to scaffold, debug, and validate the pipeline step by step.

4. Run the pipeline:

python faxes_pipeline.py

If everything is configured correctly, you'll see output like this:

Pipeline faxes_pipeline load step completed in 0.26 seconds 1 load package(s) were loaded to destination duckdb and into dataset faxes_data The duckdb destination used duckdb:/faxes.duckdb location to store data Load package 1749667187.541553 is LOADED and contains no failed jobs

Inspect your pipeline and data:

dlt pipeline faxes_pipeline show

This opens the Pipeline Dashboard where you can verify pipeline state, load metrics, schema (tables, columns, types), and query the loaded data directly.


Python pipeline example

This example loads message_store and message_content from the Faxes API into DuckDB. It mirrors the endpoint and data selector configuration from the table above:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def faxes_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://platform.ringcentral.com/restapi/v1.0", "auth": { "type": "bearer", "token": access_token, }, }, "resources": [ {"name": "message_store", "endpoint": {"path": "account/~/extension/~/message-store", "data_selector": "records"}}, {"name": "message_content", "endpoint": {"path": "account/~/extension/~/message-store/{messageId}/content/{attachmentId}"}} ], } yield from rest_api_resources(config) def get_data() -> None: pipeline = dlt.pipeline( pipeline_name="faxes_pipeline", destination="duckdb", dataset_name="faxes_data", ) load_info = pipeline.run(faxes_source()) print(load_info)

To add more endpoints, append entries from the resource table to the "resources" list using the same name, path, and data_selector pattern.


How do I query the loaded data?

Once the pipeline runs, dlt creates one table per resource. You can query with Python or SQL.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("faxes_pipeline").dataset() sessions_df = data.message_store.df() print(sessions_df.head())

SQL (DuckDB example):

SELECT * FROM faxes_data.message_store LIMIT 10;

In a marimo or Jupyter notebook:

import dlt data = dlt.pipeline("faxes_pipeline").dataset() data.message_store.df().head()

See how to explore your data in marimo Notebooks and how to query your data in Python with dataset.


What destinations can I load Faxes data to?

dlt supports loading into any of these destinations — only the destination parameter changes:

DestinationExample value
DuckDB (local, default)"duckdb"
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Change the destination in dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. See the full destinations list.


Troubleshooting

Authentication failures

If you receive 401 or 403, verify the Authorization header format 'Authorization: Bearer ' and that the token is not expired. Refresh or reissue the token per OAuth2 flow or SDK JWT login.

Rate limits (429)

RingCentral enforces rate limits; on 429 responses implement exponential backoff and respect Retry-After header when provided. Consider batching or reducing request frequency.

Pagination quirks

List responses include 'paging' and 'navigation' objects and the list of records under 'records'. Use 'page' and 'perPage' query params (examples default perPage=100) and follow 'navigation.nextPage.uri' to iterate.

Attachment retrieval

Fax content attachments are returned via a content/media endpoint (content URL in the attachment object). Requesting that URL returns the binary PDF; set appropriate Accept header.

Common HTTP errors

400 Bad Request — invalid params; 401/403 — auth/permission issues; 404 — resource not found; 429 — rate limit; 500 — server error.

Ensure that the API key is valid to avoid 401 Unauthorized errors. Also, verify endpoint paths and parameters to avoid 404 Not Found errors.


Next steps

Continue your data engineering journey with the other toolkits of the dltHub AI Workbench:

  • data-exploration — Build custom notebooks, charts, and dashboards for deeper analysis with marimo notebooks.
  • dlthub-runtime — Deploy, schedule, and monitor your pipeline in production.
dlt ai toolkit data-exploration install dlt ai toolkit dlthub-runtime install

Was this page helpful?

Community Hub

Need more dlt context for Faxes?

Request dlt skills, commands, AGENT.md files, and AI-native context.