Skip to main content

Hi there.

Newbie here, so please be kind :)

Is it theoretically possible to setup a phone number with an associated process in place to receive SMS messages that contain attachments, and to use the sending mobile number to automatically save those attachments to a specific local folder related to said sending number?

Thanks!

I don't really understand your question. Can you explain in a use case scenario?


You bet.

Let's say that I had a project management app that multiple users subscribed to and as part of that app's functionality I wanted to allow my users to send project photos from "the field" as SMS messages from their phones and have those project photos be automatically associated to their project in the PM software. If I had a database of known, identified sending phone numbers, I'd like to receive these SMS messages at one common number for all users and then, based on a match on the sending phone number, automatically save the project photo and associate it to the appropriate user.

Does that help?

Thanks.


Thanks for the clarification! Not really clear but here is the solution based on what I guess.

1. You need to have an extension with a direct number, which is for receiving SMS/MMS from users on "the field".

2. You build an app that can receive those messages from the users on "the field". Authenticate your app with login credentials of the user extension who owns the direct phone number (mentioned in 1.). Then you need to subscribe for the /instant?type=SMS event notification in order to get notified when an incoming message arrives. Here is the sample of an MMS message event payload. See comments inline.

{
"uuid": "5089369288242083258",
"event": "/restapi/v1.0/account/80964xxxx/extension/6249888xxxx/message-store/instant?type=SMS",
"timestamp": "2022-08-31T03:14:20.085Z",
"subscriptionId": "2ba333cd-97ba-47d9-9ce0-5166b2525c74",
"ownerId": "6249888xxxx",
"body": {
"id": "1795801671016",
"to": [
     {

        // This is the direct phone number of the extension mentioned in 1.
       "phoneNumber": "+1209248xxxx",
       "name": "Manager",
       "location": "Modesto, CA",
       "target": true
     }
   ]
,
"from": {
      // This is the phone number of a user on "the field", use this to identify who sent this message
     "phoneNumber": "+1209284xxxx",
     "name": "Agent 120",
     "location": "Modesto, CA",
     "phoneNumberInfo": {
       "countryCode": "1",
       "nationalDestinationCode": "209",
       "subscriberNumber": "2845360"
     }
   }
,
"type": "SMS",
"creationTime": "2022-08-31T03:14:20.080Z",
"lastModifiedTime": "2022-08-31T03:14:20.080Z",
"readStatus": "Unread",
"priority": "Normal",
"attachments": n
     {
       "id": "1795801671016",
       "type": "Text",
       "contentType": "text/plain"
     },
     {
       "id": "50708686xxxx",

        // This is the media attachment info. Use the uri with a valid access token to access/download the media content
       "type": "MmsAttachment",
       "uri": "https://media.ringcentral.com/restapi/v1.0/account/80964xxxx/extension/6249888xxxx/message-store/1795801671016/content/507086866016",
       "contentType": "image/png",
       "size": 16254
     }
   ]
,
"direction": "Inbound",
"availability": "Alive",
    // This is the text message
"subject": "Hello there",
"messageStatus": "Received",
"conversation": {
"id": "6288164535269838686"
}
}
}

Parse the event payload and use the data to add to your database.


Thanks @Phong Vu. Much appreciated. Certainly seems promising.

I've also reached out to RingCentral Sales as I'm currently terribly naive on them and their offering, related pricing, etc., but if anyone here cares to offer any insight I'm all ears! I'm a bit more familiar with how this might work with Twilio, where if someone sends us an SMS with an attachment, we can have a webhook attached to our recipient phone number whereby we could access that attachment (i.e. save it somewhere specific "locally") based on the sender's phone number. Would this sort of be the same with RingCentral? Could the sample JSON that Phong posted above be automatically sent via a webhook based on the receipt of an SMS at our recipient phone number? We could certainly build a webpage to consume and parse the JSON, which could allow us to download attachments and write to our database as appropriate.

Thanks!


Check the subscription API reference to learn more. We support PubNub and WebHooks transport methods.



A Sales Development Rep @ RingCentral said that what I wanted to do would be "...wildly complex but is potentially doable." I'm certainly not interested in anything wildly complex as that also typically means wildly expensive, but unless I'm underthinking this somehow, it sure doesn't seem that complex to me.

I'd like to be able to assign a webhook to a recipient phone number that would automatically fire off whenever an SMS was received at that number. I'd like that webhook to contain the details of the SMS, including the message itself, the sending mobile number, as well as download url's for any attachments (typically photos). That's it really. What I do or don't do on my end with the details parsed from the webhook is then up to me and not part of the SMS solution that I need to procure.

Am I underthinking this? If so, what part of what I'm asking of an SMS solution is the "stumbling block"?

Thanks!


This is confusing me. Don't bring what a sales rep told you to this discussion. Instead, ask your technical questions then I will answer. I don't know why you go circle again talking about the same thing I already explained above. You need to get notified and access to the message content and metadata and that was shown in the payload example above.


Reply