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
I receive a CMN-101 error when creating a subscription
Tags: rest api
May 4, 2022 at 9:26pm   •   3 replies  •  0 likes
Smit Shah

I am getting a CMN-101 error

Request:

 Method: POST, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/subscription', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
 {
   X-User-Agent: Unknown/0.0.1 RingCentral.Net/5.16.0
   Authorization: Bearer REMOVED
   Content-Type: application/json; charset=utf-8
   Content-Length: 343
 }
 Content: 

Response:

 StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
 {
   Transfer-Encoding: chunked
   Connection: keep-alive
   LocalHostInfo: 10.28.28.28__13194@sjc11-c01-csg03.devtest.ringcentral.com
   RCRequestId: b862145a-cc2a-11ec-ac48-005056bb9532
   X-ERROR-ID: b862145a-cc2a-11ec-ac48-005056bb9532
   X-Rate-Limit-Group: medium
   X-Rate-Limit-Limit: 40
   X-Rate-Limit-Remaining: 39
   X-Rate-Limit-Window: 60
   RoutingKey: SJC12P01
   Date: Thu, 05 May 2022 04:20:39 GMT
   Server: nginx
   Content-Type: application/json
 }
 Content: {"errorCode":"InvalidParameter","message":"Parameter [deliveryMode.verificationToken] value is invalid","errors":[{"errorCode":"CMN-101","message":"Parameter [deliveryMode.verificationToken] value is invalid","parameterName":"deliveryMode.verificationToken"}],"parameterName":"deliveryMode.verificationToken"}

Based on the documentation provided at the URL below there is literally no information on what the value requirements are:

https://developers.ringcentral.com/api-reference/Subscriptions/createSubscription

on May 4, 2022 at 9:38pm   •  0 likes

If I remove the VerificationToken I am getting a SUB-520 Error

Content: {"errorCode":"SUB-520","message":"Validation Token is not returned","errors":[{"errorCode":"SUB-520","message":"Validation Token is not returned"}]}

on May 4, 2022 at 11:04pm   •  0 likes

@Smit Shah Could you also share the request body along with the question? The error messages suggest the issue was with the request, looking at the request body would be really helpful

P.S - The API reference is to see the API contract with some basic information. The developer guide has more details on things like use cases, what fields are used etc. Information on verification token, validation token and why they are used is mentioned here already https://developers.ringcentral.com/guide/notifications/webhooks/receiving

on May 5, 2022 at 6:42am   •  0 likes

I am not sure how I can get a coyp of the raw request. Here is what My code looks like

{

  NotificationDeliveryModeRequest nDM = new NotificationDeliveryModeRequest();
  nDM.transportType = "WebHook";
  nDM.address = "https://app.example.com/RCNotify.aspx"; // ?CID=" & oCustomer.CustomerId.ToString
  nDM.encryption = false;
  // nDM.verificationToken = "C" & oCustomer.CustomerId.ToString & "ID"
  nDM.verificationToken = "C" + oCustomer.CustomerNumber + "ID";
  // nDM.verificationToken = "C" & CleanAlphaNumericOnly(oCustomer.CustomerId.ToString) & "ID"
  List EventFiltersList = new List();
  EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/message-store");
  EventFiltersList.Add("/restapi/v1.0/account/~/telephony/sessions");
  // EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/")
  // EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/")
  CreateSubscriptionRequest nSMSReq = new CreateSubscriptionRequest();
  nSMSReq.deliveryMode = nDM;
  nSMSReq.expiresIn = 630720000;
  nSMSReq.eventFilters = EventFiltersList.ToArray();
  var SubscriptionResult = RC.Restapi.Subscription.Post(nSMSReq).Result;
  mylog.Debug(SubscriptionResult);

}

Where Customer ID is a GUID and CustomerNumber is 8 Alpha Numeric values.

on May 5, 2022 at 11:53pm   •  0 likes

Phong rightly pointed out the potential cause of this issue. Making those changes should help you resolve this error

1 Answer
answered on May 5, 2022 at 9:33am  

In your original post, it shows the error message of verification token is invalid.

Then in your comment, after removing the verification token, you got a different error "validation token is not returned", this meant that RingCentral server tried to validate your Webhook endpoint by sending a validation token and it expects to receive the token back within 5 secs. But it did not receive it.

See this getting started example code for how to handle the return of validation token.


 2
answered on May 5, 2022 at 6:41am  

I am not sure how I can get a coyp of the raw request. Here is what My code looks like:

 {
     NotificationDeliveryModeRequest nDM = new NotificationDeliveryModeRequest();
     nDM.transportType = "WebHook";
     nDM.address = "https://app.example.com/RCNotify.aspx"; // ?CID=" & oCustomer.CustomerId.ToString
     nDM.encryption = false;
     // nDM.verificationToken = "C" & oCustomer.CustomerId.ToString & "ID"
     nDM.verificationToken = "C" + oCustomer.CustomerNumber + "ID";
     // nDM.verificationToken = "C" & CleanAlphaNumericOnly(oCustomer.CustomerId.ToString) & "ID"
    
     List EventFiltersList = new List();
     EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/message-store");
     EventFiltersList.Add("/restapi/v1.0/account/~/telephony/sessions");
     // EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/")
     // EventFiltersList.Add("/restapi/v1.0/account/~/extension/~/")
    
     CreateSubscriptionRequest nSMSReq = new CreateSubscriptionRequest();
     nSMSReq.deliveryMode = nDM;
     nSMSReq.expiresIn = 630720000;
     nSMSReq.eventFilters = EventFiltersList.ToArray();
    
     var SubscriptionResult = RC.Restapi.Subscription.Post(nSMSReq).Result;
     mylog.Debug(SubscriptionResult);
 }

Where Customer ID is a GUID and CustomerNumber is 8 Alpha Numeric values.


 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