About the LINE Messaging API

Spring Boot integration

The line-bot-spring-boot module lets you build a bot application as a Spring Boot application.

/* * Copyright 2016 LINE Corporation * * LINE Corporation licenses this file to you 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.*/packagecom.example.bot.spring.echo;
importorg.springframework.boot.SpringApplication;
importorg.springframework.boot.autoconfigure.SpringBootApplication;
importcom.linecorp.bot.model.event.Event;
importcom.linecorp.bot.model.event.MessageEvent;
importcom.linecorp.bot.model.event.message.TextMessageContent;
importcom.linecorp.bot.model.message.TextMessage;
importcom.linecorp.bot.spring.boot.annotation.EventMapping;
importcom.linecorp.bot.spring.boot.annotation.LineMessageHandler;
@SpringBootApplication@LineMessageHandlerpublicclassEchoApplication {
publicstaticvoidmain(String[] args) {
SpringApplication.run(EchoApplication.class, args);
}
@EventMappingpublicTextMessagehandleTextMessageEvent(MessageEvent<TextMessageContent>event) {
System.out.println("event: "+ event);
returnnewTextMessage(event.getMessage().getText());
}
@EventMappingpublicvoidhandleDefaultMessageEvent(Eventevent) {
System.out.println("event: "+ event);
}
}

Requirements

Versioning

FAQ

How do I use a proxy server?

You can use LineMessagingServiceBuilder to configure a proxy server. It accepts your own OkHttpBuilder instance.

Note: You don't need to use an add-on like Fixie to have static IP addresses for proxy servers. You can make API calls without entering IP addresses on the server IP whitelist.

LICENSE

Copyright (C) 2016 LINE Corp.
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.