The Java package for the Sunshine Conversations API
This SDK is automatically generated by the OpenAPI Generator Codegen project using the Sunshine Conversations API spec.
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 API, you may need to use an older release of this library. Use the table below as your guide:
Sunshine Conversations API version | zendesk/sunshine-conversations-java version to use |
---|---|
v2 Implementation guide |
9.* or newer |
v1.1 Upgrade guide |
4.* or 5.* |
v1 |
3.* or older |
Add the following remote repo to your project's POM:
<project ...>
<repositories>
<repository>
<id>zendesk-sunshine-conversations</id>
<url>https://smoochorg.bintray.com/maven/</url>
</repository>
</repositories>
</project>
Add this dependency to your project's POM:
<dependency>
<groupId>com.zendesk</groupId>
<artifactId>sunshine-conversations-client</artifactId>
<version>14.3.3</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "com.zendesk:sunshine-conversations-client:14.3.3"
Familiarity with Sunshine Conversations 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 com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.auth.*;
import com.zendesk.sunshine_conversations_client.api.ActivitiesApi;
import java.io.File;
import java.util.*;
public class ActivitiesApiExample {
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");
// Configure HTTP basic authorization (recommended): bearerAuth
HttpBasicAuth bearerAuth = (HttpBasicAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setUsername("API_KEY_ID");
bearerAuth.setPassword("API_KEY_SECRET");
ActivitiesApi apiInstance = new ActivitiesApi();
ActivityPost activityPost = {"author":{"type":"user","userId":"5963c0d619a30a2e00de36b8"},"type":"conversation:read"}; // ActivityPost |
String appId = 5d8cff3cd55b040010928b5b; // String | Identifies the app.
String conversationId = 029c31f25a21b47effd7be90; // String | Identifies the conversation.
try {
Object result = apiInstance.postActivity(activityPost, appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ActivitiesApi#postActivity");
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 |
---|---|---|---|
ActivitiesApi | postActivity | POST /v2/apps/{appId}/conversations/{conversationId}/activity | Post Activity |
AppKeysApi | createAppKey | POST /v2/apps/{appId}/keys | Create App Key |
AppKeysApi | deleteAppKey | DELETE /v2/apps/{appId}/keys/{keyId} | Delete App Key |
AppKeysApi | getAppKey | GET /v2/apps/{appId}/keys/{keyId} | Get App Key |
AppKeysApi | listAppKeys | GET /v2/apps/{appId}/keys | List App Keys |
AppsApi | createApp | POST /v2/apps | Create App |
AppsApi | deleteApp | DELETE /v2/apps/{appId} | Delete App |
AppsApi | getApp | GET /v2/apps/{appId} | Get App |
AppsApi | listApps | GET /v2/apps | List Apps |
AppsApi | updateApp | PATCH /v2/apps/{appId} | Update App |
AttachmentsApi | deleteAttachment | POST /v2/apps/{appId}/attachments/remove | Delete Attachment |
AttachmentsApi | uploadAttachment | POST /v2/apps/{appId}/attachments | Upload Attachment |
ClientsApi | createClient | POST /v2/apps/{appId}/users/{userIdOrExternalId}/clients | Create Client |
ClientsApi | listClients | GET /v2/apps/{appId}/users/{userIdOrExternalId}/clients | List Clients |
ClientsApi | removeClient | DELETE /v2/apps/{appId}/users/{userIdOrExternalId}/clients/{clientId} | Remove Client |
ConversationsApi | createConversation | POST /v2/apps/{appId}/conversations | Create Conversation |
ConversationsApi | deleteConversation | DELETE /v2/apps/{appId}/conversations/{conversationId} | Delete Conversation |
ConversationsApi | downloadMessageRef | POST /v2/apps/{appId}/conversations/{conversationId}/download | Download Message Ref |
ConversationsApi | getConversation | GET /v2/apps/{appId}/conversations/{conversationId} | Get Conversation |
ConversationsApi | listConversations | GET /v2/apps/{appId}/conversations | List Conversations |
ConversationsApi | updateConversation | PATCH /v2/apps/{appId}/conversations/{conversationId} | Update Conversation |
CustomIntegrationApiKeysApi | createCustomIntegrationKey | POST /v2/apps/{appId}/integrations/{integrationId}/keys | Create Integration Key |
CustomIntegrationApiKeysApi | deleteCustomIntegrationKey | DELETE /v2/apps/{appId}/integrations/{integrationId}/keys/{keyId} | Delete Integration Key |
CustomIntegrationApiKeysApi | getCustomIntegrationKey | GET /v2/apps/{appId}/integrations/{integrationId}/keys/{keyId} | Get Integration Key |
CustomIntegrationApiKeysApi | listCustomIntegrationKeys | GET /v2/apps/{appId}/integrations/{integrationId}/keys | List Integration Keys |
DevicesApi | getDevice | GET /v2/apps/{appId}/users/{userIdOrExternalId}/devices/{deviceId} | Get Device |
DevicesApi | listDevices | GET /v2/apps/{appId}/users/{userIdOrExternalId}/devices | List Devices |
IntegrationsApi | createIntegration | POST /v2/apps/{appId}/integrations | Create Integration |
IntegrationsApi | deleteIntegration | DELETE /v2/apps/{appId}/integrations/{integrationId} | Delete Integration |
IntegrationsApi | getIntegration | GET /v2/apps/{appId}/integrations/{integrationId} | Get Integration |
IntegrationsApi | listIntegrations | GET /v2/apps/{appId}/integrations | List Integrations |
IntegrationsApi | updateIntegration | PATCH /v2/apps/{appId}/integrations/{integrationId} | Update Integration |
MessagesApi | deleteAllMessages | DELETE /v2/apps/{appId}/conversations/{conversationId}/messages | Delete All Messages |
MessagesApi | deleteMessage | DELETE /v2/apps/{appId}/conversations/{conversationId}/messages/{messageId} | Delete Message |
MessagesApi | listMessages | GET /v2/apps/{appId}/conversations/{conversationId}/messages | List Messages |
MessagesApi | postMessage | POST /v2/apps/{appId}/conversations/{conversationId}/messages | Post Message |
OAuthEndpointsApi | authorize | GET /oauth/authorize | Authorize |
OAuthEndpointsApi | getToken | POST /oauth/token | Get Token |
OAuthEndpointsApi | revokeAccess | DELETE /oauth/authorization | Revoke Access |
ParticipantsApi | joinConversation | POST /v2/apps/{appId}/conversations/{conversationId}/join | Join Conversation |
ParticipantsApi | leaveConversation | POST /v2/apps/{appId}/conversations/{conversationId}/leave | Leave Conversation |
ParticipantsApi | listParticipants | GET /v2/apps/{appId}/conversations/{conversationId}/participants | List Participants |
SwitchboardActionsApi | acceptControl | POST /v2/apps/{appId}/conversations/{conversationId}/acceptControl | Accept Control |
SwitchboardActionsApi | offerControl | POST /v2/apps/{appId}/conversations/{conversationId}/offerControl | Offer Control |
SwitchboardActionsApi | passControl | POST /v2/apps/{appId}/conversations/{conversationId}/passControl | Pass Control |
SwitchboardActionsApi | releaseControl | POST /v2/apps/{appId}/conversations/{conversationId}/releaseControl | Release Control |
SwitchboardIntegrationsApi | createSwitchboardIntegration | POST /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations | Create Switchboard Integration |
SwitchboardIntegrationsApi | deleteSwitchboardIntegration | DELETE /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations/{switchboardIntegrationId} | Delete Switchboard Integration |
SwitchboardIntegrationsApi | listSwitchboardIntegrations | GET /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations | List Switchboard Integrations |
SwitchboardIntegrationsApi | updateSwitchboardIntegration | PATCH /v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations/{switchboardIntegrationId} | Update Switchboard Integration |
SwitchboardsApi | createSwitchboard | POST /v2/apps/{appId}/switchboards | Create Switchboard |
SwitchboardsApi | deleteSwitchboard | DELETE /v2/apps/{appId}/switchboards/{switchboardId} | Delete Switchboard |
SwitchboardsApi | listSwitchboards | GET /v2/apps/{appId}/switchboards | List Switchboards |
SwitchboardsApi | updateSwitchboard | PATCH /v2/apps/{appId}/switchboards/{switchboardId} | Update Switchboard |
UsersApi | createUser | POST /v2/apps/{appId}/users | Create User |
UsersApi | deleteUser | DELETE /v2/apps/{appId}/users/{userIdOrExternalId} | Delete User |
UsersApi | deleteUserPersonalInformation | DELETE /v2/apps/{appId}/users/{userIdOrExternalId}/personalinformation | Delete User Personal Information |
UsersApi | getUser | GET /v2/apps/{appId}/users/{userIdOrExternalId} | Get User |
UsersApi | updateUser | PATCH /v2/apps/{appId}/users/{userIdOrExternalId} | Update User |
WebhooksApi | createWebhook | POST /v2/apps/{appId}/integrations/{integrationId}/webhooks | Create Webhook |
WebhooksApi | deleteWebhook | DELETE /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId} | Delete Webhook |
WebhooksApi | getWebhook | GET /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId} | Get Webhook |
WebhooksApi | listWebhooks | GET /v2/apps/{appId}/integrations/{integrationId}/webhooks | List Webhooks |
WebhooksApi | updateWebhook | PATCH /v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId} | Update Webhook |
- AcceptControlBody
- Action
- ActionSubset
- Activity
- ActivityAllOf
- ActivityMessage
- ActivityPost
- ActivityPostAllOf
- ActivityTypes
- Android
- AndroidAllOf
- AndroidUpdate
- AndroidUpdateAllOf
- ApiKey
- App
- AppCreateBody
- AppKey
- AppKeyCreateBody
- AppKeyListResponse
- AppKeyResponse
- AppListFilter
- AppListResponse
- AppResponse
- AppSettings
- AppSubSchema
- AppUpdateBody
- Apple
- AppleAllOf
- AppleMessageOverridePayload
- AppleUpdate
- AppleUpdateAllOf
- AttachmentDeleteBody
- AttachmentResponse
- AttachmentSchema
- AttachmentUploadBody
- Author
- AuthorWebhook
- Buy
- Campaign
- CarouselMessage
- CarouselMessageDisplaySettings
- Client
- ClientAddEvent
- ClientAddEventAllOf
- ClientAddEventAllOfPayload
- ClientAssociation
- ClientCreate
- ClientListResponse
- ClientRemoveEvent
- ClientRemoveEventAllOf
- ClientRemoveEventAllOfPayload
- ClientResponse
- ClientType
- ClientUpdateEvent
- ClientUpdateEventAllOf
- ClientUpdateEventAllOfPayload
- Confirmation
- Content
- Conversation
- ConversationAllOf
- ConversationCreateBody
- ConversationCreateEvent
- ConversationCreateEventAllOf
- ConversationCreateEventAllOfPayload
- ConversationJoinEvent
- ConversationJoinEventAllOf
- ConversationJoinEventAllOfPayload
- ConversationLeaveEvent
- ConversationLeaveEventAllOf
- ConversationLeaveEventAllOfPayload
- ConversationListFilter
- ConversationListResponse
- ConversationMessageDeliveryChannelEvent
- ConversationMessageDeliveryChannelEventAllOf
- ConversationMessageDeliveryFailureEvent
- ConversationMessageDeliveryFailureEventAllOf
- ConversationMessageDeliveryPayload
- ConversationMessageDeliveryPayloadDestination
- ConversationMessageDeliveryPayloadExternalMessages
- ConversationMessageDeliveryPayloadMessage
- ConversationMessageDeliveryUserEvent
- ConversationMessageEvent
- ConversationMessageEventAllOf
- ConversationMessageEventAllOfPayload
- ConversationPostbackEvent
- ConversationPostbackEventAllOf
- ConversationPostbackEventAllOfPayload
- ConversationReadEvent
- ConversationReadEventAllOf
- ConversationReadEventAllOfPayload
- ConversationReferralEvent
- ConversationReferralEventAllOf
- ConversationReferralEventAllOfPayload
- ConversationRemoveEvent
- ConversationRemoveEventAllOf
- ConversationRemoveEventAllOfPayload
- ConversationResponse
- ConversationTruncated
- ConversationType
- ConversationTypingEvent
- ConversationTypingEventAllOf
- ConversationTypingEventAllOfPayload
- ConversationUpdateBody
- Custom
- CustomAllOf
- CustomUpdate
- DefaultResponder
- DefaultResponderDefaultResponder
- DefaultResponderId
- Destination
- Device
- DeviceListResponse
- DeviceResponse
- DownloadMessageRefBody
- DownloadMessageRefBodyAllOf
- DownloadMessageRefBodyAllOfApple
- DownloadMessageRefBodyAllOfAppleInteractiveDataRef
- EventSubSchema
- ExtraChannelOptions
- ExtraChannelOptionsMessenger
- Field
- FileMessage
- FormMessage
- FormMessageField
- FormMessageFieldAllOf
- FormResponseMessage
- FormResponseMessageField
- FormResponseMessageFieldAllOf
- Identity
- ImageMessage
- InlineObject
- InstagramAllOf
- InstagramUpdate
- InstagramUpdateAllOf
- Integration
- IntegrationApiKey
- IntegrationApiKeyListResponse
- IntegrationApiKeyResponse
- IntegrationId
- IntegrationListFilter
- IntegrationListResponse
- IntegrationResponse
- IntegrationType
- IntegrationUpdate
- IntegrationUpdateBase
- Ios
- IosAllOf
- IosUpdate
- IosUpdateAllOf
- Item
- Line
- LineAllOf
- LineUpdate
- Link
- Links
- ListMessage
- LocationMessage
- LocationMessageCoordinates
- LocationMessageLocation
- LocationRequest
- Mailgun
- MailgunAllOf
- MailgunUpdate
- MailgunUpdateAllOf
- MatchCriteria
- MatchCriteriaBase
- MatchCriteriaMailgun
- MatchCriteriaMailgunAllOf
- MatchCriteriaMessagebird
- MatchCriteriaMessagebirdAllOf
- MatchCriteriaTwilio
- MatchCriteriaTwilioAllOf
- MatchCriteriaWhatsapp
- MatchCriteriaWhatsappAllOf
- Message
- MessageBirdUpdate
- MessageListResponse
- MessageOverride
- MessageOverrideApple
- MessageOverrideLine
- MessageOverrideMessenger
- MessageOverridePayload
- MessageOverrideWhatsapp
- MessagePost
- MessagePostResponse
- MessageWebhook
- Messagebird
- MessagebirdAllOf
- Messenger
- MessengerAllOf
- MessengerUpdate
- Meta
- OfferControlBody
- Page
- Participant
- ParticipantJoinBody
- ParticipantLeaveBody
- ParticipantLeaveBodyParticipantId
- ParticipantLeaveBodyUserExternalId
- ParticipantLeaveBodyUserId
- ParticipantListResponse
- ParticipantResponse
- ParticipantSubSchema
- ParticipantWithUserExternalId
- ParticipantWithUserId
- PassControlBody
- Postback
- PostbackWebhook
- PrechatCapture
- Profile
- QuotedMessage
- QuotedMessageExternalMessageId
- QuotedMessageMessage
- Referral
- ReferralDetails
- Reply
- Source
- SourceWebhook
- SourceWithCampaignWebhook
- SourceWithCampaignWebhookAllOf
- Status
- Switchboard
- SwitchboardAcceptControl
- SwitchboardAcceptControlAllOf
- SwitchboardAcceptControlAllOfPayload
- SwitchboardAcceptControlFailure
- SwitchboardAcceptControlFailureAllOf
- SwitchboardAcceptControlFailureAllOfPayload
- SwitchboardIntegration
- SwitchboardIntegrationCreateBody
- SwitchboardIntegrationListResponse
- SwitchboardIntegrationResponse
- SwitchboardIntegrationUpdateBody
- SwitchboardIntegrationWebhook
- SwitchboardListResponse
- SwitchboardOfferControl
- SwitchboardOfferControlAllOf
- SwitchboardOfferControlAllOfPayload
- SwitchboardOfferControlFailure
- SwitchboardPassControl
- SwitchboardPassControlAllOf
- SwitchboardPassControlAllOfPayload
- SwitchboardPassControlFailure
- SwitchboardResponse
- SwitchboardUpdateBody
- Target
- Telegram
- TelegramAllOf
- TelegramUpdate
- TemplateMessage
- TextMessage
- TicketClosed
- TransferToEmail
- Twilio
- TwilioAllOf
- TwilioUpdate
- TwitterAllOf
- TwitterUpdate
- Unity
- UnityAllOf
- UnityUpdate
- UnityUpdateAllOf
- User
- UserAllOf
- UserCreateBody
- UserMergeEvent
- UserMergeEventAllOf
- UserMergeEventAllOfPayload
- UserMergeEventAllOfPayloadMergedClients
- UserMergeEventAllOfPayloadMergedConversations
- UserMergeEventAllOfPayloadMergedUsers
- UserRemoveEvent
- UserRemoveEventAllOf
- UserRemoveEventAllOfPayload
- UserResponse
- UserTruncated
- UserUpdateBody
- UserUpdateEvent
- UserUpdateEventAllOf
- UserUpdateEventAllOfPayload
- Viber
- ViberAllOf
- ViberUpdate
- Web
- WebAllOf
- WebUpdate
- WebUpdateAllOf
- Webhook
- WebhookBody
- WebhookCreateBody
- WebhookListResponse
- WebhookResponse
- WebhookSubSchema
- Webview
- WhatsAppUpdate
- WhatsAppUpdateAllOf
- WhatsappAllOf
Authentication schemes defined for the API:
- Type: HTTP basic authentication
- Type: HTTP basic authentication
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues. Alternatively, configure the connectionPool to use a number of threads for the ApiClient. The default number is 20, but can be configured through the constructor new ApiClient(30);
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.