question

Jim Stavropoulos avatar image
Jim Stavropoulos asked Phong Vu answered

Failure to pause active recording

I have a webhook that takes in events from /account/~/telephony/sessions. After a call is started, the following events comes in:
{

'uuid': '7797363007370040051',

'event': '/restapi/v1.0/account/2372180004/extension/2372180004/telephony/sessions', 'timestamp': '2023-11-24T21:54:12.910Z',

'subscriptionId': '0cdd42b0-8039-425c-bdc2-be66d53c25c7',

'ownerId': '2372180004',

'body': {

'sequence': 7,

'sessionId': '972044820005',

'telephonySessionId': 's-a0e174f191008z18c03535d88za351b10000',

'serverId': '10.14.23.79.TAM',

'eventTime': '2023-11-24T21:54:12.842Z',

'parties': [

{

'accountId': '2372180004',

'extensionId': '2372180004',

'id': 'p-a0e174f191008z18c03535d88za351b10000-2',

'direction': 'Inbound',

'to': {

'phoneNumber': [NUMBER],

'name': [NAME],

'extensionId': '2372180004'

}, 'from': {

'phoneNumber': [NUMBER],

'name': [NAME]

}, 'recordings': [{

'id': '2410992944005',

'active': True

}], 'status': {

'code': 'Answered',

'rcc': False

},

'park': {},

'missedCall': False,

'standAlone': False,

'muted': False

}],

'origin': {'type': 'Call'}

}}

While the call the still active, I shortly made the request:

curl --request PATCH \
  --url 'https://platform.ringcentral.com/restapi/v1.0/account/~/telephony/sessions/s-a0e174f191008z18c03535d88za351b10000/parties/p-a0e174f191008z18c03535d88za351b10000-2/recordings/2410992944005?brandId=~' \
  --header 'accept: application/json' \
  --header 'authorization: Bearer [MY-BEARER-TOKEN]' \
  --header 'content-type: application/json' \
  --data '{"active":true}'

In which I am getting an Error code 400 response. I need help understanding why I would be getting this error, and what to do to resolve it. I made the same request where active was equal to false.

rest apiwebhookscall recording
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered

First of all, why do you set the extra path to the url?

?brandId=~

Then, you wrote that you want to pause a recording. In the event posted above, the recording is being active.

'recordings': [{
    'id': '2410992944005',
    'active': True
}],

And you tried to set it active, not pausing it?

--data '{"active":true}'

Read this article to learn more.

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