The Java package for the Smooch API
The Smooch API is a unified interface for powering messaging in your customer experiences across every channel. Our API speeds access to new markets, reduces time to ship, eliminates complexity, and helps you build the best experiences for your customers. For more information, visit our official documentation.
This SDK is automatically generated by the Swagger Codegen project using the Smooch api spec.
The Smooch API offers multiple versions. Each release of this project targets one and only one Smooch API version. If you depend on an older version of the Smooch API, you may need to use an older release of this library. Use the table below as your guide:
Smooch API version | smooch-java version to use |
---|---|
v1.1 Upgrade guide |
4.0.0 or newer |
v1 |
3.* or older |
Add the following remote repo to your project's POM:
<project ...>
<repositories>
<repository>
<id>smooch.io</id>
<url>https://smoochorg.bintray.com/maven/</url>
</repository>
</repositories>
</project>
Add this dependency to your project's POM:
<dependency>
<groupId>io.smooch</groupId>
<artifactId>api</artifactId>
<version>5.27.1</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "io.smooch:api:5.27.1"
Familiarity with Smooch API authentication is recommended.
With basic authentication, you can use your API key ID and secret to authenticate API requests. See below for a code sample.
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 jjwt package:
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.impl.crypto.MacProvider;
import io.jsonwebtoken.security.Keys;
import static io.jsonwebtoken.JwsHeader.KEY_ID;
// ...
String jwt = Jwts.builder()
.claim("scope", "app")
.setHeaderParam(KEY_ID, "YOUR_KEY_ID")
.signWith(
Keys.hmacShaKeyFor("YOUR_SECRET".getBytes()),
SignatureAlgorithm.HS256
)
.compact();
import io.smooch.client.ApiClient;
import io.smooch.client.ApiException;
import io.smooch.client.Configuration;
import io.smooch.client.auth.*;
import io.smooch.client.api.AppApi;
import java.io.File;
import java.util.*;
public class AppApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization (recommended): basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("API_KEY_ID");
basicAuth.setPassword("API_KEY_SECRET");
// OR
// Configure JWT authorization (alternative method): jwt
ApiKeyAuth jwt = (ApiKeyAuth) defaultClient.getAuthentication("jwt");
jwt.setApiKey("YOUR JWT");
jwt.setApiKeyPrefix("Bearer");
AppApi apiInstance = new AppApi();
AppCreate appCreateBody = new AppCreate(); // AppCreate | Body for a createApp request.
try {
AppResponse result = apiInstance.createApp(appCreateBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AppApi#createApp");
e.printStackTrace();
}
}
}
Smooch is available in the following regions. The US region will be used by default. To target any other region, specify the region API host in setBasePath()
. For example:
defaultClient.setBasePath("https://api.eu-1.smooch.io");
All URIs are relative to https://api.smooch.io
Class | Method | HTTP request | Description |
---|---|---|---|
AppApi | createApp | POST /v1.1/apps | |
AppApi | createSecretKey | POST /v1.1/apps/{appId}/keys | |
AppApi | deleteApp | DELETE /v1.1/apps/{appId} | |
AppApi | deleteSecretKey | DELETE /v1.1/apps/{appId}/keys/{keyId} | |
AppApi | getApp | GET /v1.1/apps/{appId} | |
AppApi | getAppJwt | GET /v1.1/apps/{appId}/keys/{keyId}/jwt | |
AppApi | getSdkIds | GET /v1.1/apps/{appId}/sdks | |
AppApi | getSecretKey | GET /v1.1/apps/{appId}/keys/{keyId} | |
AppApi | listApps | GET /v1.1/apps | |
AppApi | listSecretKeys | GET /v1.1/apps/{appId}/keys | |
AppApi | updateApp | PUT /v1.1/apps/{appId} | |
AppUserApi | deleteAppUser | DELETE /v1.1/apps/{appId}/appusers/{userId} | |
AppUserApi | deleteAppUserProfile | DELETE /v1.1/apps/{appId}/appusers/{userId}/profile | |
AppUserApi | getAppUser | GET /v1.1/apps/{appId}/appusers/{userId} | |
AppUserApi | getAppUserAuthCode | GET /v1.1/apps/{appId}/appusers/{userId}/authcode | |
AppUserApi | getAppUserBusinessSystemIds | GET /v1.1/apps/{appId}/appusers/{userId}/businesssystems | |
AppUserApi | getAppUserEntityIds | GET /v1.1/apps/{appId}/appusers/{userId}/channels | |
AppUserApi | getLinkRequests | GET /v1.1/apps/{appId}/appusers/{userId}/linkrequest | |
AppUserApi | linkAppUser | POST /v1.1/apps/{appId}/appusers/{userId}/channels | |
AppUserApi | mergeUsers | POST /v1.1/apps/{appId}/appusers/merge | |
AppUserApi | postImageMessage | POST /v1.1/apps/{appId}/appusers/{userId}/images | |
AppUserApi | preCreateAppUser | POST /v1.1/apps/{appId}/appusers | |
AppUserApi | unlinkAppUser | DELETE /v1.1/apps/{appId}/appusers/{userId}/channels/{channel} | |
AppUserApi | updateAppUser | PUT /v1.1/apps/{appId}/appusers/{userId} | |
AttachmentsApi | removeAttachment | POST /v1.1/apps/{appId}/attachments/remove | |
AttachmentsApi | uploadAttachment | POST /v1.1/apps/{appId}/attachments | |
ConversationApi | conversationActivity | POST /v1.1/apps/{appId}/appusers/{userId}/conversation/activity | |
ConversationApi | deleteMessage | DELETE /v1.1/apps/{appId}/appusers/{userId}/messages/{messageId} | |
ConversationApi | deleteMessages | DELETE /v1.1/apps/{appId}/appusers/{userId}/messages | |
ConversationApi | getMessages | GET /v1.1/apps/{appId}/appusers/{userId}/messages | |
ConversationApi | postMessage | POST /v1.1/apps/{appId}/appusers/{userId}/messages | |
ConversationApi | resetUnreadCount | POST /v1.1/apps/{appId}/appusers/{userId}/conversation/read | |
DeploymentApi | activatePhoneNumber | POST /v1.1/whatsapp/deployments/{deploymentId}/activate | |
DeploymentApi | confirmCode | POST /v1.1/whatsapp/deployments/{deploymentId}/code/confirm | |
DeploymentApi | createDeployment | POST /v1.1/whatsapp/deployments | |
DeploymentApi | deleteDeployment | DELETE /v1.1/whatsapp/deployments/{deploymentId} | |
DeploymentApi | getDeployment | GET /v1.1/whatsapp/deployments/{deploymentId} | |
DeploymentApi | listDeployments | GET /v1.1/whatsapp/deployments | |
IntegrationApi | createIntegration | POST /v1.1/apps/{appId}/integrations | |
IntegrationApi | createIntegrationMenu | POST /v1.1/apps/{appId}/integrations/{integrationId}/menu | |
IntegrationApi | deleteIntegration | DELETE /v1.1/apps/{appId}/integrations/{integrationId} | |
IntegrationApi | deleteIntegrationMenu | DELETE /v1.1/apps/{appId}/integrations/{integrationId}/menu | |
IntegrationApi | getIntegration | GET /v1.1/apps/{appId}/integrations/{integrationId} | |
IntegrationApi | getIntegrationMenu | GET /v1.1/apps/{appId}/integrations/{integrationId}/menu | |
IntegrationApi | getIntegrationProfile | GET /v1.1/apps/{appId}/integrations/{integrationId}/profile | |
IntegrationApi | listIntegrations | GET /v1.1/apps/{appId}/integrations | |
IntegrationApi | updateIntegration | PUT /v1.1/apps/{appId}/integrations/{integrationId} | |
IntegrationApi | updateIntegrationMenu | PUT /v1.1/apps/{appId}/integrations/{integrationId}/menu | |
IntegrationApi | updateIntegrationProfile | PUT /v1.1/apps/{appId}/integrations/{integrationId}/profile | |
IntegrationApi | uploadIntegrationProfilePhoto | PUT /v1.1/apps/{appId}/integrations/{integrationId}/profile/photo | |
MenuApi | deleteMenu | DELETE /v1.1/apps/{appId}/menu | |
MenuApi | getMenu | GET /v1.1/apps/{appId}/menu | |
MenuApi | updateMenu | PUT /v1.1/apps/{appId}/menu | |
NotificationApi | postNotification | POST /v1/apps/{appId}/notifications | |
ServiceAccountApi | createSecretKey | POST /v1.1/serviceaccounts/{serviceAccountId}/keys | |
ServiceAccountApi | createServiceAccount | POST /v1.1/serviceaccounts | |
ServiceAccountApi | deleteSecretKey | DELETE /v1.1/serviceaccounts/{serviceAccountId}/keys/{keyId} | |
ServiceAccountApi | deleteServiceAccount | DELETE /v1.1/serviceaccounts/{serviceAccountId} | |
ServiceAccountApi | getJwt | GET /v1.1/serviceaccounts/{serviceAccountId}/keys/{keyId}/jwt | |
ServiceAccountApi | getSecretKey | GET /v1.1/serviceaccounts/{serviceAccountId}/keys/{keyId} | |
ServiceAccountApi | getServiceAccount | GET /v1.1/serviceaccounts/{serviceAccountId} | |
ServiceAccountApi | listSecretKeys | GET /v1.1/serviceaccounts/{serviceAccountId}/keys | |
ServiceAccountApi | listServiceAccounts | GET /v1.1/serviceaccounts | |
ServiceAccountApi | updateServiceAccount | PUT /v1.1/serviceaccounts/{serviceAccountId} | |
TemplateApi | createTemplate | POST /v1.1/apps/{appId}/templates | |
TemplateApi | deleteTemplate | DELETE /v1.1/apps/{appId}/templates/{templateId} | |
TemplateApi | getTemplate | GET /v1.1/apps/{appId}/templates/{templateId} | |
TemplateApi | listTemplates | GET /v1.1/apps/{appId}/templates | |
TemplateApi | updateTemplate | PUT /v1.1/apps/{appId}/templates/{templateId} | |
WebhookApi | createWebhook | POST /v1.1/apps/{appId}/webhooks | |
WebhookApi | deleteWebhook | DELETE /v1.1/apps/{appId}/webhooks/{webhookId} | |
WebhookApi | getWebhook | GET /v1.1/apps/{appId}/webhooks/{webhookId} | |
WebhookApi | listWebhooks | GET /v1.1/apps/{appId}/webhooks | |
WebhookApi | updateWebhook | PUT /v1.1/apps/{appId}/webhooks/{webhookId} |
- Action
- ActivityResponse
- App
- AppCreate
- AppResponse
- AppSettings
- AppUpdate
- AppUser
- AppUserBusinessSystemsResponse
- AppUserChannelsResponse
- AppUserLink
- AppUserMerge
- AppUserPreCreate
- AppUserResponse
- AppUserUpdate
- AttachmentRemove
- AttachmentResponse
- AuthCodeResponse
- Author
- BusinessSystemItem
- ChannelEntityItem
- Client
- ClientInfo
- Confirmation
- Conversation
- ConversationActivity
- Coordinates
- Deployment
- DeploymentActivatePhoneNumber
- DeploymentConfirmCode
- DeploymentCreate
- DeploymentResponse
- Destination
- DisplaySettings
- Enums
- Field
- FieldPost
- GetIntegrationProfileResponse
- GetMessagesResponse
- GetSdkIdsResponse
- Integration
- IntegrationCreate
- IntegrationProfileUpdate
- IntegrationResponse
- IntegrationUpdate
- JwtResponse
- LinkRequestResponse
- LinkRequestResponseLinkRequests
- ListAppsResponse
- ListDeploymentsResponse
- ListIntegrationsResponse
- ListSecretKeysResponse
- ListServiceAccountsResponse
- ListTemplatesResponse
- ListWebhooksResponse
- Location
- Menu
- MenuItem
- MenuResponse
- MergedUser
- Message
- MessageItem
- MessageOverride
- MessageOverrideLine
- MessageOverrideMessenger
- MessageOverrideWhatsapp
- MessagePost
- MessageResponse
- NotificationPost
- NotificationPostDestination
- NotificationResponse
- NotificationResponseNotification
- Option
- QuotedMessage
- SecretKey
- SecretKeyCreate
- SecretKeyResponse
- Select
- ServiceAccount
- ServiceAccountCreate
- ServiceAccountResponse
- ServiceAccountUpdate
- Source
- SubMenuItem
- Template
- TemplateCreate
- TemplateResponse
- TemplateUpdate
- UploadIntegrationProfilePhotoResponse
- Webhook
- WebhookCreate
- WebhookResponse
- WebhookUpdate
Authentication schemes defined for the API:
- Type: HTTP basic authentication
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.
Copyright 2018 Zendesk, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.