question

Rick McGrath avatar image
Rick McGrath asked Pilgrim Oil Group answered

How do I resolve a HTTP Code 500 with CMN-203 Internal Server Error when subscribing to WebHook?

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)


rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Khadhar Koneti avatar image
Khadhar Koneti answered Rick McGrath commented

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?

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Re-running this morning in order to capture the header details ... It works. No change to my code. Thank you for prompting me to capture more details.

0 Likes 0 ·
Anirban avatar image
Anirban answered

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 "

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Pilgrim Oil Group avatar image
Pilgrim Oil Group answered

When I'm on a phone call can I take notes and have them attach to that number? So when the customer calls again all the information will populate on the screen.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys