SunshineConversationsClient::AppKeysApi

August 27, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
create_app_keyPOST /v2/apps/{appId}/keysCreate App Key
delete_app_keyDELETE /v2/apps/{appId}/keys/{keyId}Delete App Key
get_app_keyGET /v2/apps/{appId}/keys/{keyId}Get App Key
list_app_keysGET /v2/apps/{appId}/keysList App Keys

create_app_key

AppKeyResponse create_app_key(app_id, app_key_create_body)

Create App Key

Creates an API key for the specified app. The response body will include a secret as well as its corresponding id, which you can use to generate JSON Web Tokens to securely make API calls on behalf of the app.

Example

# 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
  # Uncomment this line to use JWTs
  # config.access_token = 'YOUR_JWT'
end

api_instance = SunshineConversationsClient::AppKeysApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
app_key_create_body =  # AppKeyCreateBody | 
# Be sure to add the required body parameters

begin
  #Create App Key
  result = api_instance.create_app_key(app_id, app_key_create_body)
  p result
rescue SunshineConversationsClient::ApiError => e
  puts "Exception when calling AppKeysApi->create_app_key: #{e}"
end

Parameters

NameTypeDescriptionNotes
app_idStringIdentifies the app.
app_key_create_bodyAppKeyCreateBody

Return type

AppKeyResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_app_key

Object delete_app_key(app_id, key_id)

Delete App Key

Removes an API key.

Example

# 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
  # Uncomment this line to use JWTs
  # config.access_token = 'YOUR_JWT'
end

api_instance = SunshineConversationsClient::AppKeysApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
key_id = int_5d8cff3cd55b040010928b5b # String | The id of the key.
# Be sure to add the required body parameters

begin
  #Delete App Key
  result = api_instance.delete_app_key(app_id, key_id)
  p result
rescue SunshineConversationsClient::ApiError => e
  puts "Exception when calling AppKeysApi->delete_app_key: #{e}"
end

Parameters

NameTypeDescriptionNotes
app_idStringIdentifies the app.
key_idStringThe id of the key.

Return type

Object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_app_key

AppKeyResponse get_app_key(app_id, key_id)

Get App Key

Returns an API key.

Example

# 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
  # Uncomment this line to use JWTs
  # config.access_token = 'YOUR_JWT'
end

api_instance = SunshineConversationsClient::AppKeysApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
key_id = int_5d8cff3cd55b040010928b5b # String | The id of the key.
# Be sure to add the required body parameters

begin
  #Get App Key
  result = api_instance.get_app_key(app_id, key_id)
  p result
rescue SunshineConversationsClient::ApiError => e
  puts "Exception when calling AppKeysApi->get_app_key: #{e}"
end

Parameters

NameTypeDescriptionNotes
app_idStringIdentifies the app.
key_idStringThe id of the key.

Return type

AppKeyResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_app_keys

AppKeyListResponse list_app_keys(app_id)

List App Keys

Lists all API keys for a given app.

Example

# 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
  # Uncomment this line to use JWTs
  # config.access_token = 'YOUR_JWT'
end

api_instance = SunshineConversationsClient::AppKeysApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
# Be sure to add the required body parameters

begin
  #List App Keys
  result = api_instance.list_app_keys(app_id)
  p result
rescue SunshineConversationsClient::ApiError => e
  puts "Exception when calling AppKeysApi->list_app_keys: #{e}"
end

Parameters

NameTypeDescriptionNotes
app_idStringIdentifies the app.

Return type

AppKeyListResponse

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json