News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Outbound Messages - Instant Message Event
Tags: getting started
Oct 14, 2021 at 10:49am   •   3 replies  •  0 likes
Pau Rodriguez

Is there a way to have outbound messages with the Instant Message Event? The payload example has a direction, but it seems this is only working for inbound.

If this is not the appropriate webhook, can someone point me to the correct event to have instant outbound messages?


3 Answers
answered on Feb 16, 2023 at 8:58am  

Here is how you can get notified for both inbound and outbound new text message events

var eventFilters = ['/restapi/v1.0/account/~/extension/~/message-store?type=SMS']

// E.x using PubNub notification
subscription.on(subscription.events.notification, async function(msg) {
    for (var message of msg.body.changes){
      for (var msgId of message.newMessageIds){
        await readMessageDetail(msgId)
      }
    }
});

async function readMessageDetail(msgId){
  try{
    var resp = await platform.get(`/restapi/v1.0/account/~/extension/~/message-store/${msgId}`)
    var jsonObj = await resp.json()
    console.log(JSON.stringify(jsonObj)
  }catch(e){
    console.log(e.message)
  }
}

Alternative way to get inbound text message with message detailed in the event body, and, you can subscribe for separate events as follows:

'/restapi/v1.0/account/~/extension/244609004/message-store/instant?type=SMS'
'/restapi/v1.0/account/~/extension/233723004/message-store?direction=Outbound&type=SMS',

 0
answered on Oct 19, 2021 at 8:57am  

Hi Phong,

We were trying to get all the SMS messages to ingest those in another system, we were taking a look, and we decide to use that event, as the payload had direction as a parameter, we were thinking Inbound and Outbound should be the values, but it seems only works for Inbound. After that, we decided to get Inbound with that event and Outbound with message-store?type=SMS&direction=Outbound and then get the Message ID and do an API call to getMessges to have the text of the messages + from and to.

Do you know, for instant message events if there is another value for direction?


Thanks



 0
answered on Oct 15, 2021 at 7:23am  

Unfortunately, outbound message notification does not include the message payload, nor the "from" and "to" info. What is your use case?


 0
on Feb 16, 2023 at 5:07am   •  0 likes

Hi Mr. @Phong Vu ,

We are only receiving the webhook for inbound messages and there is no webhook call for outbound messages. Could you please suggest if there is a way to listen to outbound message events?


Any help is highly appreciated.


Thanks!

on Feb 16, 2023 at 5:43am   •  0 likes

The only way we know how to do this is by running a job that checks to see if the message is sent ever minute. Is there not a better way? That solution is not ideal.

We are building a CRM system where we send and receive texts to our clients from the system. We have no problems receiving the texts. Our problem is that we can't confirm if something is sent without running a job every minute.

Please advise us on the best way to proceed. If we have to run the job ever minute, we can. We just want a better way if it is possible. Thank you in advance.



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us