SyncteraRubySdk::DocumentsApi

All URIs are relative to https://api.synctera.com/v0

Method HTTP request Description
create_document POST /documents Create a document
create_document_version POST /documents/document_id/versions Create a new document version
get_document GET /documents/document_id Get a document
get_document_contents GET /documents/document_id/contents Get contents of latest document version
get_document_version GET /documents/document_id/versions/document_version Get a document by version
get_document_version_contents GET /documents/document_id/versions/document_version/contents Get document contents by version
list_documents GET /documents List documents
update_document PATCH /documents/document_id Update a document

create_document

create_document(file, opts)

Create a document

Docs

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
file = File.new('/path/to/some/file') # File | The file contents
opts = {
  description: 'description_example', # String | A description of the attached document
  encryption: SyncteraRubySdk::Encryption::REQUIRED, # Encryption | 
  metadata: { ... }, # Object | Optional field to store additional information about the resource. Intended to be used by the integrator to store non-sensitive data. 
  name: 'name_example', # String | A user-friendly name for the document
  related_resource_id: '38400000-8cf0-11bd-b23e-10b96e4ef00d', # String | The ID of the resource related to the document
  related_resource_type: SyncteraRubySdk::RelatedResourceType::CUSTOMER, # RelatedResourceType | 
  type: SyncteraRubySdk::DocumentType::APPLICATION_DOCUMENTATION # DocumentType | 
}

begin
  # Create a document
  result = api_instance.create_document(file, opts)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->create_document: #{e}"
end

Using the create_document_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> create_document_with_http_info(file, opts)

