Quick Start
Get up and running with the Intapp REST Client in minutes.
Basic Usage
Create a Client
from intapp_rest_client import RestClient
client = RestClient(
base_url="https://api.example.com",
api_key="your-api-key"
)Make Requests
# GET request
data = client.get("/api/v4/resources")
print(data)
# POST request with JSON body
result = client.post("/api/v4/resources", json={
"name": "New Resource",
"type": "example"
})
# PUT request
updated = client.put("/api/v4/resources/123", json={
"name": "Updated Resource"
})
# DELETE request
client.delete("/api/v4/resources/123")Close the Client
client.close()Context Manager (Recommended)
Using a context manager ensures proper cleanup:
from intapp_rest_client import RestClient
with RestClient(base_url="https://api.example.com", api_key="key") as client:
data = client.get("/api/v4/resources")
# Client is automatically closed when exiting the blockAsync Usage
For async applications:
import asyncio
from intapp_rest_client import RestClient
async def main():
async with RestClient(
base_url="https://api.example.com",
api_key="your-key"
) as client:
# Async GET
data = await client.aget("/api/v4/resources")
# Async POST
result = await client.apost("/api/v4/resources", json={"name": "New"})
# Async DELETE
await client.adelete("/api/v4/resources/123")
asyncio.run(main())Error Handling
from intapp_rest_client import RestClient, HttpError, RequestError
client = RestClient(base_url="https://api.example.com", api_key="key")
try:
data = client.get("/api/v4/resources")
except HttpError as e:
print(f"HTTP {e.status_code}: {e.message}")
print(f"Response body: {e.response_body}")
if e.is_rate_limited:
print(f"Retry after: {e.retry_after} seconds")
except RequestError as e:
print(f"Network error: {e}")
finally:
client.close()Common Patterns
Query Parameters
# GET with query parameters
data = client.get("/api/v4/resources", params={
"page": 1,
"limit": 100,
"status": "active"
})
# Results in: GET /api/v4/resources?page=1&limit=100&status=activeCustom Headers
# Request with custom headers
data = client.get("/api/v4/resources", headers={
"X-Custom-Header": "value",
"Accept-Language": "en-US"
})File Upload
# POST with file upload
with open("document.pdf", "rb") as f:
response = client.post_raw(
"/api/v4/files/upload",
files={"file": ("document.pdf", f, "application/pdf")}
)Binary Download
# GET binary content
response = client.get_raw("/api/v4/files/123/download")
with open("downloaded.pdf", "wb") as f:
f.write(response.content)Configure Retry Behavior
from intapp_rest_client import RestClient, RetryConfig
client = RestClient(
base_url="https://api.example.com",
api_key="your-key",
retry_config=RetryConfig(
max_retries=5,
backoff_factor=2.0,
retryable_statuses=(429, 500, 502, 503, 504),
respect_retry_after=True
)
)đź’ˇ
The client automatically handles 429 (rate limit) and 5xx errors with exponential backoff. You don't need to write retry logic yourself!
Streaming Pagination
For large datasets, use streaming pagination to avoid loading everything into memory:
# Process data in batches
for batch in client.get_paginated(
"/api/v4/data/rows/Company",
page_size=1000,
data_key="rows"
):
for row in batch:
process_row(row)Next Steps
- Authentication - All authentication methods
- Retry Configuration - Fine-tune retry behavior
- Async Operations - Async patterns and best practices
- Pagination - Streaming large datasets
- Streaming File Download - Memory-efficient file downloads
- Parallel Requests - Bulk GET/POST/PUT in parallel