Kontakte
Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.
Typdefinitionen
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!
}Operationen
createContact
Erstellt einen neuen Kontakt.
mutation createContact($input: ContactInput!) {
createContact(input: $input) { id prefix firstName middleName lastName suffix nickname photoId }
}createContactGroup
Erstellt eine Kontaktgruppe in einem bestimmten Konto.
mutation createContactGroup($name: String!, $accountName: String!, $accountType: String!) {
createContactGroup(name: $name, accountName: $accountName, accountType: $accountType) { id name contactCount }
}deleteContactGroup
Löscht eine Kontaktgruppe. Die Kontakte bleiben erhalten und werden nur aus der Gruppe entfernt.
mutation deleteContactGroup($id: ID!) {
deleteContactGroup(id: $id)
}deleteContacts
Löscht alle Kontakte, die einer Abfrage entsprechen.
mutation deleteContacts($query: String!) {
deleteContacts(query: $query) { affectedCount }
}updateContact
Aktualisiert einen vorhandenen Kontakt. Nur übergebene Felder werden geändert.
mutation updateContact($id: ID!, $input: ContactInput!) {
updateContact(id: $id, input: $input) { id prefix firstName middleName lastName suffix nickname photoId }
}updateContactGroup
Benennt eine Kontaktgruppe um.
mutation updateContactGroup($id: ID!, $name: String!) {
updateContactGroup(id: $id, name: $name) { id name contactCount }
}contactCount
Zählt Kontakte, die einer Abfrage entsprechen.
query contactCount($query: String!) {
contactCount(query: $query)
}contactGroups
Listet alle Kontaktgruppen auf.
query contactGroups {
contactGroups { id name contactCount }
}contactSources
Listet verfügbare Kontaktkonten auf.
query contactSources {
contactSources { name type }
}contacts
Durchsucht Kontakte. query leer lassen, um alle aufzulisten.
query contacts($query: String!, $offset: Int!, $limit: Int!) {
contacts(query: $query, offset: $offset, limit: $limit) { id prefix firstName middleName lastName suffix nickname photoId }
}