question

Nate Breeden avatar image
Nate Breeden asked Nate Breeden answered

Automatic Call Recording

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

rest apideveloper sandbox
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Nate Breeden avatar image
Nate Breeden answered

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

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

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


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