Skip to main content

At the first, I received a response message like this:

{
  "message": "Bad Request",
  "errors": :]
}

and this is my request payload:

{
"from":{"phoneNumber":"+19292561865"},
"to":;{"phoneNumber":"+14707816202"}],
"text":"mms testing",
"attachments":;"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQECAgMCAgICAgQDAwIDBQQFBQUEBAQFBgcGBQUHBgQEBgkGBwgICAgIBQYJCgkICgcICAj..."]
}
Content-type: multipart/mixed

I found out that I can use MmsSender with my account, too.

I, therefore, wonder whether I'm missing something or if there are any permissions I need to specify but haven't?

Content-Type:
multipart/mixed

What programming language are you writing your code? Why don't you use one of the RingCentral SDKs?

Check this out to see how to use an SDK to send MMS messages. If you are using CURL, see the following sample code:

curl -X POST 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/mms' 
-H 'Accept: application/json'
-H 'Authorization: Bearer <valid-access-token'
-F 'request={"from":{"phoneNumber":"+1312xxxyyyy"},"to":[{"phoneNumber":"+1650xxxyyyy"}],"text":"By CURLing"};type=application/json'
-F 'attachment=@test3.png;type=image/png'

I got confused by the API Send MMS described attachments that are arrays and must be base64. So, the first question is, are array attachments and single attachments both correct?

And second, I want to try to use Postman to send MMS with data like down below. Will it work?

{
  "from":{"phoneNumber":"+1929xxxyyyy"},
  "to":;{"phoneNumber":"+1470xxxyyyy"}], 
  "text":"mms testing",
  "attachments":u"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQECAgMCAgICAgQDAwIDBQQFBQUEBAQFBgcGBQUHBgQEBgkGBwgICAgIBQYJCgkICgcICAj..."]
}
  1. Content-type: multipart/form-data

If not, could you suggest to me how to convert the upper JSON to Form-data in Postman or any way that can run with Postman?

Thanks


I did it. After checking out how the SDK works, I looked at my code and adjusted it using Blob with content-type=application/json. Then, the magic occurred.

Thanks

1657642961238.png

1657642850582.png


I could get it to send the mms with text type files, but when I send images, I can only send a string, not a byte array. when I send a byte array it tells me that the attachment body is missing.


Reply