SMS
Read and send SMS/MMS messages. Requires SMS permission. Not available on Google Play build.
Type Definitions
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!
}Operations
sms
Search SMS messages. Use empty string for query to list all.
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 }
}
}smsCount
Count SMS messages matching a query.
query GetSmsCount($query: String!) {
smsCount(query: $query)
}smsConversations
List SMS conversations (threads), paginated.
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
smsConversations(offset: $offset, limit: $limit, query: $query) {
id address snippet date messageCount read
}
}smsConversationCount
Count SMS conversations matching a query.
query GetSmsConversationCount($query: String!) {
smsConversationCount(query: $query)
}smsAllCounts
Return counts for all SMS categories.
query GetSmsAllCounts {
smsAllCounts { inbox sent draft failed }
}archivedConversations
List archived (hidden) conversations.
query GetArchivedConversations {
archivedConversations { id address snippet date messageCount read }
}sendSms
Send an SMS. Pass subscriptionId=-1 to use the default SIM.
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}sendMms
Launch the default SMS app pre-filled with an MMS (one or more attachments). Returns a pending MMS id; PlainApp polls the sent state and reports success via WebSocket events. attachmentPaths must point to files in PlainApp's AppFile store (fid: URIs).
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}archiveConversation
Archive a conversation by thread id and date.
mutation ArchiveConversation($id: String!, $date: Long!) {
archiveConversation(id: $id, date: $date)
}unarchiveConversation
Remove a conversation from the archive.
mutation UnarchiveConversation($id: String!) {
unarchiveConversation(id: $id)
}