Strong APIs

All functionalites of to.chat are based on restful https APIs and Json messages, allowing us to create an standardized framework that both upward competable as well as easily maintainable, stable and future proof.

Scalable and Extendable

As we are completely open about the specifcations of our APIs we allow our users and community to build their own integrations leveraging our technology. As such we are super excited to progress on this journey and see how far the framework can take us together.

Proven Technologies

The use of proven and secure technologies allows us to focus on to.chat functionalites without burdening us with creating basic functionalities that make the service run. Those technologies include:

Technologies

  • Java
  • more meaningfull technology
  • Swagger

Design Principles

Domain based Architecture and Test Driven Design enable us to quickly expand our products while maintaining a highl level of code quality and application stablility.

More than just messaging

In todays world everything seems connected, we communicate with our friends, family, co-workers using a variety of tools and applications. Similar to us humans we have billions of online services and machines exchanging their information in various ways in a digital fashion be it via the internet or more enclosed local networks. Our goals is to bring those two worlds together and create a single pane of glass giving us access to both the human as well as the machine world.

Super easy integrations

The snippet below shows how fast and simple it is to send and receive messages from our server for your own device or application to work with.

Step 1. Add dependency to maven:

<dependency>
<groupId>chat.to</groupId>
<artifactId>spring-boot-server-bot</artifactId>
<version>0.0.1</version>
</dependency>

Step 2. Add credentials

Update application.properties Add bot credentials to application.properties Add bot credentials to application.properties
wemala.server.url=http://dev.to.chat
wemala.bot.identifier=my-bot@to.chat
wemala.bot.username=my-first-bot
wemala.bot.password=my-secure-bot-password

Step 3. Create Messaging class (Example in Kotlin)

			//Add Spring Boot component scan
			@ComponentScan("chat.to")
			@SpringBootApplication
			class MyWeMaLaBotAdapterApplication
			//Receive and send messages
			//By using ServerMessageExchangeService.kt you can receive and send messages:
			@Component
			class ServerMessageScheduler(private var serverMessageExchangeService: ServerMessageExchangeService) {
		
    				private val log = LoggerFactory.getLogger(ServerMessageScheduler::class.java)
		
    				@Scheduled(fixedRate = 3000)
    				fun scheduleUnreadMessages() {
        				log.info("Start retrieving latest messages")
     
        				serverMessageExchangeService.retrieveMessages().forEach {
            					val channelIdentifier = it._links.channel.href.substringAfter("/api/channel/")
            					log.info("Received message ${it.text} from channel $channelIdentifier")
            					serverMessageExchangeService.sendMessage(channelIdentifier, "pong")
        				}
        
        			log.info("${retrieveMessages.size} messages retrieved")
    				}
			}

Further snippets and examples can be found in our public code repository on github under WeMaLa

List of API Endpoint or Controllers

Name Description Payload type
Authentication-controller This Endpoint allows a contact to authenticate against the server. json - message POST
channel-controller API Endpoint to create and manage different channels. json - channel POST,GET & PATCH
contact-controller This API enables you to create new contacts for both humans and bots.
It also manages those contacts and their contections as well as allows to create an avatar image for it.
json - identifier GET & POST
message-controller The actual messagin API Endpoint to exchange messages in different forms via public, private and direct channels. json - message GET, POST & PATCH
user-controller This API is used to create new user and bots on the Server json - user POST & PATCH
more at api.to.chat