Skip to main content

phonebooks_phonebook_contacts

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

Overview​

Namephonebooks_phonebook_contacts
TypeResource
Idovh.sms.phonebooks_phonebook_contacts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerContact identifier
namestringContact name
groupstringGroup name of the phonebook
home_mobilestring (phone-number)Home mobile phone number of the contact (wire: homeMobile)
home_phonestring (phone-number)Home landline phone number of the contact (wire: homePhone)
surnamestringContact surname
work_mobilestring (phone-number)Mobile phone office number of the contact (wire: workMobile)
work_phonestring (phone-number)Landline phone office number of the contact (wire: workPhone)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbook_key, id, service_nameGet a contact. Returns the contact: name, surname, group, and office and home phone numbers, landline and mobile.
listselectbook_key, service_namex_pagination_modeList contacts. Returns the identifiers of the contacts of the phonebook. Get a contact for its name, group and phone numbers.
createinsertbook_key, service_name, group, name, surnameCreate a contact. Creates a contact in the phonebook with a name, surname, group and phone numbers. Returns its identifier.
updateupdatebook_key, id, service_nameUpdate a contact. Updates the contact: name, surname, group, and office and home phone numbers, landline and mobile.
deletedeletebook_key, id, service_nameDelete a contact. Deletes the contact from the phonebook, with its name, group and office and home phone numbers.

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"}})
book_keystringIdentifier of the phonebook (wire: bookKey)
idintegerContact identifier
service_namestringThe internal name of your SMS offer (wire: serviceName)
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​

Get a contact. Returns the contact: name, surname, group, and office and home phone numbers, landline and mobile.

SELECT
id,
name,
group,
home_mobile,
home_phone,
surname,
work_mobile,
work_phone
FROM ovh.sms.phonebooks_phonebook_contacts
WHERE book_key = '{{ book_key }}' -- required
AND id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a contact. Creates a contact in the phonebook with a name, surname, group and phone numbers. Returns its identifier.

INSERT INTO ovh.sms.phonebooks_phonebook_contacts (
group,
home_mobile,
home_phone,
name,
surname,
work_mobile,
work_phone,
book_key,
service_name
)
SELECT
'{{ group }}' /* required */,
'{{ home_mobile }}',
'{{ home_phone }}',
'{{ name }}' /* required */,
'{{ surname }}' /* required */,
'{{ work_mobile }}',
'{{ work_phone }}',
'{{ book_key }}',
'{{ service_name }}'
;

UPDATE examples​

Update a contact. Updates the contact: name, surname, group, and office and home phone numbers, landline and mobile.

UPDATE ovh.sms.phonebooks_phonebook_contacts
SET
group = '{{ group }}',
home_mobile = '{{ home_mobile }}',
home_phone = '{{ home_phone }}',
name = '{{ name }}',
surname = '{{ surname }}',
work_mobile = '{{ work_mobile }}',
work_phone = '{{ work_phone }}'
WHERE
book_key = '{{ book_key }}' --required
AND id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a contact. Deletes the contact from the phonebook, with its name, group and office and home phone numbers.

DELETE FROM ovh.sms.phonebooks_phonebook_contacts
WHERE book_key = '{{ book_key }}' --required
AND id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;