QuestionQ185

Using APIs

Question Image

Question Image

Refer to the exhibit. A system administrator has installed a Linux-based home alarm system that can run a Bash shell script whenever an intruder is detected. Create a chat-ops script that sends alarm notifications through the Webex REST API. Not all code snippets are used.

Drag & Drop
toPersonEmail
userName
-X POST
-X PUT
Content-Type: application/json
Content-Type: application/xml
Authorization: Basic
Authorization: Bearer
#!/bin/bash
curl  https://api.ciscospark.com/v1/messages \
  -H '' \
  -H ' NMU4NjQ0YWUtNjYy_P..._1eb6574-ad72cae0e10f' \
  -d '{ "": "cisco@usa.net", "text": "Intruder Alert!" }'
Explanation

Creating a Webex message is a POST request. The request body is JSON, so it needs the Content-Type: application/json header, while API tokens are supplied with Authorization: Bearer <token>. toPersonEmail identifies the email recipient of a private 1:1 message.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!