ARTIK Cloud Ruby SDK

This SDK helps you connect your Ruby scripts to ARTIK Cloud. The SDK exposes a number of methods to easily execute REST API calls to ARTIK Cloud.

Installation

Build a gem

To build the Ruby code into a gem:

gem build artikcloud.gemspec

Then either install the gem locally:

gem install ./artikcloud-2.0.0.gem

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

Finally add this to the Gemfile:

gem 'artikcloud', '~> 2.0.0'

Install from Git

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

gem 'artikcloud', :git => 'https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO.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 'artikcloud'

# Setup authorization
ArtikCloud.configure do |config|
  # Configure OAuth2 access token for authorization: artikcloud_oauth
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ArtikCloud::DeviceTypesApi.new

device_type_id = "device_type_id_example" # String | deviceTypeId


begin
  #Get Available Manifest Versions
  result = api_instance.get_available_manifest_versions(device_type_id)
  p result
rescue ArtikCloud::ApiError => e
  puts "Exception when calling DeviceTypesApi->get_available_manifest_versions: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.artik.cloud/v1.1

Class Method HTTP request Description
ArtikCloud::DeviceTypesApi get_available_manifest_versions GET /devicetypes/deviceTypeId/availablemanifestversions Get Available Manifest Versions
ArtikCloud::DeviceTypesApi get_device_type GET /devicetypes/deviceTypeId Get Device Type
ArtikCloud::DeviceTypesApi get_device_types GET /devicetypes Get Device Types
ArtikCloud::DeviceTypesApi get_latest_manifest_properties GET /devicetypes/deviceTypeId/manifests/latest/properties Get Latest Manifest Properties
ArtikCloud::DeviceTypesApi get_manifest_properties GET /devicetypes/deviceTypeId/manifests/version/properties Get manifest properties
ArtikCloud::DevicesApi add_device POST /devices Add Device
ArtikCloud::DevicesApi delete_device DELETE /devices/deviceId Delete Device
ArtikCloud::DevicesApi delete_device_token DELETE /devices/deviceId/tokens Delete Device Token
ArtikCloud::DevicesApi get_device GET /devices/deviceId Get Device
ArtikCloud::DevicesApi get_device_token GET /devices/deviceId/tokens Get Device Token
ArtikCloud::DevicesApi update_device PUT /devices/deviceId Update Device
ArtikCloud::DevicesApi update_device_token PUT /devices/deviceId/tokens Update Device Token
ArtikCloud::ExportApi export_request POST /messages/export Create Export Request
ArtikCloud::ExportApi get_export_history GET /messages/export/history Get Export History
ArtikCloud::ExportApi get_export_result GET /messages/export/exportId/result Get Export Result
ArtikCloud::ExportApi get_export_status GET /messages/export/exportId/status Check Export Status
ArtikCloud::MessagesApi get_aggregates_histogram GET /messages/analytics/histogram Get Histogram aggregates
ArtikCloud::MessagesApi get_field_presence GET /messages/presence Get normalized message presence
ArtikCloud::MessagesApi get_last_normalized_messages GET /messages/last Get Last Normalized Message
ArtikCloud::MessagesApi get_message_aggregates GET /messages/analytics/aggregates Get Normalized Message Aggregates
ArtikCloud::MessagesApi get_normalized_messages GET /messages Get Normalized Messages
ArtikCloud::MessagesApi send_message_action POST /messages Send Message Action
ArtikCloud::RegistrationsApi confirm_user PUT /devices/registrations/pin Confirm User
ArtikCloud::RegistrationsApi get_request_status_for_user GET /devices/registrations/requestId/status Get Request Status For User
ArtikCloud::RegistrationsApi unregister_device DELETE /devices/deviceId/registrations Unregister Device
ArtikCloud::RulesApi create_rule POST /rules Create Rule
ArtikCloud::RulesApi delete_rule DELETE /rules/ruleId Delete Rule
ArtikCloud::RulesApi get_rule GET /rules/ruleId Get Rule
ArtikCloud::RulesApi update_rule PUT /rules/ruleId Update Rule
ArtikCloud::TagsApi get_tag_categories GET /tags/categories Get all categories
ArtikCloud::TagsApi get_tag_suggestions GET /tags/suggestions Get tag suggestions
ArtikCloud::TagsApi get_tags_by_categories GET /tags Get all tags of categories
ArtikCloud::TokensApi check_token POST /checkToken Check Token
ArtikCloud::TokensApi refresh_token POST /token Refresh Token
ArtikCloud::UsersApi create_user_properties POST /users/userId/properties Create User Application Properties
ArtikCloud::UsersApi delete_user_properties DELETE /users/userId/properties Delete User Application Properties
ArtikCloud::UsersApi get_self GET /users/self Get Current User Profile
ArtikCloud::UsersApi get_user_device_types GET /users/userId/devicetypes Get User Device Types
ArtikCloud::UsersApi get_user_devices GET /users/userId/devices Get User Devices
ArtikCloud::UsersApi get_user_properties GET /users/userId/properties Get User application properties
ArtikCloud::UsersApi get_user_rules GET /users/userId/rules Get User Rules
ArtikCloud::UsersApi update_user_properties PUT /users/userId/properties Update User Application Properties

Documentation for Models

Documentation for Authorization

artikcloud_oauth

More about ARTIK Cloud

If you are not familiar with ARTIK Cloud, we have extensive documentation at https://developer.artik.cloud/documentation

The full ARTIK Cloud API specification can be found at https://developer.artik.cloud/documentation/api-reference/

Check out advanced sample applications at https://developer.artik.cloud/documentation/samples/

To create and manage your services and devices on ARTIK Cloud, create an account at https://developer.artik.cloud

Also see the ARTIK Cloud blog for tutorials, updates, and more: http://artik.io/blog

Licensed under the Apache License. See LICENSE.

Copyright (c) 2016 Samsung Electronics Co., Ltd.