Danh sách API (API List)

Lấy token chứng thực ( Get Authentication Token)

Sử dụng cho việc nhận websocket về các signal của cuộc gọi

URL: /oapi/v1/voice/auth_token

METHOD: POST

Content Type: application/json‌

Headers:

Thuộc tính
Kiểu dữ liệu
Giá trị

x-auth-app-id

String

Định danh 3rd party

x-auth-app-hash

String

sha256(appId + appSecret)

Kết quả:

Status
Kết quả

200

{ value: <auth_token>, expire: <expire time> }

Click to call

URL: /oapi/v1/call/click-to-call/:number

METHOD: POST

Content Type: application/json‌

Headers:

Thuộc tính
Kiểu dữ liệu
Giá trị

x-auth-app-id

String

Định danh 3rd party

x-auth-app-hash

String

sha256(appId + appSecret)

Tham số:

Thuộc tính
Kiểu dữ liệu
Giá trị

sipUser

String

Device name thực hiện việc click to call

sipPassword

String

Mật khẩu

Kết quả:‌

Status
Kết quả

200

Device online, click to call thành công

400

Device offline, click to call thất bại

note

Để nhận được cuộc gọi, device sip cần register lên hệ thống, mã lỗi 400 là do device chưa register đến hệ thống

Lấy danh sách cuộc gọi

URL: https://openapi.antbuddy.com/oapi/v1/call/histories

METHOD: GET‌

Content Type: application/json‌

Tham số:

Thuộc tính
Kiểu dữ liệu
Giá trị

appId

String

Định danh 3rd party

created_from

String

Ngày bắt đầu

created_to

String

Ngày kết thúc

limit

Number

Giới hạn số record trên 1 trang. Mặc định 20

page

Number

Trang hiện tại, mặc định 1

hash

String

sha256(created_from+created_to+limit+page+appID+appSecret)

Trong đó:‌

  • Thời gian filter tối đa là 31 ngày

  • Limit mặc định là 20 record, tối đa 100

  • Page mặc định là 1

Kết quả:

Thuộc tính
Ví dụ
Mô tả

caller

{
  number:"01693608879",
  type:"realnumber"
}

Mô tả người gọi. Đối với type=user, có thêm trường username để định danh user.

callee

{
  number:"thutranhtkbee",
  type:"user",
  username:"thutran"
}

Mô tả người nhận. Đối với type=user, có thêm trường username để định danh user.

class

trunking

one_one: gọi nội bộ. trunking: gọi ra hoặc gọi vào hệ thống

did_number

02873019555

Số DID của công ty. Null: nếu gọi nội bộ hoặc gọi ra

direction

from_ab

from_ab: gọi ra. to_ab: gọi vào

status_detail

SUCCESS

IVR: Cuộc gọi vào / ra đến hệ thống đầu cuối nhưng người nhận chưa bắt máy. SUCCESS: Cuộc gọi thành công. CANCELLED: Thực hiện cuộc gọi ra và gác máy trước khi người nhận nhận cuộc gọi. BUSY: Thực hiện cuộc gọi ra nhưng đầu nhận bận máy. UNSUCCESS: Các lỗi khác

duration_seconds

50

Thời gian cuộc gọi ( tính bằng giây)

unix_timestamp

1519639917

Thời điểm xảy ra cuộc gọi. Tính theo unix timestamp

billing_seconds

43

Thời gian đàm thoại của cuộc gọi ( tính bằng giây)

recording

call_recording_dl5m5j5hfh4n8njj1oor.mp3

File ghi âm. Trường hợp không có ghi âm thì trường này rỗng.

Giới hạn:‌ Chỉ cho phép lấy lịch sử cuộc gọi tối đa 31 ngày‌

Lấy file ghi âm

URL: https://openapi.antbuddy.com/oapi/v1/call/play_recording

METHOD: GET‌

Content Type: application/json‌

Tham số:

Tham số
Kiểu dữ liệu
Mô tả

appId

String

Định danh 3rd party

media

String

Tên file recording

hash

String

sha256(appId +media+ appSecret)

Kết quả:‌

Đường dẫn URL của file media

(

Used for receiving websocket signals for call events.Comment

  • URL: /oapi/v1/voice/auth_tokenComment

  • METHOD: POSTComment

  • Content Type: application/jsonComment

CommentHeaders:Comment

Property

Data Type

Value

x-auth-app-id

String

3rd party identifier

x-auth-app-hash

String

sha256(appId + appSecret)

CommentResponse:Comment

Status

Result

200

{ value: <auth_token>, expire: <expire time> }

Comment


Comment2. Click to CallComment

  • URL: /oapi/v1/call/click-to-call/:numberComment

  • METHOD: POSTComment

  • Content Type: application/jsonComment

CommentHeaders:Comment

Property

Data Type

Value

x-auth-app-id

String

3rd party identifier

x-auth-app-hash

String

sha256(appId + appSecret)

CommentParameters:Comment

Property

Data Type

Value

sipUser

String

Device name for click to call

sipPassword

String

Password

Response:

Status

Result

200

Device online, click to call successful

400

Device offline, click to call failed

Note: To receive the call, the SIP device must be registered on the system. Error 400 occurs when the device is not registered.


3. Get Call History

Parameters:

Property

Data Type

Value

appId

String

3rd party identifier

created_from

String

Start date

created_to

String

End date

limit

Number

Limit of records per page, default 20

page

Number

Current page, default 1

hash

String

sha256(created_from+created_to+limit+page+appID+appSecret)

Notes:

  • Maximum time filter is 31 days.

  • Default limit is 20 records, maximum 100.

  • Default page is 1.

Response:

Property

Example

Description

caller

{number: "01693608879", type: "realnumber"}

Caller details, with username if type=user

callee

{number: "thutranhtkbee", type: "user", username: "thutran"}

Callee details, with username if type=user

class

trunking

Call type: one_one for internal, trunking for inbound/outbound calls

did_number

02873019555

DID number for the company. Null if internal or outbound

direction

from_ab

from_ab for outbound calls, to_ab for inbound

status_detail

SUCCESS

Call status: IVR (system call not answered), SUCCESS, CANCELLED, BUSY, UNSUCCESS

duration_seconds

50

Duration of the call in seconds

unix_timestamp

1519639917

Call timestamp in Unix format

billing_seconds

43

Talk time for the call in seconds

recording

call_recording_dl5m5j5hfh4n8njj1oor.mp3

File path for the recording, empty if no recording

Limit: The call history can only be retrieved for a maximum of 31 days.


4. Get Call Recording

Parameters:

Property

Data Type

Description

appId

String

3rd party identifier

media

String

Recording file name

hash

String

sha256(appId + media + appSecret)

Response:

Property

Example

Description

media

https://abs1.antbuddy.com/nkrecord/call_recording_F5879958-1A1211E8-A55AA457-72574952%40172.16.0.204.mp3?AWSAccessKeyId=E7IPYE4LN28Y4I6T4400&Expires=1519640615&Signature=wXNENYxr0OJR8vA26kvOOwsttzU%3D

URL link to the recording file

)

Last updated