MMS and Media
Send picture messages by including a mediaUrl in your request. The API downloads the file, validates it, and attaches it to the message automatically.
How it works
- You provide a
mediaUrlpointing to a publicly accessible file - The API downloads the file and validates its type and size
- The file is attached and the message is sent as MMS
You can include both body and mediaUrl to send an MMS with text, or omit body to send media only.
Supported media types
| MIME Type | Extension |
|---|---|
image/jpeg | .jpg, .jpeg |
image/png | .png |
image/gif | .gif |
video/mp4 | .mp4 |
video/mpeg | .mpeg |
audio/mpeg | .mp3 |
application/pdf | |
text/vcard, text/x-vcard | .vcf |
Size limits
The maximum file size is 1 MB. Files exceeding this limit are rejected with error code 33014.
Example
curl -X POST https://platform.textingline.com/api/v1/messaging/message \
-u "your_key_id:your_key_secret" \
-H "Content-Type: application/json" \
-d '{
"to": "+18005551234",
"from": "+18005559876",
"body": "Here is your receipt",
"mediaUrl": "https://example.com/receipts/order-12345.pdf"
}'Media URL requirements
The mediaUrl must:
- Use
http://orhttps://protocol - Be publicly accessible (no authentication required)
- Pass security validation (internal/private IPs are blocked)
- Resolve to a supported MIME type
Credits
MMS messages consume 1 MMS credits and 1 SMS credits(1 message + 1 carrier lookup if needed).
Common errors
| Code | Description |
|---|---|
33014 | Media file exceeds 1 MB size limit |
33015 | MIME type is not supported |
33017 | Failed to download the file from the URL |
33018 | Media URL failed security validation |
See Error Codes for the full reference.
Updated 3 days ago