Skip to main content

line_phone_phonebooks

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

Overview​

Nameline_phone_phonebooks
TypeResource
Idovh.telephony.line_phone_phonebooks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringPhonebook name
book_keystringIdentifier of the phonebook (wire: bookKey)
is_readonlybooleanSet if phonebook is readonly (wire: isReadonly)
phone_keystringPhone key identifier between the phone and phonebooks (wire: phoneKey)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbilling_account, book_key, service_nameGet a phonebook
listselectbilling_account, service_namex_pagination_modeList phonebooks
createinsertbilling_account, service_name, nameCreate a phonebook
updateupdatebilling_account, book_key, service_nameUpdate a phonebook
deletedeletebilling_account, book_key, service_nameDelete a phonebook
importexecbillingAccount, bookKey, serviceName, documentIdImport contacts

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"}})
billingAccountstringThe name of your billingAccount
billing_accountstringThe name of your billingAccount (wire: billingAccount)
bookKeystringIdentifier of the phonebook
book_keystringIdentifier of the phonebook (wire: bookKey)
serviceNamestring
service_namestring (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 phonebook

SELECT
name,
book_key,
is_readonly,
phone_key
FROM ovh.telephony.line_phone_phonebooks
WHERE billing_account = '{{ billing_account }}' -- required
AND book_key = '{{ book_key }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a phonebook

INSERT INTO ovh.telephony.line_phone_phonebooks (
name,
billing_account,
service_name
)
SELECT
'{{ name }}' /* required */,
'{{ billing_account }}',
'{{ service_name }}'
;

UPDATE examples​

Update a phonebook

UPDATE ovh.telephony.line_phone_phonebooks
SET
is_readonly = {{ is_readonly }},
name = '{{ name }}'
WHERE
billing_account = '{{ billing_account }}' --required
AND book_key = '{{ book_key }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a phonebook

DELETE FROM ovh.telephony.line_phone_phonebooks
WHERE billing_account = '{{ billing_account }}' --required
AND book_key = '{{ book_key }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Import contacts

EXEC ovh.telephony.line_phone_phonebooks.import
@billingAccount='{{ billingAccount }}' --required,
@bookKey='{{ bookKey }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"documentId": "{{ documentId }}"
}'
;