Refer to the exhibit which shows a sequence diagram illustrating a client-server interaction. The correct sequence of steps that match the code snippet is as follows:
Step 1: POST /events - The client posts an event to the server.
Step 2: GET /messages/<messageId> - The client retrieves the message details from the server using the message ID.
Step 3: Response /messages/<messageId> - The server responds with the message details.
Step 4: GET /team-memberships?teamId=<teamId> - The client retrieves team membership details using the team ID.
Step 5: POST /message - The client posts a message.
Step 6: Response /message - The server responds with the message confirmation.
The correct code snippet represents the sequence diagram correctly:
@flask_app.route('/events', methods=['POST'])
def webex_teams_webhook_events():
json_data = request.json['data']
response = requests.get(MESSAGE_URL + json_data['id'], headers=headers)
if response.json()['text'] == 'Alert':
response = requests.get(TEAM_MEMBERSHIPS_URL, headers=headers, params=params)
for info in response.json()['items']:
data = {'personId': info['personId'], 'text': 'Alert'}
Submit