SMS
Lit et envoie des messages SMS/MMS. Requiert l'autorisation SMS. Non disponible dans la version Google Play.
Définitions de types
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!
}Opérations
sms
Recherche des messages SMS. Utilisez une chaîne vide comme requête pour tout lister.
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
Compte les messages SMS correspondant à une requête.
query GetSmsCount($query: String!) {
smsCount(query: $query)
}smsConversations
Liste les conversations SMS (fils), paginées.
query GetSmsConversations($offset: Int!, $limit: Int!, $query: String!) {
smsConversations(offset: $offset, limit: $limit, query: $query) {
id address snippet date messageCount read
}
}smsConversationCount
Compte les conversations SMS correspondant à une requête.
query GetSmsConversationCount($query: String!) {
smsConversationCount(query: $query)
}smsAllCounts
Renvoie les compteurs de toutes les catégories SMS.
query GetSmsAllCounts {
smsAllCounts { inbox sent draft failed }
}archivedConversations
Liste les conversations archivées (masquées).
query GetArchivedConversations {
archivedConversations { id address snippet date messageCount read }
}sendSms
Envoie un SMS. Passez subscriptionId=-1 pour utiliser la SIM par défaut.
mutation SendSms($number: String!, $body: String!, $subscriptionId: Int!) {
sendSms(number: $number, body: $body, subscriptionId: $subscriptionId)
}sendMms
Déclenche l'application SMS par défaut pré-remplie avec un MMS (une ou plusieurs pièces jointes). Renvoie un identifiant MMS en attente ; PlainApp sonde l'état d'envoi et rapporte le succès via des événements WebSocket. attachmentPaths doit pointer vers des fichiers du magasin AppFile de PlainApp (URI fid:).
mutation SendMms($number: String!, $body: String!, $attachmentPaths: [String!]!, $threadId: String!) {
sendMms(number: $number, body: $body, attachmentPaths: $attachmentPaths, threadId: $threadId)
}archiveConversation
Archive une conversation par identifiant de fil et date.
mutation ArchiveConversation($id: String!, $date: Long!) {
archiveConversation(id: $id, date: $date)
}unarchiveConversation
Retire une conversation de l'archive.
mutation UnarchiveConversation($id: String!) {
unarchiveConversation(id: $id)
}