article

Byrne Reese avatar image
Byrne Reese posted

How to resolve a CMN-103 error when calling the Analytics API

The RingCentral Analytics API has one of the most complex request formats among all RingCentral APIs. If there is the smallest error made in formatting this request, then the API will return an HTTP 400 Bad Request with an error code of CMN-103.

The precise fix is impossible to document in this article, as everyone's code and apps are different. But the following can help you troubleshoot:

  1. Start with a code sample you know works. Then make modifications incrementally, testing each change you make as you go.

  2. Pass only the request parameters you require. Most of the parameters in an Analytics API request are optional. By passing in only the elements you require, you minimize the number of error you may unintentionally introduce.

With that advice in hand, if you are looking for a fully-formed request payload that you know will work, then try the following:

 {
   "grouping": {
     "groupBy": "Users"
   },
   "timeSettings": {
     "timeZone": "America/Los_Angeles",
     "timeRange": {
       "timeFrom": "2022-08-25T21:57:12.252Z",
       "timeTo": "2023-01-10T21:57:12.252Z"
     }
   },
   "responseOptions": {
     "counters": {
       "allCalls": {
         "aggregationType": "Sum"
       },
       "callsByDirection": {
         "aggregationType": "Sum"
       },
       "callsByOrigin": {
         "aggregationType": "Sum"
       },
       "callsByResponse": {
         "aggregationType": "Sum"
       },
       "callsSegments": {
         "aggregationType": "Sum"
       },
       "callsByResult": {
         "aggregationType": "Sum"
       },
       "callsByCompanyHours": {
         "aggregationType": "Sum"
       },     
       "callsByActions": {
         "aggregationType": "Sum"
       },
       "callsByType": {
         "aggregationType": "Sum"
       },
       "queueOpportunities": {
         "aggregationType": "Sum"
       }
     },
     "timers": {
       "allCallsDuration": {
         "aggregationType": "Sum"
       },
       "callsDurationByDirection": {
         "aggregationType": "Sum"
       },
       "callsDurationByOrigin": {
         "aggregationType": "Sum"
       },
       "callsDurationByResponse": {
         "aggregationType": "Sum"
       },
       "callsSegmentsDuration": {
         "aggregationType": "Sum"
       },
       "callsDurationByResult": {
         "aggregationType": "Sum"
       },
       "callsDurationByCompanyHours": {
         "aggregationType": "Sum"
       },
       "callsDurationByType": {
         "aggregationType": "Sum"
       }
     }
   }
 }
analytics and reporting
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

Article

Contributors

ByrneReese contributed to this article