Using Java. Successfully placed outbound call and read call log. Tutorials have been great.
Using ringcentral-1.0.0-beta10.jar (where RestClient line 304 throws the exception)
Here is the code I ran (from your example pages):
public void setupWebHook() throws RestException, IOException{
RestClient rc = new RestClient(RINGCENTRAL_CLIENTID,
RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_SERVER);
rc.authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);
List<String> eventFilterList = new ArrayList<>();
eventFilterList.add("/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true&sipData=true");
eventFilterList.add("/restapi/v1.0/account/~/extension/~/message-store");
eventFilterList.add("/restapi/v1.0/account/~/extension/~/presence/line");
eventFilterList.add("/restapi/v1.0/account/~/extension");
CreateSubscriptionRequest createSubscriptionRequest = new CreateSubscriptionRequest()
.eventFilters(eventFilterList.toArray(new String[0]))
.deliveryMode( new NotificationDeliveryModeRequest()
.transportType("WebHook")
.address(WEBHOOK_ADDRESS)
);
SubscriptionInfo result = rc.restapi().subscription().post(createSubscriptionRequest);
System.out.println(result.id);
System.out.println("WebHook Ready");
I can see that my webhook was hit by RingCentral, and it replied with Validation-Token
an exception was thrown at the post line.
HTTP Response
=============
status code: 500
Server: nginx
Date: Sun, 10 Nov 2019 05:01:34 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
LocalHostInfo: 10.28.28.26__17239@sjc11-c01-csg01.devtest.ringcentral.com
RCRequestId: 2afd74ac-0377-11ea-90fa-005056bbcdd9
X-Rate-Limit-Group: medium
X-Rate-Limit-Limit: 40
X-Rate-Limit-Remaining: 39
X-Rate-Limit-Window: 60
RoutingKey: SJC11P01
{"errorCode":"CMN-203","message":"Internal Server Error","errors":[{"errorCode":"CMN-203","message":"Internal Server Error"}]}
at com.ringcentral.RestClient.request(RestClient.java:304)
at com.ringcentral.RestClient.request(RestClient.java:246)
at com.ringcentral.RestClient.post(RestClient.java:133)
at com.ringcentral.paths.restapi.subscription.Index.post(Index.kt:32)
at CallOutMain.setupWebHook(CallOutMain.java:67)
at CallOutMain.main(CallOutMain.java:27)
If you check here : https://ringcentral-faq.readthedocs.io/en/latest/errors/
and https://developers.ringcentral.com/api-reference/Error-Codes
CMN-203 | Internal Server Error |
is due to "The server failed to run an apparently valid request "
Could you please submit a support ticket with the necessary information like (API Request and API response including headers preferably)?
Meanwhile, could you try subscribing to Extension and Message Store Event Filters and test the results?
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