Intro-To-Serverless icon indicating copy to clipboard operation
Intro-To-Serverless copied to clipboard

[Content Bug] Response Week 3 step 6 - Twilio Code Sample

Open lechnerc77 opened this issue 3 years ago • 2 comments

Can you keep a secret?

Identify Steps:

  • Step 6

Week:

Week 3

Describe the Issue

  • Azure Function(s) as a product name need to start with capital letters - needs to be checked for all sessions
  • Fix the Twilio code to be compliant with Twilio's expectations of a response object

Proposed Fix

  • Set Azure Functions to caps
  • Adjust the code sample (Attention new dependency to twilio package):
const MessagingResponse = require('twilio').twiml.MessagingResponse;

...

const queryObject = qs.parse(req.body);

const twilioResponseMessage = new MessagingResponse();
twilioResponseMessage.message('You said: ' + queryObject.Body);

context.res = {
  status: 200,
  body: twilioResponseMessage.toString(),
  headers: { 'Content-Type': 'application/xml' },
  isRaw: true
};

lechnerc77 avatar Apr 09 '22 15:04 lechnerc77

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 24 '22 15:04 stale[bot]

@emsesc @ganning127 : Can we add the pinned label to the issues that should be done after the summer session so that they are ignored by the stale bot?

lechnerc77 avatar Apr 26 '22 06:04 lechnerc77