directus_sdk

DirectusSDK - the Ruby gem for the directus.io

API for directus.io

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.1
  • Package version: 1.1.1
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build directus_sdk.gemspec

Then either install the gem locally:

gem install ./directus_sdk-1.1.1.gem

(for development, run gem install --dev ./directus_sdk-1.1.1.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'directus_sdk', '~> 1.1.1'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'directus_sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'directus_sdk'

# Setup authorization
DirectusSDK.configure do |config|
  # Configure API key authorization: api_key
  config.api_key['access_token'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['access_token'] = 'Bearer'
  # Configure your host
  config.host = "myinstance.directus.io"
  # Enable or disable debugging output
  config.debugging = false
end

api_instance = DirectusSDK::ActivityApi.new

begin
  #Returns activity
  result = api_instance.get_activity
  p result
rescue DirectusSDK::ApiError => e
  puts "Exception when calling ActivityApi->get_activity: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://myinstance.directus.io/api/1.1

Class Method HTTP request Description
DirectusSDK::ActivityApi get_activity GET /activity Returns activity
DirectusSDK::BookmarksApi add_bookmark POST /bookmarks Create a column in a given table
DirectusSDK::BookmarksApi delete_bookmark DELETE /bookmarks/bookmarkId Deletes specific bookmark
DirectusSDK::BookmarksApi get_bookmark GET /bookmarks/bookmarkId Returns specific bookmark
DirectusSDK::BookmarksApi get_bookmarks GET /bookmarks Returns bookmarks
DirectusSDK::BookmarksApi get_bookmarks_self GET /bookmarks/self Returns bookmarks of current user
DirectusSDK::FilesApi create_file POST /files Creates file
DirectusSDK::FilesApi get_file GET /files/fileId Returns specific file by id
DirectusSDK::FilesApi get_files GET /files Returns files
DirectusSDK::FilesApi update_file PUT /files/fileId Creates file
DirectusSDK::GroupsApi add_group POST /groups Add a new group
DirectusSDK::GroupsApi add_privilege POST /privileges/groupId Create new table privileges for the specified user group
DirectusSDK::GroupsApi get_group GET /groups/groupId Returns specific group
DirectusSDK::GroupsApi get_groups GET /groups Returns groups
DirectusSDK::GroupsApi get_privileges GET /privileges/groupId Returns group privileges
DirectusSDK::GroupsApi get_privileges_for_table GET /privileges/groupId/tableNameOrPrivilegeId Returns group privileges by tableName
DirectusSDK::GroupsApi update_privileges PUT /privileges/groupId/tableNameOrPrivilegeId Update privileges by privilegeId
DirectusSDK::MessagesApi get_message GET /messages/messageId Returns specific message
DirectusSDK::MessagesApi get_messages GET /messages/self Returns messages
DirectusSDK::PreferencesApi get_preferences GET /tables/tableId/preferences Returns table preferences
DirectusSDK::PreferencesApi update_preferences PUT /tables/tableId/preferences Update table preferences
DirectusSDK::SettingsApi get_settings GET /settings Returns settings
DirectusSDK::SettingsApi get_settings_for GET /settings/collectionName Returns settings for collection
DirectusSDK::SettingsApi update_settings PUT /settings/collectionName Update settings
DirectusSDK::TablesApi add_column POST /tables/tableId/columns Create a column in a given table
DirectusSDK::TablesApi add_row POST /tables/tableId/rows Add a new row
DirectusSDK::TablesApi add_table POST /tables Add a new table
DirectusSDK::TablesApi delete_column DELETE /tables/tableId/columns/columnName Delete row
DirectusSDK::TablesApi delete_row DELETE /tables/tableId/rows/rowId Delete row
DirectusSDK::TablesApi delete_table DELETE /tables/tableId Delete Table
DirectusSDK::TablesApi get_table GET /tables/tableId Returns specific table
DirectusSDK::TablesApi get_table_column GET /tables/tableId/columns/columnName Returns specific table column
DirectusSDK::TablesApi get_table_columns GET /tables/tableId/columns Returns table columns
DirectusSDK::TablesApi get_table_row GET /tables/tableId/rows/rowId Returns specific table row
DirectusSDK::TablesApi get_table_rows GET /tables/tableId/rows Returns table rows
DirectusSDK::TablesApi get_tables GET /tables Returns tables
DirectusSDK::TablesApi update_column PUT /tables/tableId/columns/columnName Update column
DirectusSDK::TablesApi update_row PUT /tables/tableId/rows/rowId Update row
DirectusSDK::UtilsApi get_hash POST /hash Get a hashed value
DirectusSDK::UtilsApi get_random POST /random Returns random alphanumeric string

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: access_token
  • Location: URL query string