notify_by_webex_teams

command module
v0.0.0-...-26047da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

README

notify_by_webex_teams

CLI command for sending messages to Cisco Webex rooms or Cisco Webex recipient. Send messages and files to Webex Teams. If room name is not found a new room is created. Supports on file upload per request. by Herwig Grimm (herwig.grimm at aon.at)

required args

-T <Webex Teams API token>
-t <team name>
-r <room name>
-m <markdown message>

or

-T <Webex Teams API token>
-D <email address>
-m <markdown message>

optional flags

-p <proxy server>
-f <filename and path to send>
-a <card attachment>
-i 

flag details:

a ... card attachment -a see https://developer.webex.com/docs/api/guides/cards and https://adaptivecards.io/designer/
d ... delete message. provide message id
D ... Webex email address of the recipient when sending a private 1:1 message
f ... PNG filename and path to send
i ... read message from standard input
m ... markdown message
p ... proxy server. format: http://<user>:<password>@<hostname>:<port>
r ... Webex room name
T ... Webex bot token (bot must be member of team and room)")
t ... Webex team name
V ... show version

example

notify_by_webex_teams.exe -T <apitoken> -t "KMP-Team" -r "My New Room" -m "Happy hacking" -f logo.png
notify_by_webex_teams.exe -T <apitoken> -D john.smith@example.com -m "A direct message." -f logo.png

Cisco Webex Developer - Bot Section

Documentation

Overview

notify_by_webex_teams.go

CLI command for sending messages to Cisco Webex rooms. Send messages and files to Webex. If *room name* is not found a new room is created. Supports on file upload per request. by Herwig Grimm (herwig.grimm at aon.at)

required args:

-T <Webex bot token>
-t <team name> | -D <email address>
-r <room name>
-m <markdown message> | -i

optinal args:

-p <proxy server>
-f <png filename and path to send>
-d <message_id>
-a <card_attachment>
-i ... use standard input instead of flag -m

example:

upload_poc.exe -T <apitoken> -t "Test-Team" -r "INM18/00021" -m "Happy hacking" -f upload_poc.go

doc links:

https://developer.webex.com/getting-started.html

changelog:

V0.1 (16.05.2018): 	initial release
V0.2 (20.05.2018): 	now files (HTTP link) can be send via flag -a
V0.3 (25.05.2018): 	complete redesign without 3rd party library (github.com/vallard/spark/)
	and new file upload function added via flag -f
V0.4 (24.11.2019): 	new message delete function via flag -d
	and card attachment via flag -a. see also https://developer.webex.com/docs/api/guides/cards and https://adaptivecards.io/designer/
V0.5 (07.04.2022): new flag -i for reading messages from standard input and new flag description for flag -T
V0.6 (08.04.2022): new flag -D for sending a private 1:1 message by specified email address

card attachment example:

./notify_by_webex_teams -T "<token>" -t "KMP-Test-Team" -r "Allgemein" -m "Test GRH 010" \
-a '{ "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "text": "Please enter your comment here: " }, { "type": "Input.Text", "id": "name", "title": "New Input.Toggle", "placeholder": "comment text" } ], "actions": [ { "type": "Action.Submit", "title": "accept", "data": { "answer": "accept " } }, { "type": "Action.Submit", "title": "decline", "data": { "answer": "decline " } } ] } }'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL