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
Create webhook for receiving calls using Javascript sdk
Tags: sdk
Dec 11, 2017 at 6:22am   •   3 replies  •  0 likes
robert-raj

HI all try create webhook for receiving calls using javascript sdk, but i got Error: Parameter [request] value is invalid

This is my following code

 var _eventFilters = [];
        _eventFilters.push('/restapi/v1.0/account/~/extension/' + 101 + '/presence?detailedTelephonyState=true&aggregated=true')

  rcsdk.platform()
            .send({
  
                method: 'POST',                  url: '/subscription',                  eventFilters: _eventFilters,                  deliveryMode: {                      "transportType": "WebHook",                      "encryption": false,                      "address": "https://33d7f758.ngrok.io/RingCentralTest/RcTest";                  }              })              .then(function (apiResponse) {                  console.log(apiResponse.json())                })              .catch(function (e) {                    console.log(e)              });  

Thanks in Advance

3 Answers
answered on Dec 11, 2017 at 9:33pm  
After applying the extension id getting the error

 Error: Parameter [request] value is invalid
    at Client.<anonymous> (/var/www/html/commusoft-app/node_modules/ringcentral/src/http/Client.js:62)
    at <anonymous>

 0
answered on Dec 11, 2017 at 3:35pm  
101 is extension number. Extension ID is expected.

 1
answered on Dec 11, 2017 at 11:27am  
Hi Robert,

The event filters that you have passed for creating the subscription via WebHook is wrong. 

Kindly use the below code and try the API call again:

var _eventFilters = [];
        _eventFilters.push('/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true&aggregated=true')

When you pass the event filters for an extension you can either provide :

1.) (~) which would refer to the extension authorized by.
2.) Provide the extensionID for an extension, which you can look up using the below API Endpoint
      Get Extensions List
      GET /v1.0/account/{accountId}/extension/
 



 1



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