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)