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?
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 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
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":["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQECAgMCAgICAgQDAwIDBQQFBQUEBAQFBgcGBQUHBgQEBgkGBwgICAgIBQYJCgkICgcICAj..."] }
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
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder