OneDrive Integration¶
OneDrive integration allows you to translate files directly from your Microsoft 365 account and deliver translated files back automatically.
Plan Requirement
OneDrive integration requires a Professional plan or higher.
Connect Your Account¶
Generate Authorization URL¶
GET /v1/integrations/microsoft/connect
Generate a Microsoft OAuth authorization URL. Redirect the user to this URL to grant Falara access to their OneDrive.
Authentication: X-API-Key header
Response 200 OK
Browse Files¶
List Files in Folder¶
GET /v1/services/onedrive/files
List files in a OneDrive folder. Use this to build a file browser UI.
Authentication: X-API-Key header
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
folder_id |
string | no | Folder ID (omit for root) |
page_token |
string | no | Pagination token from previous response |
Response 200 OK
{
"items": [
{
"id": "01ABCDEF...",
"name": "Documents",
"type": "folder"
},
{
"id": "01GHIJKL...",
"name": "brochure.docx",
"type": "file",
"size": 245678,
"mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
],
"next_page_token": "eyJ0eXAi..."
}
Search Files¶
GET /v1/services/onedrive/files/search
Search for files across the entire OneDrive.
Authentication: X-API-Key header
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | yes | Search query (filename or content) |
limit |
integer | no | Max results (default: 25, max: 100) |
Response 200 OK
{
"items": [
{
"id": "01GHIJKL...",
"name": "brochure.docx",
"type": "file",
"path": "/Documents/Marketing/brochure.docx",
"size": 245678
}
]
}
Translate OneDrive Files¶
Create Translation Jobs¶
POST /v1/services/onedrive/jobs
Create translation jobs from OneDrive files.
Authentication: X-API-Key header
Status: 202 Accepted
resp = requests.post(
"https://app.falara.io/v1/services/onedrive/jobs",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"files": [{"file_id": "01GHIJKL...", "name": "brochure.docx"}],
"source_lang": "de",
"target_langs": ["en", "fr"],
"quality": "standard",
},
)
batch = resp.json()
const resp = await fetch(
"https://app.falara.io/v1/services/onedrive/jobs",
{
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
files: [{ file_id: "01GHIJKL...", name: "brochure.docx" }],
source_lang: "de",
target_langs: ["en", "fr"],
quality: "standard",
}),
}
);
const batch = await resp.json();
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
files |
list | yes | OneDrive files. Each object contains file_id and name. |
source_lang |
string | yes | BCP-47 source language code |
target_langs |
list[string] | yes | Target languages (1-10) |
quality |
string | no | "standard" (default) or "premium" |
glossary_id |
string | no | Glossary ID |
project_name |
string | no | Human-readable project label |
Response 202 Accepted
{
"batch_id": "b1c2d3e4-5678-9abc-def0-1234567890ab",
"jobs": [
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"target_language": "en",
"status": "queued"
},
{
"job_id": "661f9511-f30c-52e5-b827-557766551111",
"target_language": "fr",
"status": "queued"
}
]
}
Errors¶
| Status | Reason |
|---|---|
401 Unauthorized |
Missing or invalid API key |
403 Forbidden |
Plan does not include OneDrive, or account not connected |
404 Not Found |
File or folder not found |
422 Unprocessable Entity |
Validation error |