community.general.cisco_webex – Send a message to a Cisco Webex Teams Room or Individual

From Get docs
Ansible/docs/2.11/collections/community/general/cisco webex module


community.general.cisco_webex – Send a message to a Cisco Webex Teams Room or Individual

Note

This plugin is part of the community.general collection (version 2.0.1).

To install it use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.cisco_webex.


Synopsis

  • Send a message to a Cisco Webex Teams Room or Individual with options to control the formatting.

Parameters

Parameter Choices/Defaults Comments

msg

string / required

The message you would like to send.


aliases: message

msg_type

string

  • text

  • markdown

Specifies how you would like the message formatted.


aliases: message_type

personal_token

string / required

Your personal access token required to validate the Webex Teams API.


aliases: token

recipient_id

string / required

The unique identifier associated with the supplied recipient_type.

recipient_type

string / required

  • roomId
  • toPersonEmail
  • toPersonId

The request parameter you would like to send the message to.

Messages can be sent to either a room or individual (by ID or E-Mail).



Notes

Note


Examples

# Note: The following examples assume a variable file has been imported
# that contains the appropriate information.

- name: Cisco Webex Teams - Markdown Message to a Room
  community.general.cisco_webex:
    recipient_type: roomId
    recipient_id: "{{ room_id }}"
    msg_type: markdown
    personal_token: "{{ token }}"
    msg: "**Cisco Webex Teams Ansible Module - Room Message in Markdown**"

- name: Cisco Webex Teams - Text Message to a Room
  community.general.cisco_webex:
    recipient_type: roomId
    recipient_id: "{{ room_id }}"
    msg_type: text
    personal_token: "{{ token }}"
    msg: "Cisco Webex Teams Ansible Module - Room Message in Text"

- name: Cisco Webex Teams - Text Message by an Individuals ID
  community.general.cisco_webex:
    recipient_type: toPersonId
    recipient_id: "{{ person_id}}"
    msg_type: text
    personal_token: "{{ token }}"
    msg: "Cisco Webex Teams Ansible Module - Text Message to Individual by ID"

- name: Cisco Webex Teams - Text Message by an Individuals E-Mail Address
  community.general.cisco_webex:
    recipient_type: toPersonEmail
    recipient_id: "{{ person_email }}"
    msg_type: text
    personal_token: "{{ token }}"
    msg: "Cisco Webex Teams Ansible Module - Text Message to Individual by E-Mail"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

message

string

always

The Response Message returned by the Webex Teams API.

Full Response Code explanations can be found at https://developer.webex.com/docs/api/basics.


Sample:

OK (585 bytes)

status_code

integer

always

The Response Code returned by the Webex Teams API.

Full Response Code explanations can be found at https://developer.webex.com/docs/api/basics.


Sample:

200




Authors

  • Drew Rusell (@drew-russell)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/general/cisco_webex_module.html