Solved

Automatic Call Recording

  • 25 November 2020
  • 2 replies
  • 520 views

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

icon

Best answer by Nate2390738036 25 November 2020, 22:44

View original

2 replies

Userlevel 1

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"
    }
  ]
}


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