API 참조

SMS

SMS/MMS 메시지를 읽고 보냅니다. SMS 권한이 필요합니다. Google Play 빌드에서는 사용할 수 없습니다.

타입 정의

bash
type Message {
  id: ID!
  body: String!
  address: String!       # phone number
  date: String!          # ISO 8601
  serviceCenter: String!
  read: Boolean!
  threadId: String!
  type: Int!             # 1=inbox 2=sent 3=draft 5=failed
  subscriptionId: Int!
  isMms: Boolean!
  attachments: [MessageAttachment!]!
}

type MessageAttachment {
  path: String!
  contentType: String!
  name: String!
}

type SmsConversation {
  id: String!
  address: String!
  snippet: String!
  date: String!
  messageCount: Int!
  read: Boolean!
}

type SmsCounts {
  inbox: Int!
  sent: Int!
  draft: Int!
  failed: Int!
}

작업

query

sms

SMS 메시지를 검색합니다. 모두 나열하려면 쿼리에 빈 문자열을 사용하십시오.

bash
query GetSms($offset: Int!, $limit: Int!, $query: String!) {
  sms(offset: $offset, limit: $limit, query: $query) {
    id body address date read threadId type subscriptionId isMms
    attachments { path contentType name }
  }
}
query

smsCount

쿼리와 일치하는 SMS 메시지 수를 셉니다.

bash
query GetSmsCount($query: String!) {
  smsCount(query: $query)
}
query

smsConversations

SMS 대화(스레드)를 페이지 매김으로 나열합니다.

bash
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
  smsConversations(offset: $offset, limit: $limit, query: $query) {
    id address snippet date messageCount read
  }
}
query

smsConversationCount

쿼리와 일치하는 SMS 대화 수를 셉니다.

bash
query GetSmsConversationCount($query: String!) {
  smsConversationCount(query: $query)
}
query

smsAllCounts

모든 SMS 카테고리의 카운트를 반환합니다.

bash
query GetSmsAllCounts {
  smsAllCounts { inbox sent draft failed }
}
query

archivedConversations

보관된(숨겨진) 대화를 나열합니다.

bash
query GetArchivedConversations {
  archivedConversations { id address snippet date messageCount read }
}
mutation

sendSms

SMS를 보냅니다. subscriptionId=-1을 전달하면 기본 SIM이 사용됩니다.

bash
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
  sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}
mutation

sendMms

기본 SMS 앱을 시작하고 MMS (하나 이상의 첨부 파일)를 미리 채웁니다. 대기 중인 MMS id를 반환합니다. PlainApp은 전송 상태를 폴링하고 WebSocket 이벤트로 성공을 보고합니다. attachmentPaths는 PlainApp의 AppFile 저장소에 있는 파일 (fid: URI)을 가리켜야 합니다.

bash
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
  sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}
mutation

archiveConversation

스레드 id와 날짜로 대화를 보관합니다.

bash
mutation ArchiveConversation($id: String!, $date: Long!) {
  archiveConversation(id: $id, date: $date)
}
mutation

unarchiveConversation

대화를 보관에서 제거합니다.

bash
mutation UnarchiveConversation($id: String!) {
  unarchiveConversation(id: $id)
}