begin
  # Create a document
  data, status_code, headers = api_instance.create_document_with_http_info(file, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Document>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->create_document_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
file File The file contents
description String A description of the attached document [optional]
encryption Encryption [optional][default to 'NOT_REQUIRED']
metadata Object Optional field to store additional information about the resource. Intended to be used by the integrator to store non-sensitive data. [optional]
name String A user-friendly name for the document [optional]
related_resource_id String The ID of the resource related to the document [optional]
related_resource_type RelatedResourceType [optional]
type DocumentType [optional]

Return type

Document

Authorization

bearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json, application/problem+json

create_document_version

create_document_version(document_id, file, opts)

Create a new document version

Docs

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.
file = File.new('/path/to/some/file') # File | The file contents
opts = {
  description: 'description_example', # String | A description of the attached document
  encryption: SyncteraRubySdk::Encryption::REQUIRED, # Encryption | 
  name: 'name_example', # String | A user-friendly name for the document
  type: SyncteraRubySdk::DocumentType::APPLICATION_DOCUMENTATION # DocumentType | 
}

begin
  # Create a new document version
  result = api_instance.create_document_version(document_id, file, opts)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->create_document_version: #{e}"
end

Using the create_document_version_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> create_document_version_with_http_info(document_id, file, opts)

begin
  # Create a new document version
  data, status_code, headers = api_instance.create_document_version_with_http_info(document_id, file, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Document>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->create_document_version_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.
file File The file contents
description String A description of the attached document [optional]
encryption Encryption [optional][default to 'NOT_REQUIRED']
name String A user-friendly name for the document [optional]
type DocumentType [optional]

Return type

Document

Authorization

bearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json, application/problem+json

get_document

get_document(document_id)

Get a document

Returns the document attributes. Use /documents/document_id/contents to get the contents.

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.

begin
  # Get a document
  result = api_instance.get_document(document_id)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document: #{e}"
end

Using the get_document_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> get_document_with_http_info(document_id)

begin
  # Get a document
  data, status_code, headers = api_instance.get_document_with_http_info(document_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Document>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.

Return type

Document

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

get_document_contents

File get_document_contents(document_id)

Get contents of latest document version

Returns the bytes of the requested document.

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.

begin
  # Get contents of latest document version
  result = api_instance.get_document_contents(document_id)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_contents: #{e}"
end

Using the get_document_contents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

get_document_contents_with_http_info(document_id)

begin
  # Get contents of latest document version
  data, status_code, headers = api_instance.get_document_contents_with_http_info(document_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => File
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_contents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.

Return type

File

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /, application/problem+json

get_document_version

get_document_version(document_id, document_version)

Get a document by version

Returns the document (attributes). Use /documents/document_id/versions/version/contents to get the contents.

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.
document_version = 1 # Integer | The document version.

begin
  # Get a document by version
  result = api_instance.get_document_version(document_id, document_version)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_version: #{e}"
end

Using the get_document_version_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> get_document_version_with_http_info(document_id, document_version)

begin
  # Get a document by version
  data, status_code, headers = api_instance.get_document_version_with_http_info(document_id, document_version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Document>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_version_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.
document_version Integer The document version.

Return type

Document

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

get_document_version_contents

File get_document_version_contents(document_id, document_version)

Get document contents by version

Returns the bytes of the requested document.

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.
document_version = 1 # Integer | The document version.

begin
  # Get document contents by version
  result = api_instance.get_document_version_contents(document_id, document_version)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_version_contents: #{e}"
end

Using the get_document_version_contents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

get_document_version_contents_with_http_info(document_id, document_version)

begin
  # Get document contents by version
  data, status_code, headers = api_instance.get_document_version_contents_with_http_info(document_id, document_version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => File
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->get_document_version_contents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.
document_version Integer The document version.

Return type

File

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /, application/problem+json

list_documents

list_documents(opts)

List documents

Returns a paginated list of documents (metadata only, not contents).

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
opts = {
  id: ['7d943c51-e4ff-4e57-9558-08cab6b963c7'], # Array<String> | Unique resource identifier
  limit: 100, # Integer | 
  page_token: 'a8937a0d', # String | 
  related_resource_type: SyncteraRubySdk::RelatedResourceType::CUSTOMER, # RelatedResourceType | Return documents that are related to resources of the specified type
  related_resource_id: 'b01db9c7-78f2-4a99-8aca-1231d32f9b96', # String | Return documents that are related to resources with the specified ID
  encryption: 'REQUIRED', # String | Whether the file should be encrypted and access restricted, e.g. if the file contains PII
  type: SyncteraRubySdk::DocumentType::APPLICATION_DOCUMENTATION # DocumentType | The type of documents
}

begin
  # List documents
  result = api_instance.list_documents(opts)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->list_documents: #{e}"
end

Using the list_documents_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> list_documents_with_http_info(opts)

begin
  # List documents
  data, status_code, headers = api_instance.list_documents_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DocumentList>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->list_documents_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id Array<String> Unique resource identifier [optional]
limit Integer [optional][default to 100]
page_token String [optional]
related_resource_type RelatedResourceType Return documents that are related to resources of the specified type [optional]
related_resource_id String Return documents that are related to resources with the specified ID [optional]
encryption String Whether the file should be encrypted and access restricted, e.g. if the file contains PII [optional]
type DocumentType The type of documents [optional]

Return type

DocumentList

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

update_document

update_document(document_id, patch_document)

Update a document

Update attributes of the latest document version.

Examples

require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
  # Configure Bearer authorization (api_key): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SyncteraRubySdk::DocumentsApi.new
document_id = 'b01db9c7-78f2-4a99-8aca-1231d32f9b96' # String | The unique identifier of the document.
patch_document = SyncteraRubySdk::PatchDocument.new # PatchDocument | 

begin
  # Update a document
  result = api_instance.update_document(document_id, patch_document)
  p result
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->update_document: #{e}"
end

Using the update_document_with_http_info variant

This returns an Array which contains the response data, status code and headers.

, Integer, Hash)> update_document_with_http_info(document_id, patch_document)

begin
  # Update a document
  data, status_code, headers = api_instance.update_document_with_http_info(document_id, patch_document)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Document>
rescue SyncteraRubySdk::ApiError => e
  puts "Error when calling DocumentsApi->update_document_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
document_id String The unique identifier of the document.
patch_document PatchDocument

Return type

Document

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json