Roman Rozum avatar image
Roman Rozum asked Phong Vu commented

400 bad request on send MMS


I'm trying to send a mms-message using

I filled all the data in ".env". Here all correctly (I have goes send sms)

$ php send-sms.php
Message sent. Message delivery status: Queued

The message does reach (I check Glip chat)

But mms message cannot be sent. Get the error:

$ php send-mms.php
Expected HTTP Error: 400 Bad Request (and additional error happened during JSON parse: Response is not JSON)

And moreover, if we consider the response in more detail, it contains only the text of the error "Bad request" and nothing else.

I tried sending a very small file (~100 bytes). And it works!

Message sent. Message delivery status: Queued

I don't understand how it should work and how I should use it in my app. I think it's some kind of bug and it should not be. Tell me, what should I do with it?

rest api
1 |3000

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

You said you send a very small file and it works, that means that the code is working as expected. I doubt that you try to send some big file or unsupported content. So check out the MMS capabilities below.

RingCentral supported MMS content types

  • Images: jpg/jpeg, png, gif, bmp, tif/tiff, svg
  • Videos: 3gp, mp4, mpeg, flv, wmv, mov
  • Audio: mp3
  • Files: vcf/vcard, zip, rtf, html

Attachment size limit

The maximum size for MMS is carrier-dependent and normally around 1.2MB to 1.4MB.

You can send multiple attachments in a single MMS message. But the total size of attachments should not exceed the size limit above!

Also, if you want to see more from the error, change or print whatever from the exception you want to see within this block:

}catch (\RingCentral\SDK\Http\ApiException $e) {
  print 'Expected HTTP Error: ' . $e->getMessage() . PHP_EOL;
1 |3000

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

Roman Rozum avatar image
Roman Rozum answered Phong Vu commented

@Phong Vu

I am sending a jpg which is attached in the project (test.jpg). It has a size of 16.1 KB.

I know about the ability to get additional information from the Exception. But the $e does not contain anything except "code" - 400 and "message" - Bad Request


Prints this object:

object(GuzzleHttp\Psr7\Response)#45 (6) {
  string(11) "Bad Request"
  array(4) {
    array(1) {
      string(5) "nginx"
    array(1) {
      string(29) "Thu, 19 Dec 2019 16:45:36 GMT"
    array(1) {
      string(1) "0"
    array(1) {
      string(5) "close"
  array(4) {
    string(6) "Server"
    string(4) "Date"
    string(14) "Content-Length"
    string(10) "Connection"
  string(3) "1.1"
  object(GuzzleHttp\Psr7\Stream)#43 (7) {
    resource(75) of type (stream)
    string(10) "php://temp"
    array(0) {

1576774019185.png (215.9 KiB)
1 comment
1 |3000

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

This code works well for me and many others. And also you said it works for a small attachment. So I am not sure what is different in your environment. Have you tried with a different attachments?

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