On Premises

Core REST Recording API

Note

An Enterprise license or higher is required to access these features.

Introduction

AnywhereNow has a Representational State Transfer (REST) Recording service, which can be used by, for example, payment system to control the recording state. This feature enables you to be PCI compliant.

Get Recording state

When an audio call is in progress this command will allow for the recorder to be controlled.

Recording states are;

  • Uninitialized = 0,
  • Started = 1,
  • Stopped = 2,
  • Paused = 3

Marking states are;

  • None = 0,
  • Mark = 1,
  • Unmark = 2

Saving states are;

  • None = 0,
  • Save = 1,
  • Delete = 2

Request

Copy
HTTP Request
GET http(s)://<fqdn>/attendantservice/api/recording/<uccname>/1d6c6a58-6739-4f0c-98ff-0968292c8c30 HTTP/1.1
Accept: application/json
Copy
HTTP Request
GET http(s)://<fqdn>/attendantservice/api/v2/recording/<uccname>/1d6c6a58-6739-4f0c-98ff-0968292c8c30 HTTP/1.1
Accept: application/json

Response (session found)

Copy
JSON
{
   "CorrelationId":"1d6c6a58-6739-4f0c-98ff-0968292c8c30",
   "RecordingState":0,
   "MarkingState":1,
   "SavingState":1,
   "ErrorMessage":null,
   "UCCName":"ucc-demo-name"
}

Possible error messages

Configuration

Validation

Change recorder state

Actions that modify the state are;

Request with action id

Note

The RequesterSipUri must be a valid Agent in the UCC.

Copy
HTTP Request
POST http(s)://<fqdn>/attendantservice/api/recording/set HTTP/1.1
Accept: application/json
Content-Type: application/json
{
   "Action":1,
   "RequesterSipUri":"sip:agent@domain.com",
   "CorrelationId":"1d6c6a58-6739-4f0c-98ff-0968292c8c30",
   "UCCName":"ucc-demo-name"
}
Copy
HTTP Request
POST http(s)://<fqdn>/attendantservice/api/v2/recording/set HTTP/1.1
Accept: application/json
Content-Type: application/json
{
   "Action":1,
   "RequesterSipUri":"sip:agent@domain.com",
   "CorrelationId":"1d6c6a58-6739-4f0c-98ff-0968292c8c30",
   "UCCName":"ucc-demo-name"
}

Request with action name

Note

The RequesterSipUri must be a valid Agent in the UCC.

Copy
HTTP Request
POST http(s)://<fqdn>/attendantservice/api/recording/set HTTP/1.1
Accept: application/json
Content-Type: application/json
{
   "Action":"Mark",
   "RequesterSipUri":"sip:agent@domain.com",
   "CorrelationId":"1d6c6a58-6739-4f0c-98ff-0968292c8c30",
   "UCCName":"ucc-demo-name"
}
Copy
HTTP Request
POST http(s)://<fqdn>/attendantservice/api/v2/recording/set HTTP/1.1
Accept: application/json
Content-Type: application/json
{
   "Action":"Mark",
   "RequesterSipUri":"sip:agent@domain.com",
   "CorrelationId":"1d6c6a58-6739-4f0c-98ff-0968292c8c30",
   "UCCName":"ucc-demo-name"
}

Possible error messages

Configuration

Validation

Recording capabilities

In order for the change recorder state command to work the UCC must be set to allow AgentCanEditAudioRecording, with this command you can verify the setting.

Other required settings are UseAudioRecording.

Other valuable setting for Save and Delete functions may be may be SaveRecordingByDefault.

Request

Copy
HTTP Request
GET http(s)://<fqdn>/attendantservice/api/recording/capabilities/ucc-demo-name HTTP/1.1
Accept: application/json
Copy
HTTP Request
GET http(s)://<fqdn>/attendantservice/api/v2/recording/capabilities/ucc-demo-name HTTP/1.1
Accept: application/json

Response

Copy
JSON
{
   "AgentCanEditRecordings":true,
   "ErrorMessage":null,
   "UCCName":"ucc_"
}

Possible error messages

Validation

Recording events

SignalR hub can be listened to for the RecordingStateChangedEvent which holds UccName, CorrelationId and StateAction. StateAction is the type of action that changed the state of the audiorecorder;

  • Start = 1,
  • Stop = 2,
  • Pause = 3,
  • Save = 4,
  • Delete = 5,
  • Mark = 6,
  • UnMark = 7

Error Messages

Each recording command response can contain an ErrorMessage body.

ErrorMessage will be null when the message is successful, otherwise it will contain the following;

Copy
JSON
{
   "ErrorMessage":{
      "ErrorType":1,
      "Message":"string"
   }
}

The error types that can be returned are;