receivers
Creates, updates, deletes, gets or lists a receivers resource.
Overview​
| Name | receivers |
| Type | Resource |
| Id | ovh.sms.receivers |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
slot_id | integer | Slot number id (wire: slotId) |
auto_update | boolean | Download file from URL before sending to contacts (works only with csvUrl and not document ID) (wire: autoUpdate) |
can_auto_update | boolean | Is the object compatible with autoUpdate (wire: canAutoUpdate) |
datetime | string (date-time) | Creation date of the document |
description | string | Description name of the document |
records | integer | Number of receiver records in the document |
Sms receivers preloaded
| Name | Datatype | Description |
|---|---|---|
slot_id | integer | Slot number id (wire: slotId) |
auto_update | boolean | Download file from URL before sending to contacts (works only with csvUrl and not document ID) (wire: autoUpdate) |
can_auto_update | boolean | Is the object compatible with autoUpdate (wire: canAutoUpdate) |
datetime | string (date-time) | Creation date of the document |
description | string | Description name of the document |
records | integer | Number of receiver records in the document |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, slot_id | Get a receiver list. Returns the receiver list: description, number of records and automatic update settings. | |
list | select | service_name | x_pagination_mode | List receiver lists. Returns the identifiers (slotId) of the receiver lists. A receiver list is a CSV or text document of numbers, used to send SMS in bulk. |
create | insert | service_name, auto_update, description, slot_id | Create a receiver list. Creates a receiver list from a CSV file, given as a /me/document identifier or a URL. With a URL, the file can be downloaded again before each sending. | |
update | update | service_name, slot_id | Update a receiver list. Updates the description of the receiver list and its automatic update, which downloads the file from its URL before each sending. | |
delete | delete | service_name, slot_id | Delete a receiver list. Deletes the receiver list. It can no longer be used as the receivers of an SMS sending (receiversSlotId). | |
clean | exec | serviceName, slotId, freemium, priceOnly | Clean a receiver list. Removes the invalid and inactive numbers from the receiver list, with an HLR lookup on each number. A report is sent by email at the end. |
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"}}) |
serviceName | string | The internal name of your SMS offer |
service_name | string | The internal name of your SMS offer (wire: serviceName) |
slotId | integer | Slot number id |
slot_id | integer | Slot number id (wire: slotId) |
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 receiver list. Returns the receiver list: description, number of records and automatic update settings.
SELECT
slot_id,
auto_update,
can_auto_update,
datetime,
description,
records
FROM ovh.sms.receivers
WHERE service_name = '{{ service_name }}' -- required
AND slot_id = '{{ slot_id }}' -- required
;
List receiver lists. Returns the identifiers (slotId) of the receiver lists. A receiver list is a CSV or text document of numbers, used to send SMS in bulk.
SELECT
slot_id,
auto_update,
can_auto_update,
datetime,
description,
records
FROM ovh.sms.receivers
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a receiver list. Creates a receiver list from a CSV file, given as a /me/document identifier or a URL. With a URL, the file can be downloaded again before each sending.
INSERT INTO ovh.sms.receivers (
auto_update,
csv_url,
description,
document_id,
slot_id,
service_name
)
SELECT
{{ auto_update }} /* required */,
'{{ csv_url }}',
'{{ description }}' /* required */,
'{{ document_id }}',
{{ slot_id }} /* required */,
'{{ service_name }}'
RETURNING
slot_id,
auto_update,
can_auto_update,
datetime,
description,
records
;
# Description fields are for documentation purposes
- name: receivers
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the receivers resource.
- name: auto_update
value: {{ auto_update }}
description: |
Download file from URL before sending to contacts (works only with csvUrl and not document ID)
- name: csv_url
value: "{{ csv_url }}"
description: |
URL of the file you want to import
- name: description
value: "{{ description }}"
description: |
Description name of the document
- name: document_id
value: "{{ document_id }}"
description: |
ID of the /me/document file you want to import
- name: slot_id
value: {{ slot_id }}
description: |
Slot number id used to handle the document
UPDATE examples​
- update
Update a receiver list. Updates the description of the receiver list and its automatic update, which downloads the file from its URL before each sending.
UPDATE ovh.sms.receivers
SET
auto_update = {{ auto_update }},
description = '{{ description }}'
WHERE
service_name = '{{ service_name }}' --required
AND slot_id = '{{ slot_id }}' --required;
DELETE examples​
- delete
Delete a receiver list. Deletes the receiver list. It can no longer be used as the receivers of an SMS sending (receiversSlotId).
DELETE FROM ovh.sms.receivers
WHERE service_name = '{{ service_name }}' --required
AND slot_id = '{{ slot_id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- clean
Clean a receiver list. Removes the invalid and inactive numbers from the receiver list, with an HLR lookup on each number. A report is sent by email at the end.
EXEC ovh.sms.receivers.clean
@serviceName='{{ serviceName }}' --required,
@slotId='{{ slotId }}' --required
@@json=
'{
"freemium": {{ freemium }},
"priceOnly": {{ priceOnly }}
}'
;