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
SDK error message response unexpected
Tags: sdk
Jul 27, 2015 at 4:53pm   •   1 replies  •  0 likes
dl-mozart

This is more of a feedback than a problem report.


I've been working on a Web app that sends SMS using your PHP SDK. However, I noticed that the way an error comes back to me is a bit unexpected.


When I forget to include SMS text, I would expect either 1) the SMS to be sent with empty body or 2) the error be included in the '$response' response per your suggested code here: https://github.com/ringcentral/ringcentral-php


But instead, I get a "Fata Error" response that overwrites my calling PHP, like this:


"Fatal error: Uncaught exception 'Exception' with message 'Response has unsuccessful status' in /home/mozartdl57/acmemedical.org/lib/RC/http/Request.php:171 Stack trace: #0 /home/mozartdl67/acmemedical.org/lib/RC/platform/Platform.php(221): RC\http\Request->send() #1 /home/mozartdl67/acmemedical.org/lib/RC/platform/Platform.php(264): RC\platform\Platform->apiCall(Object(RC\http\Request)) #2 /home/mozartdl67/acmemedical.org/oncall_response.php(70): RC\platform\Platform->post('/account/~/exte...', NULL, Array) #3 {main} Next exception 'RC\http\HttpException' with message 'Parameter [text] value is invalid' in /home/mozartdl67/acmemedical.org/lib/RC/http/Request.php:178 Stack trace: #0 /home/mozartdl67/acmemedical.org/lib/RC/platform/Platform.php(221): RC\http\Request->send() #1 /home/mozartdl67/acmemedical.org/lib/RC/platform/Platform.php(264): RC\platform\Platform->apiCall(Object(RC\http\Request)) #2 /home/mozartdl67/acmemedical.org/oncall_response.php(70): RC\platform\Platform->post('/account/~/exte...', NULL, Array) #3 {main} thrown in/home/mozartdl67/acmemedical.org/lib/RC/http/Request.php on line 178"

This is really hard to decipher and it took me a while to notice the "Parameter [text] value is invalid" buried in the above.


Just a feedback; otherwise your APIs and SDKs worked great.

1 Answer
answered on Aug 3, 2015 at 3:35pm  
In upcoming version 0.6.0 error message in HttpException contains parsed message from API.

In previous versions API error may be viewed by accessing getResponse() function of HttpException.

 0



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