SMS
Leia e envie mensagens SMS/MMS. Requer permissão de SMS. Não disponível na build do Google Play.
Definições de Tipo
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!
}Operações
sms
Pesquise mensagens SMS. Use string vazia para a consulta para listar todas.
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
Conte mensagens SMS correspondentes a uma consulta.
query GetSmsCount($query: String!) {
smsCount(query: $query)
}smsConversations
Liste conversas SMS (threads), paginadas.
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
smsConversations(offset: $offset, limit: $limit, query: $query) {
id address snippet date messageCount read
}
}smsConversationCount
Conte conversas SMS correspondentes a uma consulta.
query GetSmsConversationCount($query: String!) {
smsConversationCount(query: $query)
}smsAllCounts
Retorne contagens para todas as categorias de SMS.
query GetSmsAllCounts {
smsAllCounts { inbox sent draft failed }
}archivedConversations
Liste conversas arquivadas (ocultas).
query GetArchivedConversations {
archivedConversations { id address snippet date messageCount read }
}sendSms
Envie um SMS. Passe subscriptionId=-1 para usar o SIM padrão.
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}sendMms
Abre o app de SMS padrão pré-preenchido com um MMS (um ou mais anexos). Retorna um id de MMS pendente; o PlainApp consulta o estado de envio e relata o sucesso via eventos WebSocket. attachmentPaths deve apontar para arquivos no AppFile store do PlainApp (URIs fid:).
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}archiveSmsConversation
Archive a conversation by thread id; the server derives the snapshot date.
mutation ArchiveSmsConversation($id: String!) {
archiveSmsConversation(id: $id)
}unarchiveSmsConversation
Remove a conversation from the archive.
mutation UnarchiveSmsConversation($id: String!) {
unarchiveSmsConversation(id: $id)
}