API リファレンス
Calls
通話履歴と SIM 情報にアクセスします。READ_CALL_LOG 権限が必要です。
型定義
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!
}操作
query
calls
通話履歴エントリを検索します。クエリを空にするとすべて一覧表示されます。
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
クエリに一致する通話の数をカウントします。
bash
query GetCallCount($query: String!) {
callCount(query: $query)
}query
sims
デバイスで利用可能なすべての SIM カード / 電話アカウントを一覧表示します。
bash
query GetSims {
sims { id label number subscriptionId }
}mutation
call
指定した番号に通話を発信します。showDialer を true に設定すると、即座に発信するのではなく電話アプリのダイヤラーを開きます。CALL_PHONE 権限が必要です。
bash
mutation Call($number: String!, $showDialer: Boolean!) {
call(number: $number, showDialer: $showDialer)
}mutation
deleteCalls
クエリに一致する通話履歴エントリを削除します。
bash
mutation DeleteCalls($query: String!) {
deleteCalls(query: $query)
}