Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
535 changes: 0 additions & 535 deletions docs/SDKs/deliverable-ruby.md

This file was deleted.

483 changes: 482 additions & 1 deletion docs/SDKs/deliverable.md

Large diffs are not rendered by default.

62 changes: 61 additions & 1 deletion docs/SDKs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: SDKs Overview
sidebar_position: 1
sidebar_label: Overview
description: Official TurboDocx SDKs for JavaScript, Python, PHP, Go, and Java. Get started with document generation, deliverables, digital signatures, and quoting.
description: Official TurboDocx SDKs for JavaScript, Python, PHP, Go, Java, and Ruby. Get started with document generation, deliverables, digital signatures, and quoting.
keywords:
- turbodocx sdk
- turbosign sdk
Expand All @@ -11,6 +11,7 @@ keywords:
- php sdk
- go sdk
- java sdk
- ruby sdk
- document api
- esignature sdk
- api client library
Expand Down Expand Up @@ -55,6 +56,7 @@ Send documents for legally-binding eSignatures with full audit trails.
| **PHP** | `turbodocx/sdk` | `composer require turbodocx/sdk` | [Docs](/docs/SDKs/turbosign?language=php) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/php-sdk) |
| **Go** | `github.com/TurboDocx/SDK/packages/go-sdk` | `go get github.com/TurboDocx/SDK/packages/go-sdk` | [Docs](/docs/SDKs/turbosign?language=go) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/go-sdk) |
| **Java** | `com.turbodocx:turbodocx-sdk` | [Maven Central](https://search.maven.org/artifact/com.turbodocx/turbodocx-sdk) | [Docs](/docs/SDKs/turbosign?language=java) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/java-sdk) |
| **Ruby** | `turbodocx-sdk` | `gem install turbodocx-sdk` | [Docs](/docs/SDKs/turbosign?language=ruby) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/ruby-sdk) |

## TurboWebhooks SDKs

