API संदर्भ

संपर्क

सुविधा समर्थन के लिए app.capabilities और प्राधिकरण के लिए app.access तथा होस्ट अनुमतियाँ जाँचें। उदाहरण कृत्रिम मान उपयोग करते हैं; कॉल करने से पहले पथ, ID, इनपुट और फ़िल्टर बदलें।

प्रकार परिभाषाएँ

graphql
type Mutation {
  createContact(input: ContactInput!): Contact!
  createContactGroup(name: String!, accountName: String!, accountType: String!): ContactGroup!
  deleteContactGroup(id: ID!): Boolean!
  deleteContacts(query: String!): ActionResult!
  updateContact(id: ID!, input: ContactInput!): Contact!
  updateContactGroup(id: ID!, name: String!): ContactGroup!
}

type Query {
  contactCount(query: String!): Int!
  contactGroups: [ContactGroup!]!
  contactSources: [ContactSource!]!
  contacts(query: String!, offset: Int!, limit: Int!): [Contact!]!
}

type ActionResult {
	affectedCount: Int!
}

type Contact {
	id: ID!
	prefix: String!
	firstName: String!
	middleName: String!
	lastName: String!
	suffix: String!
	nickname: String!
	photoId: String!
	phoneNumbers: [ContactPhoneNumber!]!
	emails: [ContactEmail!]!
	addresses: [ContactAddress!]!
	events: [ContactEvent!]!
	source: String!
	starred: Boolean!
	contactId: ID!
	thumbnailId: String!
	notes: String!
	groups: [ContactGroup!]!
	organization: ContactOrganization
	websites: [ContactWebsite!]!
	ims: [ContactIm!]!
	ringtone: String!
	updatedAt: Instant!
	tags: [Tag!]!
}

type ContactAddress {
	typeCode: Int!
	value: String!
	type: ContactPostalType!
	label: String!
}

input ContactAddressInput {
	value: String!
	type: ContactPostalType!
	label: String!
}

type ContactEmail {
	typeCode: Int!
	value: String!
	type: ContactEmailType!
	label: String!
}

input ContactEmailInput {
	value: String!
	type: ContactEmailType!
	label: String!
}

enum ContactEmailType {
	CUSTOM
	HOME
	WORK
	OTHER
	MOBILE
}

type ContactEvent {
	typeCode: Int!
	value: String!
	type: ContactEventType!
	label: String!
}

input ContactEventInput {
	value: String!
	type: ContactEventType!
	label: String!
}

enum ContactEventType {
	CUSTOM
	ANNIVERSARY
	BIRTHDAY
	OTHER
}

type ContactGroup {
	id: ID!
	name: String!
	contactCount: Int!
}

type ContactIm {
	typeCode: Int!
	value: String!
	protocol: ContactImProtocol!
	customProtocol: String!
}

input ContactImInput {
	value: String!
	protocol: ContactImProtocol!
	customProtocol: String!
}

enum ContactImProtocol {
	CUSTOM
	AIM
	MSN
	YAHOO
	SKYPE
	QQ
	GOOGLE_TALK
	ICQ
	JABBER
	NETMEETING
}

input ContactInput {
	prefix: String!
	firstName: String!
	middleName: String!
	lastName: String!
	suffix: String!
	nickname: String!
	phoneNumbers: [ContactPhoneInput!]!
	emails: [ContactEmailInput!]!
	addresses: [ContactAddressInput!]!
	events: [ContactEventInput!]!
	source: String!
	starred: Boolean!
	notes: String!
	groupIds: [ID!]!
	organization: ContactOrganizationInput
	websites: [ContactWebsiteInput!]!
	ims: [ContactImInput!]!
}

type ContactOrganization {
	company: String!
	title: String!
}

input ContactOrganizationInput {
	company: String!
	title: String!
}

input ContactPhoneInput {
	value: String!
	type: ContactPhoneType!
	label: String!
}

type ContactPhoneNumber {
	typeCode: Int!
	value: String!
	type: ContactPhoneType!
	label: String!
	normalizedNumber: String!
}

enum ContactPhoneType {
	CUSTOM
	HOME
	MOBILE
	WORK
	FAX_WORK
	FAX_HOME
	PAGER
	OTHER
	CALLBACK
	CAR
	COMPANY_MAIN
	ISDN
	MAIN
	OTHER_FAX
	RADIO
	TELEX
	TTY_TDD
	WORK_MOBILE
	WORK_PAGER
	ASSISTANT
}

enum ContactPostalType {
	CUSTOM
	HOME
	WORK
	OTHER
}

type ContactSource {
	name: String!
	type: String!
}

type ContactWebsite {
	typeCode: Int!
	value: String!
	type: ContactWebsiteType!
	label: String!
}

input ContactWebsiteInput {
	value: String!
	type: ContactWebsiteType!
	label: String!
}

enum ContactWebsiteType {
	CUSTOM
	HOMEPAGE
	BLOG
	FTP
	HOME
	WORK
	OTHER
}

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

scalar Instant

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

ऑपरेशन

mutation

createContact

नया संपर्क बनाएँ।

graphql
mutation createContact($input: ContactInput!) {
  createContact(input: $input) { id prefix firstName middleName lastName suffix nickname photoId }
}
mutation

createContactGroup

किसी विशिष्ट खाते में संपर्क समूह बनाएँ।

graphql
mutation createContactGroup($name: String!, $accountName: String!, $accountType: String!) {
  createContactGroup(name: $name, accountName: $accountName, accountType: $accountType) { id name contactCount }
}
mutation

deleteContactGroup

संपर्क समूह मिटाएँ। समूह के संपर्क नहीं मिटते, केवल समूह से अलग होते हैं।

graphql
mutation deleteContactGroup($id: ID!) {
  deleteContactGroup(id: $id)
}
mutation

deleteContacts

क्वेरी से मेल खाने वाले सभी संपर्क मिटाएँ।

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

updateContact

मौजूदा संपर्क अपडेट करें। केवल दिए गए फ़ील्ड बदलते हैं।

graphql
mutation updateContact($id: ID!, $input: ContactInput!) {
  updateContact(id: $id, input: $input) { id prefix firstName middleName lastName suffix nickname photoId }
}
mutation

updateContactGroup

संपर्क समूह का नाम बदलें।

graphql
mutation updateContactGroup($id: ID!, $name: String!) {
  updateContactGroup(id: $id, name: $name) { id name contactCount }
}
query

contactCount

क्वेरी से मेल खाने वाले संपर्क गिनें।

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

contactGroups

सभी संपर्क समूह सूचीबद्ध करें।

graphql
query contactGroups {
  contactGroups { id name contactCount }
}
query

contactSources

उपलब्ध संपर्क खाता स्रोत सूचीबद्ध करें।

graphql
query contactSources {
  contactSources { name type }
}
query

contacts

संपर्क खोजें। सब सूचीबद्ध करने के लिए query खाली छोड़ें।

graphql
query contacts($query: String!, $offset: Int!, $limit: Int!) {
  contacts(query: $query, offset: $offset, limit: $limit) { id prefix firstName middleName lastName suffix nickname photoId }
}