Ok, nach dem Hinweis bez. der richtigen Adresse habe ich dann auch die REST API endlich gefunden!
Ich habe den Code aus einem Deiner vorherigen Beiträge eingetragen und den Token und die Chat-ID ergänzt.
Nach einem Kick auf "Try it out" kommt dann Folgendes (Chat-ID und Token habe ich nach dem Einfügen händisch rausgelöscht):
Response Messages
HTTP Status Code Reason Response Model Headers
400
A uid must be provided, if no binding can create a thing of this type.
409
A thing with the same uid already exists.
Hide Response
Curl
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{
\"label\": \"Telegram Bot\",
\"configuration\": {
\"proxyType\": \"SOCKS5\",
\"parseMode\": \"\",
\"chatIds\": \"<händisch von mir gelöscht>\",
\"botToken\": \"<händisch von mir gelöscht>\"
},
\"properties\": {},
\"UID\": \"telegram:telegramBot:Telegram_Bot\",
\"thingTypeUID\": \"telegram:telegramBot\"
}" "
http://192.168.178.10:8080/rest/things"
Request URL
http://192.168.178.10:8080/rest/things
Response Body
{
"error": {
"message": "Thing telegram:telegramBot:Telegram_Bot already exists!",
"http-code": 409
},
"entity": {
"statusInfo": {
"status": "ONLINE",
"statusDetail": "NONE"
},
"editable": true,
"label": "Telegram Bot",
"configuration": {
"proxyType": "SOCKS5",
"parseMode": "",
"chatIds": [
"<händisch von mir gelöscht>"
],
"botToken": "<händisch von mir gelöscht>"
},
"properties": {},
"UID": "telegram:telegramBot:Telegram_Bot",
"thingTypeUID": "telegram:telegramBot",
"channels": [
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:lastMessageText",
"id": "lastMessageText",
"channelTypeUID": "telegram:lastMessageText",
"itemType": "String",
"kind": "STATE",
"label": "Last Message Text",
"description": "Contains the latest message text as a string",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:lastMessageURL",
"id": "lastMessageURL",
"channelTypeUID": "telegram:lastMessageURL",
"itemType": "String",
"kind": "STATE",
"label": "Last Message URL",
"description": "Contains the URL of the latest message",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:lastMessageDate",
"id": "lastMessageDate",
"channelTypeUID": "telegram:lastMessageDate",
"itemType": "DateTime",
"kind": "STATE",
"label": "Last Message Date",
"description": "Contains the latest message date as a DateTime",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:lastMessageName",
"id": "lastMessageName",
"channelTypeUID": "telegram:lastMessageName",
"itemType": "String",
"kind": "STATE",
"label": "Last Message Name",
"description": "Contains the latest message senders name as a string",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:lastMessageUsername",
"id": "lastMessageUsername",
"channelTypeUID": "telegram:lastMessageUsername",
"itemType": "String",
"kind": "STATE",
"label": "Last Message Username",
"description": "Contains the latest message senders username as a string",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:chatId",
"id": "chatId",
"channelTypeUID": "telegram:chatId",
"itemType": "String",
"kind": "STATE",
"label": "Chat Id",
"description": "Contains the id of chat from where the message was received.",
"defaultTags": [],
"properties": {},
"configuration": {}
},
{
"linkedItems": [],
"uid": "telegram:telegramBot:Telegram_Bot:replyId",
"id": "replyId",
"channelTypeUID": "telegram:replyId",
"itemType": "String",
"kind": "STATE",
"label": "Reply Id",
"description": "Contains the id of the reply which was passed to sendTelegram() as replyId. This id can be used to have an unambiguous assignment of the user reply to the message which was sent by the bot.",
"defaultTags": [],
"properties": {},
"configuration": {}
}
]
}
}
Response Code
409
Response Headers
{
"content-encoding": "UTF-8",
"content-length": "2832",
"content-type": "application/json",
"server": "Jetty(9.4.20.v20190813)"
}
Ist das, trotz der Fehlermeldungen, so alles korrekt und wie es sein sollte?
Ich finde übrigens auch nirgendwo einen Button zum Speichern meiner Eingaben - oder geht das automatisch nach der Eintragung und ich kann das Fenster einfach nur schließen?