Skip to main content

contacts

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

Overview

Namecontacts
TypeResource
Idgoogle.essentialcontacts.contacts

Fields

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.
validateTimestringThe 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

NameAccessible byRequired ParamsDescription
folders_contacts_getSELECTcontactsId, foldersIdGets a single contact.
folders_contacts_listSELECTfoldersIdLists the contacts that have been set on a resource.
organizations_contacts_getSELECTcontactsId, organizationsIdGets a single contact.
organizations_contacts_listSELECTorganizationsIdLists the contacts that have been set on a resource.
projects_contacts_getSELECTcontactsId, projectsIdGets a single contact.
projects_contacts_listSELECTprojectsIdLists the contacts that have been set on a resource.
folders_contacts_createINSERTfoldersIdAdds a new contact for a resource.
organizations_contacts_createINSERTorganizationsIdAdds a new contact for a resource.
projects_contacts_createINSERTprojectsIdAdds a new contact for a resource.
folders_contacts_deleteDELETEcontactsId, foldersIdDeletes a contact.
organizations_contacts_deleteDELETEcontactsId, organizationsIdDeletes a contact.
projects_contacts_deleteDELETEcontactsId, projectsIdDeletes a contact.
folders_contacts_patchUPDATEcontactsId, foldersIdUpdates a contact. Note: A contact's email address cannot be changed.
organizations_contacts_patchUPDATEcontactsId, organizationsIdUpdates a contact. Note: A contact's email address cannot be changed.
projects_contacts_patchUPDATEcontactsId, projectsIdUpdates a contact. Note: A contact's email address cannot be changed.
folders_contacts_computeEXECfoldersIdLists 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_computeEXECorganizationsIdLists 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.
projects_contacts_computeEXECprojectsIdLists 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.

SELECT examples

Lists the contacts that have been set on a resource.

SELECT
name,
email,
languageTag,
notificationCategorySubscriptions,
validateTime,
validationState
FROM google.essentialcontacts.contacts
WHERE foldersId = '{{ foldersId }}';

INSERT example

Use the following StackQL query and manifest file to create a new contacts resource.

/*+ create */
INSERT INTO google.essentialcontacts.contacts (
foldersId,
email,
notificationCategorySubscriptions,
validateTime,
languageTag
)
SELECT
'{{ foldersId }}',
'{{ email }}',
'{{ notificationCategorySubscriptions }}',
'{{ validateTime }}',
'{{ languageTag }}'
;

UPDATE example

Updates a contacts resource.

/*+ update */
UPDATE google.essentialcontacts.contacts
SET
email = '{{ email }}',
notificationCategorySubscriptions = '{{ notificationCategorySubscriptions }}',
validateTime = '{{ validateTime }}',
languageTag = '{{ languageTag }}'
WHERE
contactsId = '{{ contactsId }}'
AND foldersId = '{{ foldersId }}';

DELETE example

Deletes the specified contacts resource.

/*+ delete */
DELETE FROM google.essentialcontacts.contacts
WHERE contactsId = '{{ contactsId }}'
AND foldersId = '{{ foldersId }}';