phonebooks
Creates, updates, deletes, gets or lists a phonebooks resource.
Overview​
| Name | phonebooks |
| Type | Resource |
| Id | ovh.sms.phonebooks |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Phonebook name |
book_key | string | Identifier of the phonebook (wire: bookKey) |
phone_key | string | Phone key identifier between the phone and phonebooks (wire: phoneKey) |
Phone book
| Name | Datatype | Description |
|---|---|---|
name | string | Phonebook name |
book_key | string | Identifier of the phonebook (wire: bookKey) |
phone_key | string | Phone key identifier between the phone and phonebooks (wire: phoneKey) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | book_key, service_name | Get a phonebook. Returns the name and the identifier (bookKey) of the phonebook. Its contacts are listed with the phonebookContact route. | |
list | select | service_name | x_pagination_mode | List phonebooks. Returns the identifiers (bookKey) of the phonebooks of the SMS account. A phonebook stores contacts with their phone numbers. |
create | insert | service_name, name | Create a phonebook. Creates a phonebook with a name. Returns its identifier (bookKey), used to add or import contacts. | |
update | update | book_key, service_name | Update a phonebook. Updates the name of the phonebook. The contacts are updated one by one with the phonebookContact route. | |
delete | delete | book_key, service_name | Delete a phonebook. Deletes the phonebook and its contacts. Export the contacts first to keep a copy of them. | |
import | exec | bookKey, serviceName, documentId | Import contacts. Imports contacts into the phonebook from an Excel (.xls, .xlsx) or CSV file in /me/document. Returns the task that performs the import. |
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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
bookKey | string | Identifier of the phonebook |
book_key | string | Identifier of the phonebook (wire: bookKey) |
serviceName | string | The internal name of your SMS offer |
service_name | string | The internal name of your SMS offer (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Get a phonebook. Returns the name and the identifier (bookKey) of the phonebook. Its contacts are listed with the phonebookContact route.
SELECT
name,
book_key,
phone_key
FROM ovh.sms.phonebooks
WHERE book_key = '{{ book_key }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List phonebooks. Returns the identifiers (bookKey) of the phonebooks of the SMS account. A phonebook stores contacts with their phone numbers.
SELECT
name,
book_key,
phone_key
FROM ovh.sms.phonebooks
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a phonebook. Creates a phonebook with a name. Returns its identifier (bookKey), used to add or import contacts.
INSERT INTO ovh.sms.phonebooks (
name,
service_name
)
SELECT
'{{ name }}' /* required */,
'{{ service_name }}'
;
# Description fields are for documentation purposes
- name: phonebooks
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the phonebooks resource.
- name: name
value: "{{ name }}"
description: |
Name of the wanted phonebook
UPDATE examples​
- update
Update a phonebook. Updates the name of the phonebook. The contacts are updated one by one with the phonebookContact route.
UPDATE ovh.sms.phonebooks
SET
name = '{{ name }}'
WHERE
book_key = '{{ book_key }}' --required
AND service_name = '{{ service_name }}' --required;
DELETE examples​
- delete
Delete a phonebook. Deletes the phonebook and its contacts. Export the contacts first to keep a copy of them.
DELETE FROM ovh.sms.phonebooks
WHERE book_key = '{{ book_key }}' --required
AND service_name = '{{ service_name }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- import
Import contacts. Imports contacts into the phonebook from an Excel (.xls, .xlsx) or CSV file in /me/document. Returns the task that performs the import.
EXEC ovh.sms.phonebooks.import
@bookKey='{{ bookKey }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"documentId": "{{ documentId }}"
}'
;