SMS
Legge e invia messaggi SMS/MMS. Richiede l'autorizzazione SMS. Non disponibile nella build di Google Play.
Definizioni di 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!
}Operazioni
sms
Cerca messaggi SMS. Usa una stringa vuota come query per elencarli tutti.
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
Conta i messaggi SMS corrispondenti a una query.
query GetSmsCount($query: String!) {
smsCount(query: $query)
}smsConversations
Elenca le conversazioni SMS (thread), con paginazione.
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
smsConversations(offset: $offset, limit: $limit, query: $query) {
id address snippet date messageCount read
}
}smsConversationCount
Conta le conversazioni SMS corrispondenti a una query.
query GetSmsConversationCount($query: String!) {
smsConversationCount(query: $query)
}smsAllCounts
Restituisce i conteggi di tutte le categorie SMS.
query GetSmsAllCounts {
smsAllCounts { inbox sent draft failed }
}archivedConversations
Elenca le conversazioni archiviate (nascoste).
query GetArchivedConversations {
archivedConversations { id address snippet date messageCount read }
}sendSms
Invia un SMS. Passa subscriptionId=-1 per usare la SIM predefinita.
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}sendMms
Avvia l'app SMS predefinita precompilata con un MMS (uno o più allegati). Restituisce un id MMS in sospeso; PlainApp esegue il polling dello stato di invio e segnala l'esito tramite eventi WebSocket. attachmentPaths deve puntare a file nell'AppFile store di PlainApp (URI fid:).
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}archiveConversation
Archivia una conversazione per ID thread e data.
mutation ArchiveConversation($id: String!, $date: Long!) {
archiveConversation(id: $id, date: $date)
}unarchiveConversation
Rimuove una conversazione dall'archivio.
mutation UnarchiveConversation($id: String!) {
unarchiveConversation(id: $id)
}