Home

Awesome

sunshine-conversations-ruby

SunshineConversationsClient - the Ruby gem for the Sunshine Conversations API

This SDK is automatically generated by the OpenAPI Generator Codegen project using the Sunshine Conversations API spec.

Sunshine Conversations API Version

The Sunshine Conversations API offers multiple versions. Each release of this project targets one and only one Sunshine Conversations API version. If you depend on an older version of the Sunshine Conversations API, you may need to use an older release of this library. Use the table below as your guide:

Sunshine Conversations API versionzendesk/sunshine-conversations-ruby version to use
v2 Implementation guide9.* or newer
v1.1 Upgrade guide4.0.0 or newer
v13.* or older

Installation

Build a gem

To build the Ruby code into a gem:

gem build sunshine-conversations-client.gemspec

Then either install the gem locally:

gem install ./sunshine-conversations-client-14.1.0.gem

(for development, run gem install --dev ./sunshine-conversations-client-14.1.0.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 'sunshine-conversations-client', '~> 14.1.0'

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 'sunshine-conversations-client', :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

Familiarity with Sunshine Conversations API authentication is recommended.

Basic Authentication (recommended)

With basic authentication, you can use your API key ID and secret to authenticate API requests. See below for a code sample.

Authentication with JSON Web Tokens (JWTs)

See the JSON Web Tokens (JWTs) guide for more information and guidelines on when to use this method. In general, you'll want to favor using basic authentication.

To generate a JWT, use your API key ID and secret.

Using the ruby-jwt gem:

require 'jwt'

payload = {:scope => 'app'}
jwtHeader = {:kid => API_KEY_ID}

token = JWT.encode payload, API_KEY_SECRET, 'HS256', jwtHeader

Running the code

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

# Load the gem
require 'sunshine-conversations-client'

# Setup authorization
SunshineConversationsClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = SunshineConversationsClient::ActivitiesApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
conversation_id = '029c31f25a21b47effd7be90' # String | Identifies the conversation.
activity_post = {"author":{"type":"user","userId":"5963c0d619a30a2e00de36b8"},"type":"conversation:read"} # ActivityPost | 

begin
  #Post Activity
  result = api_instance.post_activity(app_id, conversation_id, activity_post)
  p result
rescue SunshineConversationsClient::ApiError => e
  puts "Exception when calling ActivitiesApi->post_activity: #{e}"
end

Region

Sunshine Conversations is available in the following regions. The US region will be used by default. To target any other region, specify the region's API host in config.host. For example:

SunshineConversationsClient.configure do |config|
  config.host = 'api.eu-1.smooch.io'
end

Documentation for API Endpoints

All URIs are relative to https://api.smooch.io

ClassMethodHTTP requestDescription
SunshineConversationsClient::ActivitiesApipost_activityPOST /v2/apps/{appId}/conversations/{conversationId}/activityPost Activity
SunshineConversationsClient::AppKeysApicreate_app_keyPOST /v2/apps/{appId}/keysCreate App Key
SunshineConversationsClient::AppKeysApidelete_app_keyDELETE /v2/apps/{appId}/keys/{keyId}Delete App Key
SunshineConversationsClient::AppKeysApiget_app_keyGET /v2/apps/{appId}/keys/{keyId}Get App Key
SunshineConversationsClient::AppKeysApilist_app_keysGET /v2/apps/{appId}/keysList App Keys
SunshineConversationsClient::AppsApicreate_appPOST /v2/appsCreate App
SunshineConversationsClient::AppsApidelete_appDELETE /v2/apps/{appId}Delete App
SunshineConversationsClient::AppsApiget_appGET /v2/apps/{appId}Get App
SunshineConversationsClient::AppsApilist_appsGET /v2/appsList Apps
SunshineConversationsClient::AppsApiupdate_appPATCH /v2/apps/{appId}Update App
SunshineConversationsClient::AttachmentsApidelete_attachmentPOST /v2/apps/{appId}/attachments/removeDelete Attachment
SunshineConversationsClient::AttachmentsApiupload_attachmentPOST /v2/apps/{appId}/attachmentsUpload Attachment
SunshineConversationsClient::ClientsApicreate_clientPOST /v2/apps/{appId}/users/{userIdOrExternalId}/clientsCreate Client
SunshineConversationsClient::ClientsApilist_clientsGET /v2/apps/{appId}/users/{userIdOrExternalId}/clientsList Clients
SunshineConversationsClient::ClientsApiremove_clientDELETE /v2/apps/{appId}/users/{userIdOrExternalId}/clients/{clientId}Remove Client
SunshineConversationsClient::ConversationsApicreate_conversationPOST /v2/apps/{appId}/conversationsCreate Conversation
SunshineConversationsClient::ConversationsApidelete_conversationDELETE /v2/apps/{appId}/conversations/{conversationId}Delete Conversation
SunshineConversationsClient::ConversationsApidownload_message_refPOST /v2/apps/{appId}/conversations/{conversationId}/downloadDownload Message Ref
SunshineConversationsClient::ConversationsApiget_conversationGET /v2/apps/{appId}/conversations/{conversationId}Get Conversation
SunshineConversationsClient::ConversationsApilist_conversationsGET /v2/apps/{appId}/conversationsList Conversations
SunshineConversationsClient::ConversationsApiupdate_conversationPATCH /v2/apps/{appId}/conversations/{conversationId}Update Conversation
SunshineConversationsClient::CustomIntegrationApiKeysApicreate_custom_integration_keyPOST /v2/apps/{appId}/integrations/{integrationId}/keysCreate Integration Key
SunshineConversationsClient::CustomIntegrationApiKeysApidelete_custom_integration_keyDELETE /v2/apps/{appId}/integrations/{integrationId}/keys/{keyId}Delete Integration Key
SunshineConversationsClient::CustomIntegrationApiKeysApiget_custom_integration_keyGET /v2/apps/{appId}/integrations/{integrationId}/keys/{keyId}Get Integration Key
SunshineConversationsClient::CustomIntegrationApiKeysApilist_custom_integration_keysGET /v2/apps/{appId}/integrations/{integrationId}/keysList Integration Keys
SunshineConversationsClient::DevicesApiget_deviceGET /v2/apps/{appId}/users/{userIdOrExternalId}/devices/{deviceId}Get Device
SunshineConversationsClient::DevicesApilist_devicesGET /v2/apps/{appId}/users/{userIdOrExternalId}/devicesList Devices
SunshineConversationsClient::IntegrationsApicreate_integrationPOST /v2/apps/{appId}/integrationsCreate Integration
SunshineConversationsClient::IntegrationsApidelete_integrationDELETE /v2/apps/{appId}/integrations/{integrationId}Delete Integration
SunshineConversationsClient::IntegrationsApiget_integrationGET /v2/apps/{appId}/integrations/{integrationId}Get Integration
SunshineConversationsClient::IntegrationsApilist_integrationsGET /v2/apps/{appId}/integrationsList Integrations
SunshineConversationsClient::IntegrationsApiupdate_integrationPATCH /v2/apps/{appId}/integrations/{integrationId}Update Integration
SunshineConversationsClient::MessagesApidelete_all_messagesDELETE /v2/apps/{appId}/conversations/{conversationId}/messagesDelete All Messages
SunshineConversationsClient::MessagesApidelete_messageDELETE /v2/apps/{appId}/conversations/{conversationId}/messages/{messageId}Delete Message
SunshineConversationsClient::MessagesApilist_messagesGET /v2/apps/{appId}/conversations/{conversationId}/messagesList Messages
SunshineConversationsClient::MessagesApipost_messagePOST /v2/apps/{appId}/conversations/{conversationId}/messagesPost Message
SunshineConversationsClient::OAuthEndpointsApiauthorizeGET /oauth/authorizeAuthorize
SunshineConversationsClient::OAuthEndpointsApiget_tokenPOST /oauth/tokenGet Token
SunshineConversationsClient::OAuthEndpointsApirevoke_accessDELETE /oauth/authorizationRevoke Access
SunshineConversationsClient::ParticipantsApijoin_conversationPOST /v2/apps/{appId}/conversations/{conversationId}/joinJoin Conversation
SunshineConversationsClient::ParticipantsApileave_conversationPOST /v2/apps/{appId}/conversations/{conversationId}/leaveLeave Conversation
SunshineConversationsClient::ParticipantsApilist_participantsGET /v2/apps/{appId}/conversations/{conversationId}/participantsList Participants
SunshineConversationsClient::SwitchboardActionsApiaccept_controlPOST /v2/apps/{appId}/conversations/{conversationId}/acceptControlAccept Control
SunshineConversationsClient::SwitchboardActionsApioffer_controlPOST /v2/apps/{appId}/conversations/{conversationId}/offerControlOffer Control
SunshineConversationsClient::SwitchboardActionsApipass_controlPOST /v2/apps/{appId}/conversations/{conversationId}/passControlPass Control
SunshineConversationsClient::SwitchboardActionsApirelease_controlPOST /v2/apps/{appId}/conversations/{conversationId}/releaseControlRelease Control
SunshineConversationsClient::SwitchboardIntegrationsApicreate_switchboard_integrationPOST /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrationsCreate Switchboard Integration
SunshineConversationsClient::SwitchboardIntegrationsApidelete_switchboard_integrationDELETE /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations/{switchboardIntegrationId}Delete Switchboard Integration
SunshineConversationsClient::SwitchboardIntegrationsApilist_switchboard_integrationsGET /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrationsList Switchboard Integrations
SunshineConversationsClient::SwitchboardIntegrationsApiupdate_switchboard_integrationPATCH /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations/{switchboardIntegrationId}Update Switchboard Integration
SunshineConversationsClient::SwitchboardsApicreate_switchboardPOST /v2/apps/{appId}/switchboardsCreate Switchboard
SunshineConversationsClient::SwitchboardsApidelete_switchboardDELETE /v2/apps/{appId}/switchboards/{switchboardId}Delete Switchboard
SunshineConversationsClient::SwitchboardsApilist_switchboardsGET /v2/apps/{appId}/switchboardsList Switchboards
SunshineConversationsClient::SwitchboardsApiupdate_switchboardPATCH /v2/apps/{appId}/switchboards/{switchboardId}Update Switchboard
SunshineConversationsClient::UsersApicreate_userPOST /v2/apps/{appId}/usersCreate User
SunshineConversationsClient::UsersApidelete_userDELETE /v2/apps/{appId}/users/{userIdOrExternalId}Delete User
SunshineConversationsClient::UsersApidelete_user_personal_informationDELETE /v2/apps/{appId}/users/{userIdOrExternalId}/personalinformationDelete User Personal Information
SunshineConversationsClient::UsersApiget_userGET /v2/apps/{appId}/users/{userIdOrExternalId}Get User
SunshineConversationsClient::UsersApiupdate_userPATCH /v2/apps/{appId}/users/{userIdOrExternalId}Update User
SunshineConversationsClient::WebhooksApicreate_webhookPOST /v2/apps/{appId}/integrations/{integrationId}/webhooksCreate Webhook
SunshineConversationsClient::WebhooksApidelete_webhookDELETE /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}Delete Webhook
SunshineConversationsClient::WebhooksApiget_webhookGET /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}Get Webhook
SunshineConversationsClient::WebhooksApilist_webhooksGET /v2/apps/{appId}/integrations/{integrationId}/webhooksList Webhooks
SunshineConversationsClient::WebhooksApiupdate_webhookPATCH /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}Update Webhook

Documentation for Models

Documentation for Authorization

basicAuth

bearerAuth