API Referansı

SMS

SMS and MMS APIs.

Tip Tanımları

graphql
type Subscription {
  smsChanged: SmsProviderChange
  smsSendResult: SmsSendResult!
}

type Mutation {
  archiveSmsConversation(id: ID!, date: Instant): Boolean!
  deleteSms(query: String!): ActionResult!
  restoreSms(query: String!): ActionResult!
  sendSms(number: String!, body: String!, attachmentPaths: [String!]! = [], subscriptionId: Int, requestId: String!): SmsSendReceipt!
  trashSms(query: String!): ActionResult!
  unarchiveSmsConversation(id: ID!): Boolean!
}

type Query {
  archivedSmsConversations(query: String!, offset: Int!, limit: Int!): [SmsConversation!]!
  sims: [Sim!]!
  sms(query: String!, offset: Int!, limit: Int!): [Sms!]!
  smsBoxCounts: SmsCounts!
  smsConversationCount(query: String!): Int!
  smsConversations(query: String!, offset: Int!, limit: Int!): [SmsConversation!]!
  smsCount(query: String!): Int!
}

type ActionResult {
	affectedCount: Int!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

scalar Instant

type Sim {
	id: ID!
	label: String!
	number: String!
	subscriptionId: Int!
}

type Sms {
	id: ID!
	body: String!
	address: String!
	sentAt: Instant!
	serviceCenter: String!
	read: Boolean!
	threadId: ID!
	type: SmsType!
	typeCode: Int!
	subscriptionId: Int!
	isMms: Boolean!
	attachments: [SmsAttachment!]!
	tags: [Tag!]!
}

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

type SmsConversation {
	id: ID!
	address: String!
	snippet: String!
	lastMessageAt: Instant!
	messageCount: Int!
	read: Boolean!
	addresses: [String!]!
}

type SmsCounts {
	total: Int!
	inbox: Int!
	sent: Int!
	drafts: Int!
}

type SmsProviderChange {
	uris: [String!]!
}

type SmsSendReceipt {
	requestId: String!
	requiresConfirmation: Boolean!
}

type SmsSendResult {
	requestId: String!
	success: Boolean!
	resultCode: Int
}

enum SmsType {
	INBOX
	SENT
	DRAFT
	OUTBOX
	FAILED
	QUEUED
	UNKNOWN
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

İşlemler

subscription

smsChanged

Cihazdaki SMS’ler değiştiğinde istemciye listeyi yenilemesini bildirir. Mesaj içeriğini döndürmez.

graphql
subscription smsChanged {
  smsChanged { uris }
}
subscription

smsSendResult

SMS/MMS gönderim sonuçlarını alın ve requestId ile eşleştirin. Sonuç için success kullanın: SMS başarısı -1; MMS başarısı 0, zaman aşımı -1000, iptal -1001 değerindedir. Başarılı gönderim teslimatı doğrulamaz.

graphql
subscription smsSendResult {
  smsSendResult { requestId success resultCode }
}
mutation

archiveSmsConversation

İleti görüşmesini arşivler, isteğe bağlı olarak arşiv tarihini kaydeder.

graphql
mutation archiveSmsConversation($id: ID!, $date: Instant) {
  archiveSmsConversation(id: $id, date: $date)
}
mutation

deleteSms

Sorguya uyan SMS iletilerini kalıcı siler.

graphql
mutation deleteSms($query: String!) {
  deleteSms(query: $query) { affectedCount }
}
mutation

restoreSms

Sorguya uyan çöpteki SMS iletilerini geri yükler.

graphql
mutation restoreSms($query: String!) {
  restoreSms(query: $query) { affectedCount }
}
mutation

sendSms

SMS gönderin veya eklerle birlikte telefonun MMS düzenleyicisini açın.

graphql
mutation sendSms($number: String!, $body: String!, $attachmentPaths: [String!]!, $subscriptionId: Int, $requestId: String!) {
  sendSms(number: $number, body: $body, attachmentPaths: $attachmentPaths, subscriptionId: $subscriptionId, requestId: $requestId) { requestId requiresConfirmation }
}
mutation

trashSms

Sorguya uyan SMS iletilerini çöpe taşır.

graphql
mutation trashSms($query: String!) {
  trashSms(query: $query) { affectedCount }
}
mutation

unarchiveSmsConversation

Görüşmenin arşivlenmiş durumunu kaldırır.

graphql
mutation unarchiveSmsConversation($id: ID!) {
  unarchiveSmsConversation(id: $id)
}
query

archivedSmsConversations

Arşivlenmiş SMS görüşmelerini sayfalı arar.

graphql
query archivedSmsConversations($query: String!, $offset: Int!, $limit: Int!) {
  archivedSmsConversations(query: $query, offset: $offset, limit: $limit) { id address snippet lastMessageAt messageCount read addresses }
}
query

sims

Cihazdaki kullanılabilir SIM kartları ve telefon hesaplarını listeler.

graphql
query sims {
  sims { id label number subscriptionId }
}
query

sms

SMS iletilerini arar. Tümünü listelemek için query olarak boş dize kullanın.

graphql
query sms($query: String!, $offset: Int!, $limit: Int!) {
  sms(query: $query, offset: $offset, limit: $limit) { id body address sentAt serviceCenter read threadId type }
}
query

smsBoxCounts

Mevcut SMS kutularının ileti sayılarını okur.

graphql
query smsBoxCounts {
  smsBoxCounts { total inbox sent drafts }
}
query

smsConversationCount

Sorguya uyan SMS görüşmelerini sayar.

graphql
query smsConversationCount($query: String!) {
  smsConversationCount(query: $query)
}
query

smsConversations

SMS görüşmelerini (ileti dizilerini) sayfalı listeler.

graphql
query smsConversations($query: String!, $offset: Int!, $limit: Int!) {
  smsConversations(query: $query, offset: $offset, limit: $limit) { id address snippet lastMessageAt messageCount read addresses }
}
query

smsCount

Sorguya uyan SMS iletilerini sayar.

graphql
query smsCount($query: String!) {
  smsCount(query: $query)
}