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
Automatic Call Recording
Tags: developer sandbox, rest api
Nov 25, 2020 at 10:17am   •   2 replies  •  0 likes
Nate Breeden

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

2 Answers
answered on Nov 25, 2020 at 1:35pm  

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



 0
answered on Nov 25, 2020 at 1:44pm  

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!!


 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