question

Rick Smith avatar image
Rick Smith asked Phong Vu edited

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)

rest api
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 Phong Vu commented

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 Phong Vu edited

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 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys