Skip to main content

external_contacts

Creates, updates, deletes, gets or lists an external_contacts resource.

Overview​

Nameexternal_contacts
TypeResource
Idovh.email_pro.external_contacts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerContact id
task_pending_idintegerTask pending id (wire: taskPendingId)
display_namestringContact display name (wire: displayName)
first_namestringContact first name (wire: firstName)
last_namestringContact last name (wire: lastName)
creation_datestring (date-time)Creation date (wire: creationDate)
external_email_addressstringContact email (wire: externalEmailAddress)
hidden_from_galbooleanHide the contact in Global Address List (wire: hiddenFromGAL)
initialsstringContact initals
statestringContact state (creating, deleting, ok, reopening, suspended, suspending, unknown)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectexternal_email_address, serviceReturns the email address, names, state and Global Address List visibility of the external contact. (Alpha version)
listselectservicedisplay_name, external_email_address, first_name, id, last_name, x_pagination_modeReturns the email addresses of the external contacts of the service. Filter them by externalEmailAddress, firstName, lastName, displayName or id. (Alpha version)
createinsertservice, external_email_addressCreate an external contact. Creates a contact with an external email address in the service, and returns the task. Set hiddenFromGAL to true to hide it from the Global Address List.
updateupdateexternal_email_address, serviceUpdate an external contact. Updates the email address, names, initials and Global Address List visibility of the external contact.
deletedeleteexternal_email_address, serviceDelete an external contact. Removes the external contact from the address book of the Email Pro service and returns the task.

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
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
external_email_addressstringContact email (wire: externalEmailAddress)
servicestringThe internal name of your pro organization
display_namestringFilter the value of displayName property (like) (wire: displayName)
external_email_addressstringFilter the value of externalEmailAddress property (like) (wire: externalEmailAddress)
first_namestringFilter the value of firstName property (like) (wire: firstName)
idintegerFilter the value of id property (like)
last_namestringFilter the value of lastName property (like) (wire: lastName)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Returns the email address, names, state and Global Address List visibility of the external contact. (Alpha version)

SELECT
id,
task_pending_id,
display_name,
first_name,
last_name,
creation_date,
external_email_address,
hidden_from_gal,
initials,
state
FROM ovh.email_pro.external_contacts
WHERE external_email_address = '{{ external_email_address }}' -- required
AND service = '{{ service }}' -- required
;

INSERT examples​

Create an external contact. Creates a contact with an external email address in the service, and returns the task. Set hiddenFromGAL to true to hide it from the Global Address List.

INSERT INTO ovh.email_pro.external_contacts (
display_name,
external_email_address,
first_name,
hidden_from_gal,
initials,
last_name,
service
)
SELECT
'{{ display_name }}',
'{{ external_email_address }}' /* required */,
'{{ first_name }}',
{{ hidden_from_gal }},
'{{ initials }}',
'{{ last_name }}',
'{{ service }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

UPDATE examples​

Update an external contact. Updates the email address, names, initials and Global Address List visibility of the external contact.

UPDATE ovh.email_pro.external_contacts
SET
display_name = '{{ display_name }}',
external_email_address = '{{ external_email_address }}',
first_name = '{{ first_name }}',
hidden_from_gal = {{ hidden_from_gal }},
initials = '{{ initials }}',
last_name = '{{ last_name }}'
WHERE
external_email_address = '{{ external_email_address }}' --required
AND service = '{{ service }}' --required;

DELETE examples​

Delete an external contact. Removes the external contact from the address book of the Email Pro service and returns the task.

DELETE FROM ovh.email_pro.external_contacts
WHERE external_email_address = '{{ external_email_address }}' --required
AND service = '{{ service }}' --required
;