Voice Call Session Service

This API document describes the VoiceCallSession API, which enables integration with CCaaS platforms. It allows triggering Cresta Agent Desktop events such as Call Start, Call Hold, Call Unhold, and Call End.

Languages
Servers
https://{api-domain}.cresta.com/

VoiceCallSessionService

Operations

StreamCallSession

Request

Used to stream a live call session with call events, audio and metadata.

Bodyapplication/jsonrequired

(streaming inputs)

streamingConfigobject(voicecallsessionStreamingConfig)

The configuration of the call session stream.

audioContentobject(voicecallsessionAudioContent)

The audio content.

sessionEventobject(The additional events related to the call session. Next id: 8)
sequenceIdstring

The optional request sequence ID provided by the client. If provided, it will be attached to the client to indicate which request message the status is associated to.

curl -i -X POST \
  'https://{api-domain}.cresta.com/v1/voicecallsession/streamCallSession' \
  -H 'Content-Type: application/json' \
  -d '{
    "streamingConfig": {
      "profile": "string",
      "audioMetadata": {
        "sampleRateHertz": 0,
        "encoding": "AUDIO_ENCODING_UNSPECIFIED"
      },
      "channelType": "CHANNEL_TYPE_UNSPECIFIED",
      "platformCallId": "string"
    },
    "audioContent": {
      "audioContent": "string",
      "participant": {
        "role": "ROLE_UNSPECIFIED",
        "user": "string",
        "platformAgentId": "string",
        "externalUserId": "string"
      }
    },
    "sessionEvent": {
      "eventType": "EVENT_TYPE_UNSPECIFIED",
      "platformCallId": "string",
      "platformMasterCallId": "string",
      "participants": [
        {
          "role": "ROLE_UNSPECIFIED",
          "user": "string",
          "platformAgentId": "string",
          "externalUserId": "string"
        }
      ],
      "platformTime": "2019-08-24T14:15:22Z",
      "payload": {},
      "closeActiveCalls": true
    },
    "sequenceId": "string"
  }'

Responses

A successful response.(streaming responses)

Bodyapplication/json
resultobject(voicecallsessionStreamCallSessionResponse)

Response of [VoiceCallSessionService.StreamCallSession][].

errorobject(rpcStatus)

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the API Design Guide.

Response
application/json
{ "result": { "sessionStatus": { … }, "sequenceId": "string", "conversationName": "string" }, "error": { "code": 0, "message": "string", "details": [ … ] } }

StreamCallSessionAudio

Request

Used to stream a live call session with audio only (no call events or metadata). It needs to work together with
[ProcessCallSessionEvent] in cloud mode for the call events and metadata.

Bodyapplication/jsonrequired

(streaming inputs)

streamingConfigobject(voicecallsessionStreamingConfig)

The configuration of the call session stream.

audioContentobject(voicecallsessionAudioContent)

The audio content.

audioEventobject(voicecallsessionAudioEvent)

The audio stream event. This only applies to StreamCallSessionAudio API.

sequenceIdstring

The optional request sequence ID provided by the client. If provided, it will be attached to the client to indicate which request message the status is associated to.

curl -i -X POST \
  'https://{api-domain}.cresta.com/v1/voicecallsession/streamCallSessionAudio' \
  -H 'Content-Type: application/json' \
  -d '{
    "streamingConfig": {
      "profile": "string",
      "audioMetadata": {
        "sampleRateHertz": 0,
        "encoding": "AUDIO_ENCODING_UNSPECIFIED"
      },
      "channelType": "CHANNEL_TYPE_UNSPECIFIED",
      "platformCallId": "string"
    },
    "audioContent": {
      "audioContent": "string",
      "participant": {
        "role": "ROLE_UNSPECIFIED",
        "user": "string",
        "platformAgentId": "string",
        "externalUserId": "string"
      }
    },
    "audioEvent": {
      "eventType": "EVENT_TYPE_UNSPECIFIED",
      "pauseDuration": "string"
    },
    "sequenceId": "string"
  }'

Responses

A successful response.(streaming responses)

Bodyapplication/json
resultobject(voicecallsessionStreamCallSessionAudioResponse)

Response of [VoiceCallSessionService.StreamCallSessionAudio][].

errorobject(rpcStatus)

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the API Design Guide.

Response
application/json
{ "result": { "sessionStatus": { … }, "sequenceId": "string", "conversationName": "string" }, "error": { "code": 0, "message": "string", "details": [ … ] } }

ProcessCallSessionEvent

Request

Used to manage a call session with call events and metadata. In desktop mode, the audio is captured by client desktop app. In cloud mode, the audio is streamed from the cloud server with StreamCallSessionAudio.

Path
profilestringrequired

Resource name of the parent customer profile. Format: customers/{customer_id}/profiles/{profile_id}

Bodyapplication/jsonrequired
sessionEventobject(The additional events related to the call session. Next id: 8)
audioStreamingModestring(ProcessCallSessionEventRequestAudioStreamingMode)

The audio streaming mode, which indicates where the audio is streamed from.

  • AUDIO_STREAMING_MODE_UNSPECIFIED: Unspecified. If unspecified, default to DESKTOP.
  • DESKTOP: The audio is streams from desktop with local audio capture.
  • CLOUD: The audio is streams from cloud server.
Default "AUDIO_STREAMING_MODE_UNSPECIFIED"
Enum"AUDIO_STREAMING_MODE_UNSPECIFIED""DESKTOP""CLOUD"
curl -i -X POST \
  'https://{api-domain}.cresta.com/v1/voicecallsession/{profile}/sessionEvent:process' \
  -H 'Content-Type: application/json' \
  -d '{
    "sessionEvent": {
      "eventType": "EVENT_TYPE_UNSPECIFIED",
      "platformCallId": "string",
      "platformMasterCallId": "string",
      "participants": [
        {
          "role": "ROLE_UNSPECIFIED",
          "user": "string",
          "platformAgentId": "string",
          "externalUserId": "string"
        }
      ],
      "platformTime": "2019-08-24T14:15:22Z",
      "payload": {},
      "closeActiveCalls": true
    },
    "audioStreamingMode": "AUDIO_STREAMING_MODE_UNSPECIFIED"
  }'

Responses

A successful response.

Bodyapplication/json
object(voicecallsessionProcessCallSessionEventResponse)

Response of [VoiceCallSessionService.ProcessCallSessionEvent][].

Response
application/json
{}