Skip to main content

contacts

Creates, updates, deletes, gets or lists a contacts resource.

Overview

Namecontacts
TypeResource
Idgoogle.essentialcontacts.contacts

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The identifier for the contact. Format: {resource_type}/{resource_id}/contacts/{contact_id}
emailstringRequired. The email address to send notifications to. The email address does not need to be a Google Account.
languageTagstringRequired. The preferred language for notifications, as a ISO 639-1 language code. See Supported languages for a list of supported languages.
notificationCategorySubscriptionsarrayRequired. The categories of notifications that the contact will receive communications for.
validateTimestring (google-datetime)Output only. The last time the validation_state was updated, either manually or automatically. A contact is considered stale if its validation state was updated more than 1 year ago.
validationStatestringOutput only. The validity of the contact. A contact is considered valid if it is the correct recipient for notifications for a particular resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_contacts_getselectprojectsId, contactsIdGets a single contact.
folders_contacts_getselectfoldersId, contactsIdGets a single contact.
organizations_contacts_getselectorganizationsId, contactsIdGets a single contact.
projects_contacts_listselectprojectsIdpageSize, pageTokenLists the contacts that have been set on a resource.
folders_contacts_listselectfoldersIdpageSize, pageTokenLists the contacts that have been set on a resource.
organizations_contacts_listselectorganizationsIdpageSize, pageTokenLists the contacts that have been set on a resource.
projects_contacts_createinsertprojectsIdAdds a new contact for a resource.
folders_contacts_createinsertfoldersIdAdds a new contact for a resource.
organizations_contacts_createinsertorganizationsIdAdds a new contact for a resource.
projects_contacts_patchupdateprojectsId, contactsIdupdateMaskUpdates a contact. Note: A contact's email address cannot be changed.
folders_contacts_patchupdatefoldersId, contactsIdupdateMaskUpdates a contact. Note: A contact's email address cannot be changed.
organizations_contacts_patchupdateorganizationsId, contactsIdupdateMaskUpdates a contact. Note: A contact's email address cannot be changed.
projects_contacts_deletedeleteprojectsId, contactsIdDeletes a contact.
folders_contacts_deletedeletefoldersId, contactsIdDeletes a contact.
organizations_contacts_deletedeleteorganizationsId, contactsIdDeletes a contact.
projects_contacts_computeexecprojectsIdnotificationCategories, pageSize, pageTokenLists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.
projects_contacts_send_test_messageexecprojectsIdAllows a contact admin to send a test message to contact to verify that it has been configured correctly.
folders_contacts_computeexecfoldersIdnotificationCategories, pageSize, pageTokenLists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.
folders_contacts_send_test_messageexecfoldersIdAllows a contact admin to send a test message to contact to verify that it has been configured correctly.
organizations_contacts_computeexecorganizationsIdnotificationCategories, pageSize, pageTokenLists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.
organizations_contacts_send_test_messageexecorganizationsIdAllows a contact admin to send a test message to contact to verify that it has been configured correctly.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
contactsIdstring
foldersIdstring
organizationsIdstring
projectsIdstring
notificationCategoriesstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a single contact.

SELECT
name,
email,
languageTag,
notificationCategorySubscriptions,
validateTime,
validationState
FROM google.essentialcontacts.contacts
WHERE projectsId = '{{ projectsId }}' -- required
AND contactsId = '{{ contactsId }}' -- required;

INSERT examples

Adds a new contact for a resource.

INSERT INTO google.essentialcontacts.contacts (
data__email,
data__notificationCategorySubscriptions,
data__languageTag,
projectsId
)
SELECT
'{{ email }}',
'{{ notificationCategorySubscriptions }}',
'{{ languageTag }}',
'{{ projectsId }}'
RETURNING
name,
email,
languageTag,
notificationCategorySubscriptions,
validateTime,
validationState
;

UPDATE examples

Updates a contact. Note: A contact's email address cannot be changed.

UPDATE google.essentialcontacts.contacts
SET
data__email = '{{ email }}',
data__notificationCategorySubscriptions = '{{ notificationCategorySubscriptions }}',
data__languageTag = '{{ languageTag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND contactsId = '{{ contactsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
email,
languageTag,
notificationCategorySubscriptions,
validateTime,
validationState;

DELETE examples

Deletes a contact.

DELETE FROM google.essentialcontacts.contacts
WHERE projectsId = '{{ projectsId }}' --required
AND contactsId = '{{ contactsId }}' --required;

Lifecycle Methods

Lists all contacts for the resource that are subscribed to the specified notification categories, including contacts inherited from any parent resources.

EXEC google.essentialcontacts.contacts.projects_contacts_compute 
@projectsId='{{ projectsId }}' --required,
@notificationCategories='{{ notificationCategories }}',
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}';