question

Matthew Skilton avatar image
Matthew Skilton asked Matthew Skilton commented

Sending SMS Status Changes and SMS Inbound

Is there a way to get notifications of status changes of outbound SMS. As in we have sent an SMS through the API.. can we subscride to a status change event, becuase initially what you get when yuou create the message is 'Queued' is there a way to register (subscribe) to an event/notification that lets you know that the message sent. Looking at the Notifications Types, is it to do with Message Event? as in I would have to subscribe to /restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store?type=SMS&direction=Outbound

to receive status changes on sent messages? would that be correct.

and for Inbound SMS the event is

/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store/instant?type=SMS

I'm confused as to why inbound SMS wouldn't just be (whats the difference between Message Event and Instant Message Event?)

/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store?type=SMS&direction=Inbound

and ultimately if I would like to subscribe to any Outbound SMS status changes and any Inbound SMS, can I just do one subscription and 2 event Filters? something like


POST .../restapi/v1.0/subscription
{
"eventFilters": [

"/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store?type=SMS&direction=Inbound",

"/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store?type=SMS&direction=Outbound",

],
"deliveryMode": {
"transportType": "WebHook"
}
}


rest apisending smssubscription
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 Phong Vu commented

The event is for getting notified when something has changed in the user message store such as an inbound message readStatus is set "Read", a message is deleted, an outbound message messageStatus is changed etc. You will only get the message id in the payload and you will have to call the message store using the id to get the changed value.

While the /instant?type=SMS is purely for receiving inbound text message with the text and other properties of the message.

6 comments
1 |3000

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

Matthew Skilton avatar image Matthew Skilton commented ·

I don't mind too much that the message-store event type just returns the Message id,

I can then make a call to get the full details, but I can't see any mention of a message id in the docs here :

Office API Reference | RingCentral Developers


So I'm a bit confused, just seems to return counts? not message ids?

It has uuid notificationId/ownerId/subscriptionId/accountid/extensionid but no mention of messageId/s

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Matthew Skilton commented ·

A sample of a new message change to the message store

{
  "uuid": "3899647630666415164",
  "event": "/restapi/v1.0/account/80964xxxx/extension/6228832xxxx/message-store",
  "timestamp": "2023-02-14T05:09:15.241Z",
  "subscriptionId": "5a1075c5-6a20-47de-aec2-f88c47688958",
  "ownerId": "6228832xxxx",
  "body": {
    "accountId": 80964xxxx,
    "extensionId": 6228832xxxx,
    "lastUpdated": "2023-02-14T05:09:08.435Z",
    "changes": [
      {
        "type": "SMS",
        "newCount": 1,
        "updatedCount": 0,
        "newMessageIds": [
          1908413703016
        ]
      }
    ]
  }
}
0 Likes 0 ·
Matthew Skilton avatar image Matthew Skilton Phong Vu ♦♦ commented ·

wow so there is no mention of `newMessageIds` in the docs at all. Does that mean there is an `updateMessageIds` and `deletedMessageIds` array as well? Would be useful if the documentation actually explained this a bit better

0 Likes 0 ·
Show more comments
Matthew Skilton avatar image
Matthew Skilton answered Matthew Skilton commented

How long do apps typically take to get approved? We've been waiting a few days. Any chance of helping us to get it moving along :) Would like to get some real users up and running.

Thanks!


8 comments
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 ♦♦ commented ·

App client id or app name?

0 Likes 0 ·
Matthew Skilton avatar image Matthew Skilton Phong Vu ♦♦ commented ·
  • Appointment Reminder
0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Matthew Skilton commented ·

Approved!

0 Likes 0 ·
Show more comments

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