Skip to main content
Solved

Automatic Call Recording

  • November 25, 2020
  • 2 replies
  • 528 views

Forum|alt.badge.img

Not sure what I'm doing wrong this time, trying to add extension 1158 to automatic call recording, when running the script below I receive:

ringcentral.http.api_exception.ApiException: Parameter [addedExtensions] value is invalid.


But the documentation tells me to use "addedExtensions"? I get the same error if I try to use "updatedExtensions"?

Specific API call I'm following: Office API Reference | RingCentral Developers


accountId = '~'
body = {
    'addedExtensions': {
        'extensionNumber': 1158,
        'callDirection': 'Outbound'
    },
    # 'updatedExtensions': {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    # },
    # 'removedExtensions': {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    # }
}
r = platform.post(f'/restapi/v1.0/account/{accountId}/call-recording/bulk-assign', body)


Also tried calling using the extensionId thinking it was because I was calling the extension, but it still spits out the same error. Am I missing permissions for this?



Thanks

Best answer by Nate2390738036

Hey Phung,


Thanks as usual for the help.


Using the extensionId instead of the extensionNumber still returns the same error:

ringcentral.http.api_exception.ApiException: Parameter [addedExtensions] value is invalid.


Looking at your example though, the API I referenced doesn't show the [] brackets after addedExtensions or updatedExtensions, after adding those into my body it resolved the issue.


body = {
    'addedExtensions': [
        {
        'id': _unExtId,
        'callDirection': 'Outbound'
        }
    ],
    # 'updatedExtensions': [
    #   {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    #   }
    # ],
    # 'removedExtensions': [
    #   {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    #   }
    # ]
}
r = platform.post(f'/restapi/v1.0/account/{accountId}/call-recording/bulk-assign', body)


Thanks!!

View original

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • November 25, 2020

The API takes the extension id, not the extension number (the API reference lists also the extension number as input but that is redundant and not used)

POST /restapi/v1.0/account/1468821004/call-recording/bulk-assign

{
  "addedExtensions": [
    {
      "id": "1468821004",
      "callDirection": "All"
    }
  ],
  "updatedExtensions": [
    {
      "id": "1468823004",
      "callDirection": "Outbound"
    }
  ]
}



Forum|alt.badge.img

Hey Phung,


Thanks as usual for the help.


Using the extensionId instead of the extensionNumber still returns the same error:

ringcentral.http.api_exception.ApiException: Parameter [addedExtensions] value is invalid.


Looking at your example though, the API I referenced doesn't show the [] brackets after addedExtensions or updatedExtensions, after adding those into my body it resolved the issue.


body = {
    'addedExtensions': [
        {
        'id': _unExtId,
        'callDirection': 'Outbound'
        }
    ],
    # 'updatedExtensions': [
    #   {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    #   }
    # ],
    # 'removedExtensions': [
    #   {
    #     'extensionNumber': 1158,
    #     'callDirection': 'Outbound'
    #   }
    # ]
}
r = platform.post(f'/restapi/v1.0/account/{accountId}/call-recording/bulk-assign', body)


Thanks!!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings