Calls

The API allows retrieval and management of active or recently ended calls (within 10 minutes)

Note

To retrieve call detail records, please use the /RecentCalls API instead of using this API. This API is not intended for that purpose

Numbers have the following properties:

Property

Description

service_url

The URL of the service used to process a specific call

direction

Call direction

caller_name

Caller’s name

account_sid

Unique identifier for the account

call_status

Status of the call

call_id

Unique identifier for the call

sip_status

SIP status of the call

from

Caller number

to

Callee number

duration

Call time call

Get Calls

GET /v1/Accounts/{account_sid}/Calls

Retrieve a list of ongoing or recently ended calls associated with the account

AUTHORIZATION - Bearer Token

This document is using Bearer Token from Authentication

PATH VARIABLES

Name

Description

account_sid

Unique identifier for the account

Example request:

curl -X 'GET' \
'https://api.epacific.net/v1/Accounts/5f8e8f60-4771-44cb-92a6-94ea66df0450/Calls' \
-H 'accept: application/json' \
-H 'Authorization: Bearer 1cf2f4f4-64c4-4249-9a3e-5bb4cb597c2a'

Example response:

[
    {
        "service_url": "https://cpaas.epacific.net",
        "direction": "outbound",
        "caller_name": "",
        "call_sid": "a4941f23-66b8-4b52-b495-94192adee7ec",
        "account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
        "call_status": "completed",
        "call_id": "a173fe94-3be1-123a-28b2-0efdfb356c0d",
        "sip_status": 200,
        "from": "84899199628",
        "to": "84376120177",
        "duration": 5
    },
    {
        "service_url": "https://cpaas.epacific.net",
        "direction": "outbound",
        "caller_name": "",
        "call_sid": "6b4931df-436a-4bfe-864e-3513d2917c02",
        "account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
        "application_sid": "9984fdc5-89ec-4ffe-9cee-880255a46253",
        "call_status": "completed",
        "call_id": "7ed07f1e-3be0-123a-28b2-0efdfb356c0d",
        "sip_status": 200,
        "from": "84899199628",
        "to": "84376120177",
        "duration": 16
    },
    {
        "service_url": "https://cpaas.epacific.net",
        "direction": "outbound",
        "caller_name": "",
        "call_sid": "65d1cefe-c21a-4f03-92c0-947d6a17fe01",
        "account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
        "call_status": "completed",
        "call_id": "6f7c2d1c-3be1-123a-28b2-0efdfb356c0d",
        "sip_status": 200,
        "from": "84899199628",
        "to": "84333308016",
        "duration": 5
    },
    {
        "service_url": "https://cpaas.epacific.net",
        "direction": "outbound",
        "caller_name": "",
        "call_sid": "8f0eb6f4-85d9-40c7-84a8-a7a8228f9816",
        "account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
        "call_status": "completed",
        "call_id": "13f2f4b9-3be1-123a-28b2-0efdfb356c0d",
        "sip_status": 200,
        "from": "84899199628",
        "to": "84333308016",
        "duration": 0
    }
]

Get Call

GET /v1/Accounts/{account_sid}/Calls/{call_sid}

Get information on a call that is either currently ongoing or has recently ended (within the last ten minutes)

AUTHORIZATION - Bearer Token

This document is using Bearer Token from Authentication

PATH VARIABLES

Name

Description

account_sid

Unique identifier for the account

call_sid

Unique identifier for the call

Example request:

curl -X 'GET' \
'https://api.epacific.net/v1/Accounts/5f8e8f60-4771-44cb-92a6-94ea66df0450/Calls/e1577b29-3609-4d83-9ddd-8bd7f965b53c' \
-H 'accept: application/json' \
-H 'Authorization: Bearer 1cf2f4f4-64c4-4249-9a3e-5bb4cb597c2a'

Example response:

{
    "service_url": "https://cpaas.epacific.net",
    "direction": "inbound",
    "caller_name": "",
    "call_sid": "e1577b29-3609-4d83-9ddd-8bd7f965b53c",
    "account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
    "application_sid": "98acd50a-9f25-42a6-8dbf-aadb400ddcf0",
    "from": "84899199628",
    "to": "84376120177",
    "call_id": "24f6442d-3be6-123a-dc86-0e72d4e3c899",
    "sip_status": 200,
    "call_status": "completed",
    "originating_sip_ip": "54.172.60.2:5060",
    "originating_sip_trunk_name": "SBC",
    "duration": 57
}

Create Call

POST /v1/Accounts/{account_sid}/Calls

Create a call

AUTHORIZATION - Bearer Token

This document is using Bearer Token from Authentication

PATH VARIABLES

Name

Description

account_sid

Unique identifier for the account

Example request:

curl -X 'POST' \
'https://api.epacific.net/v1/Accounts/5f8e8f60-4771-44cb-92a6-94ea66df0450/Calls' \
-H 'accept: application/json' \
-H 'Authorization: Bearer 1cf2f4f4-64c4-4249-9a3e-5bb4cb597c2a' \
-H 'Content-Type: application/json' \
-d '{
"application_sid": "0d27aee6-d1e6-4707-bdde-1cc20b50ca88",
"from": "+84899199628",
"to": {
    "type": "phone",
    "number": "+84376120177"
}'

Example response:

{
    "sid": "6b4931df-436a-4bfe-864e-3513d2917c02"
}

Delete Call

DELETE /v1/Accounts/{account_sid}/Calls/{call_sid}

Deletes a call

Note

That deleting a call does not hang up the call, nor does it delete the call detail record for the call. It merely removes it from the redis database

AUTHORIZATION - Bearer Token

This document is using Bearer Token from Authentication

PATH VARIABLES

Name

Description

account_sid

Unique identifier for the account

call_sid

Unique identifier for the call

Example request:

curl -X 'DELETE' \
'https://api.servertesting.tk/v1/Accounts/5f8e8f60-4771-44cb-92a6-94ea66df0450/Calls/a4941f23-66b8-4b52-b495-94192adee7ec' \
-H 'accept: application/json' \
-H 'Authorization: Bearer 1cf2f4f4-64c4-4249-9a3e-5bb4cb597c2a'

Example response:

Success is indicated by a 204 response


Please contact us for timely support via: