README.md in smooch-api-5.12.0 vs README.md in smooch-api-5.13.0

- old
+ new

@@ -23,48 +23,49 @@ gem install smooch-api ``` Add this to the Gemfile: - gem 'smooch-api', '~> 5.12.0' + gem 'smooch-api', '~> 5.13.0' ## Getting Started -### Authentication with JSON Web Tokens (JWTs) +Familiarity with [Smooch API authentication](https://docs.smooch.io/guide/authentication-overview) is recommended. -JSON Web Tokens (JWTs) are an industry standard authentication mechanism. A great introduction to the technology is available [here](https://jwt.io/introduction/), and a broad set of supported JWT libraries for a variety of languages and platforms are available. +### Basic Authentication (recommended) -A JWT is composed of a header, a payload, and a signature. The payload contains information called claims which describe the subject to whom the token was issued. +With [basic authentication](https://docs.smooch.io/guide/basic-authentication), you can use your API key ID and secret to authenticate API requests. See below for a code sample. -Before you can make calls to the Smooch API, you'll need to create a JWT that proves you are authorized to use the API. +### Authentication with JSON Web Tokens (JWTs) -#### **Step 1** Generate a KEY ID and SECRET on the settings tab in the [Smooch Dashboard](https://app.smooch.io/). +See the [JSON Web Tokens (JWTs)](https://docs.smooch.io/guide/jwt) guide for more information and guidelines on when to use this method. In general, you'll want to favor using basic authentication. -![secret key and id](https://docs.smooch.io/images/secret_keys.png) +To generate a JWT, use your API key ID and secret. - #### **Step 2** Generate the JWT - Using the [ruby-jwt](https://github.com/jwt/ruby-jwt) gem: ```ruby require 'jwt' payload = {:scope => 'app'} -jwtHeader = {:kid => KEY_ID} +jwtHeader = {:kid => API_KEY_ID} -token = JWT.encode payload, SECRET, 'HS256', jwtHeader +token = JWT.encode payload, API_KEY_SECRET, 'HS256', jwtHeader ``` ### Running the code ```ruby # Load the gem require 'smooch-api' # Setup authorization SmoochApi.configure do |config| - # Configure API key authorization: jwt + + # OR + + # Configure JWT authorization (alternative method): jwt config.api_key['Authorization'] = 'YOUR JWT' config.api_key_prefix['Authorization'] = 'Bearer' end api_instance = SmoochApi::AppApi.new @@ -206,10 +207,12 @@ - [SmoochApi::DeploymentCreate](docs/DeploymentCreate.md) - [SmoochApi::DeploymentResponse](docs/DeploymentResponse.md) - [SmoochApi::Destination](docs/Destination.md) - [SmoochApi::DisplaySettings](docs/DisplaySettings.md) - [SmoochApi::Enums](docs/Enums.md) + - [SmoochApi::Field](docs/Field.md) + - [SmoochApi::FieldPost](docs/FieldPost.md) - [SmoochApi::GetIntegrationProfileResponse](docs/GetIntegrationProfileResponse.md) - [SmoochApi::GetMessagesResponse](docs/GetMessagesResponse.md) - [SmoochApi::Integration](docs/Integration.md) - [SmoochApi::IntegrationCreate](docs/IntegrationCreate.md) - [SmoochApi::IntegrationProfileUpdate](docs/IntegrationProfileUpdate.md) @@ -233,12 +236,15 @@ - [SmoochApi::MessageItem](docs/MessageItem.md) - [SmoochApi::MessageOverride](docs/MessageOverride.md) - [SmoochApi::MessageOverrideWhatsapp](docs/MessageOverrideWhatsapp.md) - [SmoochApi::MessagePost](docs/MessagePost.md) - [SmoochApi::MessageResponse](docs/MessageResponse.md) + - [SmoochApi::Option](docs/Option.md) + - [SmoochApi::QuotedMessage](docs/QuotedMessage.md) - [SmoochApi::SecretKey](docs/SecretKey.md) - [SmoochApi::SecretKeyCreate](docs/SecretKeyCreate.md) - [SmoochApi::SecretKeyResponse](docs/SecretKeyResponse.md) + - [SmoochApi::Select](docs/Select.md) - [SmoochApi::ServiceAccount](docs/ServiceAccount.md) - [SmoochApi::ServiceAccountCreate](docs/ServiceAccountCreate.md) - [SmoochApi::ServiceAccountResponse](docs/ServiceAccountResponse.md) - [SmoochApi::ServiceAccountUpdate](docs/ServiceAccountUpdate.md) - [SmoochApi::Source](docs/Source.md)