question

Rick Smith avatar image
Rick Smith asked ·

Unable to send MMS in Python

So I can send SMS just fine when I try to send MMS i get an parameter [] is invalid exception

where _img is a link to an img file. Can't seem to find any documentation on this at all...

params = {'from': {'phoneNumber' : number}, 'to':[{'phoneNumber' : toNumber }], 'text' : message}, _img
resp = platform.post('/restapi/v1.0/account/~/extension/~/sms', params)

mms send in python
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered ·

Even your snippet code is broken so I don't know what is the exact parameter syntax do you use.

Anyway, here is the sample code for sending MMS using Python.

2 comments
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks Phong!

It's unusual that you say it's broken, It works for me, maybe because it's incomplete?



0 Likes 0 ·

I meant it is incorrect/incomplete.

params = {'from': {'phoneNumber' : number}, 'to':[{'phoneNumber' : toNumber }], 'text' : message}, _img
resp = platform.post('/restapi/v1.0/account/~/extension/~/sms', params)

The _img?

0 Likes 0 ·
Rick Smith avatar image
Rick Smith answered ·

Anyway, I tried your code, I get 'attachement is not defined at builder.add(attachment)?

2 comments
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Ok, I got one part fixed, but now I get 'attachment body is empty' Tried puting in the full path to the image , everything I can think of, what am I missing?

0 Likes 0 ·

Is the image file located under the same folder?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.