public class WebService
extends java.lang.Object
This class provides the web services from the Business Bot Platform such as BBP File store management (e.g. File registration), Chatbot callback services, Userstate management
| Modifier and Type | Field and Description |
|---|---|
java.util.HashMap<java.lang.String,java.lang.String> |
pluginMap |
| Constructor and Description |
|---|
WebService(java.util.HashMap<java.lang.String,java.lang.String> pluginMap)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ChatbotTaskSchedule> |
getChatbotCallbacks()
Get chatbot callbacks from BBP and return the results
|
java.util.List<Userstate> |
getUserstate(Userstate userstate)
Get user state from BBP and return the results
|
java.lang.String |
registerChatbotCallback(ChatbotCallback chatbotCallback)
Register chatbot callback to BBP and return the receipt id
|
java.lang.String |
registerFileToBBPFileStore(java.lang.String localImageFile)
Upload a file to BBP filestore and return the File UUID
|
static java.lang.String |
sendHttpGetRequest(java.lang.String targetURL,
java.lang.String urlParameters,
java.lang.String contentType,
java.lang.String language)
Perform HTTP GET request
|
static java.lang.String |
sendHttpGetRequestWithBasicAuthentication(java.lang.String targetURL,
java.lang.String username,
java.lang.String password)
Perform HTTP GET request with Basic authentication
|
static java.lang.String |
sendHttpPostRequest(java.lang.String targetURL,
java.lang.String body)
Perform HTTP POST request
|
boolean |
setUserstate(Userstate userstate)
Set userstate on BBP and return the receipt
|
boolean |
unregisterChatbotCallback(int callbackId)
Unregister chatbot callback from BBP and return the receipt id
|
public WebService(java.util.HashMap<java.lang.String,java.lang.String> pluginMap)
pluginMap - the plugin HashMappublic boolean setUserstate(Userstate userstate)
userstate - the Userstate objecttrue on success; otherwise falsepublic java.lang.String registerChatbotCallback(ChatbotCallback chatbotCallback) throws java.lang.Exception
chatbotCallback - the ChatbotCallback objectreceiptId on success; otherwise nulljava.lang.Exception - if something is wrong (e.g. JSON exception)public boolean unregisterChatbotCallback(int callbackId)
throws java.lang.Exception
callbackId - the callback identifiertrue on success; otherwise falsejava.lang.Exception - if something is wrong (e.g. JSON exception)public java.util.List<Userstate> getUserstate(Userstate userstate)
userstate - the Userstate objectList of Userstate object if exists; otherwise nullpublic java.util.List<ChatbotTaskSchedule> getChatbotCallbacks() throws java.lang.Exception
List of ChatbotTaskSchedule object if exists; otherwise nulljava.lang.Exception - if something is wrong (e.g. JSON exception)public java.lang.String registerFileToBBPFileStore(java.lang.String localImageFile)
throws java.lang.Exception
localImageFile - the local image filefileUUID if file was registered successfully; otherwise nulljava.lang.Exception - if something is wrong (e.g. JSON exception)public static java.lang.String sendHttpGetRequest(java.lang.String targetURL,
java.lang.String urlParameters,
java.lang.String contentType,
java.lang.String language)
targetURL - the destinal URLurlParameters - the URL parameterscontentType - the content type of the HTTP request (e.g. "application/x-www-form-urlencoded")language - the content language of the HTTP request (e.g. "en-US")nullpublic static java.lang.String sendHttpGetRequestWithBasicAuthentication(java.lang.String targetURL,
java.lang.String username,
java.lang.String password)
targetURL - the URLusername - the basic authentication usernamepassword - the basic authentication passwordpublic static java.lang.String sendHttpPostRequest(java.lang.String targetURL,
java.lang.String body)
targetURL - the URLbody - the URL parametersCopyright © 2019 Citunius GmbH. All Rights Reserved.