community.general.cisco_webex (8.5.0) — module

Send a message to a Cisco Webex Teams Room or Individual

Authors: Drew Rusell (@drew-russell)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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**"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"

Inputs

    
msg:
    description:
    - The message you would like to send.
    required: true
    type: str

msg_type:
    aliases:
    - message_type
    choices:
    - text
    - markdown
    default: text
    description:
    - Specifies how you would like the message formatted.
    type: str

recipient_id:
    description:
    - The unique identifier associated with the supplied O(recipient_type).
    required: true
    type: str

personal_token:
    aliases:
    - token
    description:
    - Your personal access token required to validate the Webex Teams API.
    required: true
    type: str

recipient_type:
    choices:
    - roomId
    - toPersonEmail
    - toPersonId
    description:
    - 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).
    required: true
    type: str

Outputs

message:
  description:
  - The Response Message returned by the Webex Teams API.
  - Full Response Code explanations can be found at U(https://developer.webex.com/docs/api/basics).
  returned: always
  sample: OK (585 bytes)
  type: str
status_code:
  description:
  - The Response Code returned by the Webex Teams API.
  - Full Response Code explanations can be found at U(https://developer.webex.com/docs/api/basics).
  returned: always
  sample: 200
  type: int