voipms-sms-client
voipms-sms-client copied to clipboard
Add MMS support
MMS on VoIP.ms to roll out for beta testing soon. https://www.dslreports.com/forum/r32442917- July 9
A major enhancement for the todo list.
When they add API access for MMS, feel free to let me know and I'll implement support for it!
Suggest reopening because it is now available. https://wiki.voip.ms/article/MMS
Feel free to reopen once it appears on this page: https://www.voip.ms/m/apidocs.php
MMS is now available in the API doccumentation. Request to reopen.
https://www.voip.ms/m/apidocs.php
Feel free to reopen once it appears on this page: https://www.voip.ms/m/apidocs.php
I see 27 instances of MMS on the page including getMMS and getMediaMMS
Feel free to reopen once it appears on this page: https://www.voip.ms/m/apidocs.php
I see 27 instances of MMS on the page including getMMS and getMediaMMS
MMS has just been added to the API documentation in the last hour or so, and was not there when the previous comments were made 2 hours ago.
VoIP.ms had sent an email indicating API availability just prior to my earliest comment and I had incorrectly assumed that the doc's were up at that time.
Feel free to reopen once it appears on this page: https://www.voip.ms/m/apidocs.php
I see 27 instances of MMS on the page including getMMS and getMediaMMS
MMS has just been added to the API documentation in the last hour or so, and was not there when the previous comments were made 2 hours ago.
This is correct. It was added to the documentation about 5 minutes ago. I told support it wasn't available and they said they'd add it to be viewable by all beta testers shortly :).
@michaelkourlas Maybe after this is implimented, VoIP.ms SMS app can be renamed to something like VoIP.ms Chat or VoIP.ms Messages ☺️
The MMS documentation has been removed from https://www.voip.ms/m/apidocs.php.
I'm still seeing it...
Perhaps they're showing different versions of the documentation to different people. I'm sure it's not my cache -- I tested it with a different browser I never use.
Can you provide me with a copy of the docs?
Sure can.
I've also opened a ticket with them to ask about this.
Might be part of the beta rollout?
The API itself doesn't make much sense to me. We have to supply a URI to the image when sending an MMS? Why can't we just provide the base64-encoded image directly, the same way that it is returned to us using getMediaMMS?
does a data uri work? https://en.wikipedia.org/wiki/Data_URI_scheme
That would be acceptable, but I can't determine that at the moment -- the API simply returns mms_failed
regardless of whether I use a data URI or a normal URI.
Either the API isn't ready for public use or the functionality isn't enabled for my account.
I'm betting that if you're not seeing the API documentation that you're not included in the beta for some reason.
I believe that you need to join their Beta Access Program in order to use the API and see the documentation, which can be done here: https://voip.ms/m/beta.php
Here are my findings. Hope it will help.
API Access and Doc
- https://www.voip.ms/m/apidocs.php
- https://www.voip.ms/m/api.php
I had to:
- Join beta program
- set username / password
- activate api access
- configure my DID:
Note
Email option is nice because any MMS received will be redirected also to your email with the media inside. So even of the app is still not supported MMS, this option allows VOIP.MS users to still be able to receive MMS.
Get sent and received MMS
HTTP GET
https://voip.ms/api/v1/rest.php?api_username=<API_USERNAME>&api_password=<API_PASSWORD>&content_type=json&method=getMMS&from=2020-07-04
RESPONSE BODY
{
"status": "success",
"sms": [
{
"id": "15601",
"date": "2020-07-04 16:31:30",
"type": "0",
"did": "5141234567",
"contact": "4381234567",
"message": "",
"col_media1": "https://voip.ms/media.php?map=MTU5Mzg5NDY4OTVmMDBlNzIxY2UzMGQ1ZjAwZTcyMWNlMzVmfDF8aW1hZ2UvcG5nfE1NUw==",
"col_media2": "",
"col_media3": ""
},
{
"id": "15589",
"date": "2020-07-04 16:11:36",
"type": "0",
"did": "5141234567",
"contact": "4381234567",
"message": "",
"col_media1": "https://voip.ms/media.php?map=MTU5Mzg5MzQ5NTVmMDBlMjc3NGM3Nzk1ZjAwZTI3NzRjN2IwfDF8aW1hZ2UvanBlZ3xNTVM=",
"col_media2": "",
"col_media3": ""
},
{
"id": "15586",
"date": "2020-07-04 16:04:06",
"type": "0",
"did": "5141234567",
"contact": "4381234567",
"message": "",
"col_media1": "",
"col_media2": "",
"col_media3": ""
},
{
"id": "15555",
"date": "2020-07-04 15:26:23",
"type": "1",
"did": "5141234567",
"contact": "7787641209",
"message": "dGVzdCBtZXNzYWdl",
"col_media1": "https://voip.ms/media.php?map=MTU5Mzg5MDc4MzVmMDBkN2RmYzYxMWM1ZjAwZDdkZmM2MTU1fDF8aW1hZ2UvanBlZ3xNTVM=",
"col_media2": "",
"col_media3": ""
},
{
"id": "15368",
"date": "2020-07-04 10:47:14",
"type": "1",
"did": "5141234567",
"contact": "4381234567",
"message": "Test",
"col_media1": "https://voip.ms/media.php?map=MTU5Mzg5MDc4MzVmMDBkN2RmYzYxMWM1ZjAwZDdkZmM2MTU1fDF8aW1hZ2UvanBlZ3xNTVM=",
"col_media2": "",
"col_media3": ""
}
]
}
Notes and issues:
- Message
15368
has been sent through Bell. - Message
15555
has been sent through ClickSend. ClickSend sends message as base64 (which is ok) but Voip.MS does not seem to support this encoding type. So it is currently possible to receive messages either plain text or base64 encoded messages and I saw nothing yet in the API to distinguish betweeen both.dGVzdCBtZXNzYWdl
is the B64 encoded version oftest message
. - Message
15586
is a MMS message sent through Voip.MS. There is a bug: Voip.MS is not keeping the message text. - Message
15589
is a MMS message sent through Voip.MS with a link to an image - Message
15601
is a MMS message sent through Voip.MS with a data url. Voip.MS is accepting the request (success) but the link it is generating for the image is wrong and the receiver receives an invalid / inexisting image
Sending MMS
HTTP GET
Just a message:
https://voip.ms/api/v1/rest.php?api_username=<API_USERNAME>&api_password=<API_PASSWORD>&content_type=json&method=sendMMS&did=5146604287&dst=4389901711&message=Hello%20World
Message and a media link
https://voip.ms/api/v1/rest.php?api_username=<API_USERNAME>&api_password=<API_PASSWORD>&content_type=json&method=sendMMS&did=5146604287&dst=4389901711&message=Hello%20World&media1=https://voip.ms/media.php?map=MTU5Mzg5MDc4MzVmMDBkN2RmYzYxMWM1ZjAwZDdkZmM2MTU1fDF8aW1hZ2UvanBlZ3xNTVM=
Message and a media data url
https://voip.ms/api/v1/rest.php?api_username=<API_USERNAME>&api_password=<API_PASSWORD>&content_type=json&method=sendMMS&did=5146604287&dst=4389901711&message=Hello%20World&media1=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAB+FBMVEUAAAA/mUPidDHiLi5Cn0XkNTPmeUrkdUg/m0Q0pEfcpSbwaVdKskg+lUP4zA/iLi3msSHkOjVAmETdJSjtYFE/lkPnRj3sWUs8kkLeqCVIq0fxvhXqUkbVmSjwa1n1yBLepyX1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u31H8jF1RHiTKtWYeHxUvq3bn0pyjCRaiRU6aDO+gb3aEfEeVNsDgm8zzLy9egPa7Qt8TSJdwhjplk06HH43ZNJ3s91KKCHQ5x4sw1fRGYDZ0n1L4FKb9/BP5JLYxToheoFCVxz57PPS8UhhEpLBVeAAAAAElFTkSuQmCC
RESPONSE BODY
{
"status": "success",
"mms": 15601
}
Notes and issues:
- I tried HTTP POST (
curl -X POST https://voip.ms/api/v1/rest.php -d field1=value1 -d field2=value2 ...
) but I get a SOAP error as answer. I don't know how to send these request through a normal HTTP POST (either with a form encoded payload or json payload) and I don't even know if this is supported through the REST API. - HTTP GET URL is length limited: this is impossible to send a 500x500px image base64-encoded
- Not supporting the data url is really limiting because it requires to first upload somewhere the media
Thanks -- the URI length limits may require the app to use SOAP in this case.
Thanks -- the URI length limits may require the app to use SOAP in this case.
Yes... This is sad 👎
I have contacted VOIP.MS support to get someone from their team follow this ticket. They should ideally add support for POST with the REST API.
Also, another problem is the storage of the media files: they only support links at the moment. Not event data urls. So that means any app would need to either pre-upload the media somewhere publicly accessible, or only accept public links (which can be verified easily when including a media I think, by doing a HEAD request on the media url)
My implementation is not going to upload files to any server - I don't think that's practical. I'll be using either data URIs (if they extend the maximum URI length) or more likely SOAP.
I unsubscribed from the beta and was still able to send an MMS using the API, so that's good. Looks like they fixed that issue.
Yeah, it was advertised in the most recent VOIP.ms newsletter, so one would assume it has been rolled out to all users.
So bad news -- sending an MMS doesn't actually seem to work, notwithstanding the success
return code.
I have sent both a base64 encoded image and a publicly hosted image to both a VoIP.ms number and my carrier number. No image appears in either the VoIP.ms SMS message centre or on my own cell phone.
@michaelkourlas : like i said in my previous post, data URI are not working. The generated link by voip.ms points to an empty/broken image. I have asked them to get a developer follow this ticket so that they can fix.
Sending a mms message with text plus a media link parameter from my did to a Canadian (Bell) number worked for me. I wasn't able to send a mms to myself though (same number In both did
and dst
Even using a link to a hosted image didn't work for me. What do you mean by a "media link parameter" -- an image hosted by VoIP.ms and uploaded through the portal, I guess?
I have multiple DIDs for testing. I was able to send the message component from one DID to the other, but again no image.