____ _ _ _ _
| _ \ | | | | | | | |
| |_) | __ _ _ __ | | __ | |_ ___ | |_| |__ ___
| _ < / _` | '_ \| |/ / | __/ _ \ | __| '_ \ / _ \
| |_) | (_| | | | | < | || (_) | | |_| | | | __/
|____/ \__,_|_| |_|_|\_\ \__\___/ \__|_| |_|\___|
__
\ \ ________ __________ ______ ______
_____\ \ / ____/ / / /_ __/ / / / __ \/ ____/
|______> > / /_ / / / / / / / / / / /_/ / __/
/ / / __/ / /_/ / / / / /_/ / _, _/ /__
/_/ /_/ \____/ /_/ \____/_/ |_/_____/
- Hackathon 2017 -
Implements MS Bot v3 rest api via swagger codegen:
java -jar /swagger-codegen-cli-2.2.1.jar generate -i https://docs.botframework.com/en-us/restapi/directline3/swagger.json -l java --library okhttp-gson -c java-config.json -o v3client-okhttp
Config:
{
"modelPackage" : "org.bttf.v3client.model",
"apiPackage" : "org.bttf.v3client.api",
"invokerPackage" : "org.bttf.v3client",
"groupId" : "org.bttf.v3",
"artifactId" : "v3client",
"dateLibrary" : "java8"
}
Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deploy
Refer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>org.bttf.v3</groupId>
<artifactId>v3-bot-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "org.bttf.v3:v3-bot-client:1.0.0"
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/v3-bot-client-1.0.0.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import org.bttf.v3client.*;
import org.bttf.v3client.auth.*;
import org.bttf.v3client.model.*;
import org.bttf.v3client.api.ConversationsApi;
import java.io.File;
import java.util.*;
public class ConversationsApiExample {
public static void main(String[] args) {
ConversationsApi apiInstance = new ConversationsApi();
String conversationId = "conversationId_example"; // String | Conversation ID
String watermark = "watermark_example"; // String | (Optional) only returns activities newer than this watermark
try {
ActivitySet result = apiInstance.conversationsGetActivities(conversationId, watermark);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#conversationsGetActivities");
e.printStackTrace();
}
}
}
All URIs are relative to https://directline.botframework.com
Class | Method | HTTP request | Description |
---|---|---|---|
ConversationsApi | conversationsGetActivities | GET /v3/directline/conversations/{conversationId}/activities | Get activities in this conversation. This method is paged with the 'watermark' parameter. |
ConversationsApi | conversationsPostActivity | POST /v3/directline/conversations/{conversationId}/activities | Send an activity |
ConversationsApi | conversationsReconnectToConversation | GET /v3/directline/conversations/{conversationId} | Get information about an existing conversation |
ConversationsApi | conversationsStartConversation | POST /v3/directline/conversations | Start a new conversation |
ConversationsApi | conversationsUpload | POST /v3/directline/conversations/{conversationId}/upload | Upload file(s) and send as attachment(s) |
TokensApi | tokensGenerateTokenForNewConversation | POST /v3/directline/tokens/generate | Generate a token for a new conversation |
TokensApi | tokensRefreshToken | POST /v3/directline/tokens/refresh | Refresh a token |
- Activity
- ActivitySet
- AnimationCard
- Attachment
- AudioCard
- CardAction
- CardImage
- ChannelAccount
- Conversation
- ConversationAccount
- ConversationReference
- Entity
- Error
- ErrorResponse
- Fact
- GeoCoordinates
- HeroCard
- MediaUrl
- Mention
- Object
- Place
- ReceiptCard
- ReceiptItem
- ResourceResponse
- SigninCard
- SuggestedActions
- Thing
- ThumbnailCard
- ThumbnailUrl
- TokenParameters
- VideoCard
All endpoints do not require authorization. Authentication schemes defined for the API:
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issue.