Expand All @@ -67,6 +69,7 @@ Subscribe to all 7 TurboSign signature events (`sent`, `viewed`, `recipient_sign
| **Python** | `turbodocx-sdk` | `pip install turbodocx-sdk` | [Docs](/docs/SDKs/webhooks?language=python) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/py-sdk) |
| **Go** | `github.com/TurboDocx/SDK/packages/go-sdk` | `go get github.com/TurboDocx/SDK/packages/go-sdk` | [Docs](/docs/SDKs/webhooks?language=go) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/go-sdk) |
| **Java** | `com.turbodocx:turbodocx-sdk` | `mvn` / `gradle` (see [docs](/docs/SDKs/webhooks?language=java)) | [Docs](/docs/SDKs/webhooks?language=java) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/java-sdk) |
| **Ruby** | `turbodocx-sdk` | `gem install turbodocx-sdk` | [Docs](/docs/SDKs/webhooks?language=ruby) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/ruby-sdk) |

For the conceptual overview (delivery retries, payload schema, dashboard configuration), see [TurboSign → Webhooks](/docs/TurboSign/Webhooks).

Expand All @@ -81,6 +84,7 @@ Generate documents from templates with dynamic variable injection, download sour
| **PHP** | `turbodocx/sdk` | `composer require turbodocx/sdk` | [Docs](/docs/SDKs/deliverable?language=php) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/php-sdk) |
| **Go** | `github.com/TurboDocx/SDK/packages/go-sdk` | `go get github.com/TurboDocx/SDK/packages/go-sdk` | [Docs](/docs/SDKs/deliverable?language=go) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/go-sdk) |
| **Java** | `com.turbodocx:turbodocx-sdk` | [Maven Central](https://search.maven.org/artifact/com.turbodocx/turbodocx-sdk) | [Docs](/docs/SDKs/deliverable?language=java) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/java-sdk) |
| **Ruby** | `turbodocx-sdk` | `gem install turbodocx-sdk` | [Docs](/docs/SDKs/deliverable?language=ruby) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/ruby-sdk) |

## TurboQuote SDKs

Expand All @@ -93,6 +97,7 @@ Build sales quotes and proposals programmatically: quotes and line items, a prod
| **PHP** | `turbodocx/sdk` | `composer require turbodocx/sdk` | [Docs](/docs/SDKs/quote?language=php) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/php-sdk) |
| **Go** | `github.com/TurboDocx/SDK/packages/go-sdk` | `go get github.com/TurboDocx/SDK/packages/go-sdk` | [Docs](/docs/SDKs/quote?language=go) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/go-sdk) |
| **Java** | `com.turbodocx:turbodocx-sdk` | [Maven Central](https://search.maven.org/artifact/com.turbodocx/turbodocx-sdk) | [Docs](/docs/SDKs/quote?language=java) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/java-sdk) |
| **Ruby** | `turbodocx-sdk` | `gem install turbodocx-sdk` | [Docs](/docs/SDKs/quote?language=ruby) [GitHub](https://github.com/TurboDocx/SDK/tree/main/packages/ruby-sdk) |

:::tip Low-code or No-code?
Check out our [n8n community node](https://www.npmjs.com/package/@turbodocx/n8n-nodes-turbodocx) for workflow automation, or get [TurboDocx Writer](https://appsource.microsoft.com/en-us/product/office/WA200007397) for Microsoft Word.
Expand Down Expand Up @@ -203,6 +208,15 @@ go get github.com/TurboDocx/SDK/packages/go-sdk
</dependency>
```

</TabItem>
<TabItem value="ruby" label="Ruby">

```bash
gem install turbodocx-sdk
# or add to your Gemfile:
# gem "turbodocx-sdk"
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -438,6 +452,33 @@ public class Main {
}
```

</TabItem>
<TabItem value="ruby" label="Ruby">

```ruby
require "turbodocx_sdk"

# Configure with your API key
TurboDocxSdk::TurboSign.configure(
api_key: ENV["TURBODOCX_API_KEY"],
org_id: ENV["TURBODOCX_ORG_ID"],
sender_email: ENV["TURBODOCX_SENDER_EMAIL"] # required for TurboSign
)

# Send a document for signature
result = TurboDocxSdk::TurboSign.send_signature(
fileLink: "https://www.turbodocx.com/examples/turbodocx.pdf",
recipients: [
{ name: "John Doe", email: "john@example.com", signingOrder: 1 }
],
fields: [
{ type: "signature", page: 1, x: 100, y: 500, width: 200, height: 50, recipientEmail: "john@example.com" }
]
)

puts "Document sent! ID: #{result['documentId']}"
```

</TabItem>
</Tabs>

Expand Down Expand Up @@ -662,6 +703,25 @@ try {
}
```

</TabItem>
<TabItem value="ruby" label="Ruby">

```ruby
require "turbodocx_sdk"

begin
result = TurboDocxSdk::TurboSign.send_signature(
# ...
)
rescue TurboDocxSdk::ValidationError => e
puts "Validation error: #{e.message}"
# Handle validation error
rescue TurboDocxSdk::TurboDocxError => e
puts "Error #{e.code}: #{e.message}"
puts "Status code: #{e.status_code}"
end
```

</TabItem>
</Tabs>

Expand Down
39 changes: 13 additions & 26 deletions docs/SDKs/partner-ruby.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
# Hidden from the published site: the turbodocx-sdk gem is not on RubyGems yet.
# Remove `draft: true` when the gem is published (TurboDocx/SDK issue).
draft: true
title: TurboPartner Ruby SDK
unlisted: true
sidebar_position: 13
sidebar_label: "TurboPartner: Ruby"
description: Official TurboDocx Partner SDK for Ruby. Manage organizations, users, API keys, and entitlements programmatically from plain Ruby, Rails, or Sinatra.
Expand Down Expand Up @@ -34,7 +32,7 @@ The official TurboDocx Partner SDK for Ruby applications. Build multi-tenant Saa
<br />

:::info What is TurboPartner?
TurboPartner is the partner management API for TurboDocx. It allows you to programmatically create and manage organizations, users, API keys, and feature entitlements — perfect for building white-label or multi-tenant applications on top of TurboDocx.
TurboPartner is the partner management API for TurboDocx. It allows you to programmatically create and manage organizations, users, API keys, and feature entitlements, perfect for building white-label or multi-tenant applications on top of TurboDocx.
:::

## TLDR
Expand Down Expand Up @@ -71,7 +69,7 @@ key = TurboDocxSdk::TurboPartner.create_organization_api_key(org_id,
"name" => "Production Key",
"role" => "admin"
)
puts "API Key: #{key['data']['key']}" # Save this — only shown once!
puts "API Key: #{key['data']['key']}" # Save this, only shown once!
```

---
Expand Down Expand Up @@ -413,7 +411,7 @@ puts "Full Key: #{result['data']['key']}" # Only shown once!
```

:::caution Save Your API Key
The full API key is only returned once during creation. Store it securely — you won't be able to retrieve it again.
The full API key is only returned once during creation. Store it securely: you won't be able to retrieve it again.
:::

### `list_organization_api_keys(organization_id, request = nil)`
Expand Down Expand Up @@ -525,11 +523,11 @@ result = TurboDocxSdk::TurboPartner.revoke_partner_api_key("partner-key-uuid-her
## Partner User Management

:::danger Partner users use a different role enum
Partner portal users take `"admin"`, `"member"`, or `"viewer"`. **Organization** users and organization API keys take `"admin"`, `"contributor"`, `"user"`, or `"viewer"`. The two enums do not overlap beyond `admin`/`viewer` — `"member"` is rejected on an org call, and `"contributor"`/`"user"` are rejected on a partner call. See [Role Enums](#organization-user-roles).
Partner portal users take `"admin"`, `"member"`, or `"viewer"`. **Organization** users and organization API keys take `"admin"`, `"contributor"`, `"user"`, or `"viewer"`. The two enums do not overlap beyond `admin`/`viewer`: `"member"` is rejected on an org call, and `"contributor"`/`"user"` are rejected on a partner call. See [Role Enums](#organization-user-roles).
:::

:::caution `permissions` is all-or-nothing
The `"permissions"` hash itself is optional on both `add_user_to_partner_portal` and `update_partner_user_permissions`, and the Ruby SDK forwards your hash verbatim without client-side validation. But if you send `"permissions"`, **all seven keys are required** — there is no partial permissions update. Omitting even one key raises `TurboDocxSdk::ValidationError` (400). Always send the complete hash: read the current values first and re-send them with your change applied.
The `"permissions"` hash itself is optional on both `add_user_to_partner_portal` and `update_partner_user_permissions`, and the Ruby SDK forwards your hash verbatim without client-side validation. But if you send `"permissions"`, **all seven keys are required**: there is no partial permissions update. Omitting even one key raises `TurboDocxSdk::ValidationError` (400). Always send the complete hash: read the current values first and re-send them with your change applied.
:::

### `add_user_to_partner_portal(request)`
Expand Down Expand Up @@ -573,7 +571,7 @@ end

### `update_partner_user_permissions(user_id, request)`

Update a partner user's role and permissions. If you pass `"permissions"`, send **all seven keys** — a partial hash is a 400.
Update a partner user's role and permissions. If you pass `"permissions"`, send **all seven keys**: a partial hash is a 400.

```ruby
result = TurboDocxSdk::TurboPartner.update_partner_user_permissions("partner-user-uuid-here",
Expand Down Expand Up @@ -686,7 +684,7 @@ Pass features as a plain Hash with camelCase string keys. The SDK sends them str

### Tracking (Usage Counters)

Current consumption against the limits above. TurboDocx maintains these automatically, but `update_organization_entitlements` **accepts a `tracking` hash** — useful for seeding counters when migrating an existing customer:
Current consumption against the limits above. TurboDocx maintains these automatically, but `update_organization_entitlements` **accepts a `tracking` hash**, useful for seeding counters when migrating an existing customer:

| Field | Type | Description |
|-------|------|-------------|
Expand All @@ -705,7 +703,7 @@ Every counter except `currentAICredits` floors at `0`. Only `currentAICredits` a

## Preferences Reference

TurboSign display preferences you can read and set per organization. Every key is a boolean and is validated strictly — the strings `"true"` / `"false"` are rejected with a 400, so pass real booleans. The API returns only these keys and never any of the organization's other settings.
TurboSign display preferences you can read and set per organization. Every key is a boolean and is validated strictly: the strings `"true"` / `"false"` are rejected with a 400, so pass real booleans. The API returns only these keys and never any of the organization's other settings.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
Expand Down Expand Up @@ -812,6 +810,8 @@ permissions = {

## Error Handling

`TurboDocxSdk::TurboPartner.create_organization` and the other partner calls raise `AuthorizationError` when the partner API key lacks the scope for the route, since partner keys are scoped separately from organization keys:

```ruby
begin
result = TurboDocxSdk::TurboPartner.create_organization("name" => "Acme Corp")
Expand Down Expand Up @@ -842,20 +842,7 @@ rescue TurboDocxSdk::TurboDocxError => e
end
```

All errors inherit from `TurboDocxSdk::TurboDocxError` and carry `status_code` and `code` readers.

### Error Classes

| Error Class | Status | When |
|---|---|---|
| `TurboDocxSdk::TurboDocxError` | varies | Base class for all SDK errors |
| `TurboDocxSdk::AuthenticationError` | 401 | Invalid or missing partner credentials |
| `TurboDocxSdk::AuthorizationError` | 403 | Valid credentials without permission for this operation |
| `TurboDocxSdk::ValidationError` | 400 | Invalid request parameters, or TurboPartner not configured |
| `TurboDocxSdk::NotFoundError` | 404 | Resource not found |
| `TurboDocxSdk::ConflictError` | 409 | Request conflicts with current resource state |
| `TurboDocxSdk::RateLimitError` | 429 | Too many requests — back off |
| `TurboDocxSdk::NetworkError` | — | Network connectivity issues |
The full typed-error table and HTTP status mapping is documented once in the [Ruby SDK's Error Handling reference](/docs/SDKs/turbosign?language=ruby#error-handling); partner calls use the same `AuthenticationError`/`AuthorizationError`/`ValidationError`/`NotFoundError`/`ConflictError`/`RateLimitError`/`NetworkError` types.

---

Expand Down Expand Up @@ -925,5 +912,5 @@ It creates an organization with entitlements, adds a user, mints an org API key,
- [GitHub Repository](https://github.com/TurboDocx/SDK/tree/main/packages/ruby-sdk)
- [RubyGems Package](https://rubygems.org/gems/turbodocx-sdk)
- [TurboSign Ruby SDK](/docs/SDKs/ruby) — For digital signature operations
- [TurboQuote Ruby SDK](/docs/SDKs/quote-ruby) — For quotes and proposals
- [TurboQuote Ruby SDK](/docs/SDKs/quote?language=ruby) — For quotes and proposals
- [SDKs Overview](/docs/SDKs/) — All TurboDocx SDKs
Loading
Loading