Line Message API (Independent Publisher) (#2667)

* add line connector

* Add more message tyoe

* update readme

* rename and append title in properties

* update info title

* rename connector and update for paconn validate

* Update responses code and Privacy policy url.

* update connectionParameters for api key
This commit is contained in:
Felaray 2023-06-14 07:19:46 +08:00 коммит произвёл GitHub
Родитель 2c7b998e6c
Коммит 12c670ab38
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 212 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,164 @@
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Line Message",
"description": "The connector allows you to send messages to registered LINE bot and associated users.",
"contact": {
"name": "Felaray Ho",
"url": "https://github.com/felaray",
"email": "Felaray@gmail.com"
}
},
"host": "api.line.me",
"basePath": "/",
"schemes": [
"https"
],
"consumes": ["application/json"],
"produces": [
"application/json"
],
"paths": {
"/v2/bot/message/push": {
"post": {
"summary": "Send Message To User",
"description": "Send a message to the associated user ID.",
"operationId": "SendMessage",
"parameters": [
{
"name": "Content-Type",
"in": "header",
"required": true,
"type": "string",
"default": "application/json",
"x-ms-visibility": "internal"
},
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "object",
"properties": {
"to": {
"type": "string",
"description": "user id"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "LINE message types",
"default": "text",
"title": "",
"x-ms-visibility": "advanced",
"enum": [
"text",
"sticker",
"image",
"location"
]
},
"text": {
"type": "string",
"title": "Text Type",
"description": "hello world"
},
"packageId": {
"type": "string",
"title": "Sticker Type",
"description": "Ex:446"
},
"stickerId": {
"type": "string",
"title": "Sticker Type",
"description": "Ex:1988"
},
"originalContentUrl": {
"type": "string",
"title": "Image Type",
"description": "https://example.com/image.jpg"
},
"previewImageUrl": {
"type": "string",
"title": "Image Type",
"description": "https://example.com/image.jpg"
},
"title": {
"type": "string",
"title": "Location Type",
"description": "Ex:My location"
},
"address": {
"type": "string",
"title": "Location Type",
"description": "Ex:My location"
},
"latitude": {
"type": "string",
"title": "Location Type",
"description": "Ex:35.687574,"
},
"longitude": {
"type": "string",
"title": "Location Type",
"description": "Ex:139.72922,"
}
}
},
"description": "messages"
}
}
}
}
],
"responses": {
"200": {
"description": "Request successful"
},
"400": {
"description": "Problem with the request"
},
"401": {
"description": "Valid channel access token is not specified."
}
},
"x-ms-visibility": "important"
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {
"Channel Access Token": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"security": [
{
"Channel Access Token": []
}
],
"tags": [],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://developers.line.biz/en/services/messaging-api/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://line.me/en/terms/policy/"
},
{
"propertyName": "Categories",
"propertyValue": "Communication"
}
]
}

Просмотреть файл

@ -0,0 +1,23 @@
{
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "API Key",
"description": "Request LINE Message Channel Access Token,see more at https://developers.line.biz/en/docs/messaging-api/channel-access-tokens/#what-are-channel-access-tokens",
"tooltip": "Provide your Channel Access Token,Example: Bearer **************** ",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"capabilities": [],
"publisher": "Felaray Ho",
"stackOwner": "LINE Corporation"
}
}

Просмотреть файл

@ -0,0 +1,25 @@
## Line Message API Connector
The connector allows you to send messages to registered LINE bot and associated users.
## Publisher : Felaray Ho
## Prerequisites
Request LINE Developer Account,
See more [Getting started with the Messaging API](https://developers.line.biz/en/docs/messaging-api/getting-started)
## Getting your credentials
Once you are logged in to LINE Developer Console dashboard, open the Auth Keys page and create a key to generate an API key and Bearer token.
See more [Long-lived channel access token](https://developers.line.biz/en/docs/messaging-api/channel-access-tokens/#long-lived-channel-access-tokens)
## Supported Operations
The connector supports the following operations:
* `Send Message To LineId`: Send message to line user via Line Bot.
## Known Issues and Limitations
N/A