Share via


Answer Call - Answer Call

Answer a call using the IncomingCallContext from Event Grid.

POST {endpoint}/calling/callConnections:answer?api-version=2024-09-15

URI Parameters

Name In Required Type Description
endpoint
path True

string (url)

The endpoint of the Azure Communication resource.

api-version
query True

string

Version of API to invoke.

Request Header

Name Required Type Description
Authorization True

string

An Azure Communication Services user access token.

Repeatability-Request-ID

string (uuid)

If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated unique identifier for the request. It is a version 4 (random) UUID.

Repeatability-First-Sent

string (date-time-rfc1123)

If Repeatability-Request-ID header is specified, then Repeatability-First-Sent header must also be specified. The value should be the date and time at which the request was first created, expressed using the IMF-fixdate form of HTTP-date. Example: Sun, 06 Nov 1994 08:49:37 GMT.

Request Body

Name Required Type Description
callbackUri True

string

The callback uri.

incomingCallContext True

string

The context associated with the call.

answeredBy

CommunicationUserIdentifierModel

callIntelligenceOptions

CallIntelligenceOptions

AI options for the call.

operationContext

string

A customer set value used to track the answering of a call.

Responses

Name Type Description
200 OK

CallConnectionProperties

Returns details of the call properties once the AnswerCall request is received by service. You will receive CallConnected event at your specified callback URI, once the call is connected.

Other Status Codes

CommunicationErrorResponse

Error

Security

Authorization

An Azure Communication Services user access token.

Type: apiKey
In: header

Examples

AnswerCall

Sample request

POST https://contoso.communications.azure.com/calling/callConnections:answer?api-version=2024-09-15

{
  "incomingCallContext": "H4sIAAAAAAAEAMVVS2/bOBD+LzrspaElPiSSBoJFNnvYoNi0aHaBtpcFRQ5t1rIokLRTJ8h/X1J2soHRQ4A9lAdZ4ry+mflm/FhpNQy3PjnrtErOj9XysbLBb8uvM9WyEkul49J2ioEiGhlKADHVKiR7oVDXUGo5tkpa8k8zH9yglhuKuLQNkqLpEMZUNSZLNFfVRWVcnAZ1uFVbyP53EQLOtzCaybsx3ZSgnZFKKk4QgLGIybZFfU8oolIZzFrWGk6yzaDG1U6tYLaBMd9MKiSn3aROjjSRoAUHhG1PEDMdIGFlg4yRUmhChWQsm62dMdl+adUQ4aIKEP0u6KPft6RePV1Uyf/PmmmT5VijnlmMpD7VDLg4r9m4G4azgjWng37weD5nBTt6OS8YlcRyBhpJwD1iggFSbccQJVRJANW1gp4XLCc/uHETS/4qJaXX2dE6pSku61pNbgETMrBfxM1hgsUIqVzWe1Lrqda6iBBpmsXx9ZWW1vUe19aHDZja9pqBMRyBpQyxriVIgNBIGa11D9wy2tWE1Q7np6iPOH51lyXtLRinrsZ4D6FwQmdY28LEKfhV7nX8+XCfkZwAB/gGOv18WEccJ1A7M/0V1BgnHwq0/JmBYSoWEi84XTC+pIyLuszCXPBrPyYY0zPTsv57OBSOxJxoXjXzV3WzJs1D/+X22gy/36m762/vhk8PV5eXOWAm5gZKqDZ5/PCdc2L/vvmjbynGh3fhPus8lVIZFzLI7PBj8BNkOsPMRBc/nURXw+DvIbM7hR3MJnmWdNE6Itt7p2Gr3HAHKblxVcyfsp724x5CnPfizbh36WVDvpaUNIMfhplbb+1Xtp87hhfPr687lq/qB4HD9ec1vN98+OzhQ9Rfp26zKq34BS47ygVtBZdNS3AjMCnb0MU/d0NyH/NEH15WmYu/BZ+7q2L6b1oN9LvVS3se5z+B4w6lWIOSHOl5+rmiSJoOI9b0jZZATMPUD7bsm5ZGjrsKfjfNcb+faPH0LyoNW7KCBgAA",
  "callbackUri": "https://app.contoso.com/callback"
}

Sample response

{
  "callConnectionId": "18dea47f-b081-4107-9a5c-4300819d2c6c",
  "serverCallId": "aHR0cHM6Ly9jb252ZXJzYXRpb251cmwvdGVzdA",
  "sourceCallerIdNumber": {
    "value": "+18440123456"
  },
  "source": {
    "kind": "communicationUser",
    "communicationUser": {
      "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_da7be3a9-8788-42a6-85c6-56b2cf784fce"
    }
  },
  "targets": [
    {
      "kind": "communicationUser",
      "communicationUser": {
        "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_0f50d091-5bd3-448b-884d-44be7037d9b9"
      }
    }
  ],
  "callConnectionState": "connected",
  "callbackUri": "https://app.contoso.com/callback"
}

Definitions

Name Description
AnswerCallRequest

The request payload for answering the call.

CallConnectionProperties

Properties of a call connection

CallConnectionStateModel

The state of the call connection.

CallIntelligenceOptions

AI options for the call.

AnswerCallRequest

The request payload for answering the call.

Name Type Description
answeredBy

CommunicationUserIdentifierModel

callIntelligenceOptions

CallIntelligenceOptions

AI options for the call.

callbackUri

string

The callback uri.

incomingCallContext

string

The context associated with the call.

operationContext

string

A customer set value used to track the answering of a call.

CallConnectionProperties

Properties of a call connection

Name Type Description
answeredBy

CommunicationUserIdentifierModel

answeredFor

PhoneNumberIdentifierModel

callConnectionId

string

The call connection id.

callConnectionState

CallConnectionStateModel

The state of the call connection.

callbackUri

string

The callback URI.

correlationId

string

The correlation ID.

serverCallId

string

The server call id.

source

CommunicationIdentifierModel

sourceCallerIdNumber

PhoneNumberIdentifierModel

sourceDisplayName

string

Display name of the call if dialing out to a pstn number.

targets

CommunicationIdentifierModel[]

The targets of the call.

CallConnectionStateModel

The state of the call connection.

Value Description
unknown
connecting
connected
transferring
transferAccepted
disconnecting
disconnected

CallIntelligenceOptions

AI options for the call.

Name Type Description
cognitiveServicesEndpoint

string

The identifier of the Cognitive Service resource assigned to this call.