Tham chiếu API

Calls

Truy cập lịch sử cuộc gọi và thông tin SIM. Yêu cầu quyền READ_CALL_LOG.

Định nghĩa kiểu

bash
type Call {
  id: ID!
  number: String!
  name: String!            # display name from contacts
  photoId: String!         # use GET /fs?id=<photoId>
  startedAt: String!       # ISO 8601
  duration: Int!           # seconds
  type: Int!               # 1=incoming 2=outgoing 3=missed 4=voicemail 5=rejected 6=blocked
  accountId: String!       # SIM slot / account id
  geo: String!             # geographic label for the number
}

type Sim {
  id: String!
  label: String!
  number: String!
  subscriptionId: Int!
}

Thao tác

query

calls

Tìm kiếm các mục nhật ký cuộc gọi. Để query trống để liệt kê tất cả.

bash
query GetCalls($offset: Int!, $limit: Int!, $query: String!) {
  calls(offset: $offset, limit: $limit, query: $query) {
    id number name photoId startedAt duration type accountId geo
  }
}
query

callCount

Đếm các cuộc gọi khớp với một query.

bash
query GetCallCount($query: String!) {
  callCount(query: $query)
}
query

sims

Liệt kê tất cả thẻ SIM / tài khoản điện thoại khả dụng trên thiết bị.

bash
query GetSims {
  sims { id label number subscriptionId }
}
mutation

call

Khởi tạo một cuộc gọi điện thoại đến số đã cho. Đặt showDialer thành true để mở bàn phím ứng dụng điện thoại thay vì gọi ngay lập tức. Yêu cầu quyền CALL_PHONE.

bash
mutation Call($number: String!, $showDialer: Boolean!) {
  call(number: $number, showDialer: $showDialer)
}
mutation

deleteCalls

Xóa các mục nhật ký cuộc gọi khớp với một query.

bash
mutation DeleteCalls($query: String!) {
  deleteCalls(query: $query)
}