TwilioMediaParams
Defined in: lib/webhook/twilio-webhook.payloads.ts:103
Media attached to an inbound message.
Twilio numbers the keys from zero (MediaUrl0, MediaContentType0,
MediaUrl1, and so on) and NumMedia says how many there are. Because it
arrives as a string, parse it before looping.
Example
Section titled “Example”const count = Number(payload.NumMedia ?? 0);
for (let index = 0; index < count; index += 1) { const url = payload[`MediaUrl${index}`]; const contentType = payload[`MediaContentType${index}`];}Extended by
Section titled “Extended by”Indexable
Section titled “Indexable”[mediaUrl: `MediaUrl${number}`]: string | undefined[mediaContentType: `MediaContentType${number}`]: string | undefinedProperties
Section titled “Properties”| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
NumMedia? |
readonly |
string |
How many media items are attached. A string, e.g. '2'. |
lib/webhook/twilio-webhook.payloads.ts:105 |