Skip to main content

users_receivers

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

Overview​

Nameusers_receivers
TypeResource
Idovh.sms.users_receivers

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
slot_idintegerSlot number id (wire: slotId)
auto_updatebooleanDownload file from URL before sending to contacts (works only with csvUrl and not document ID) (wire: autoUpdate)
can_auto_updatebooleanIs the object compatible with autoUpdate (wire: canAutoUpdate)
datetimestring (date-time)Creation date of the document
descriptionstringDescription name of the document
recordsintegerNumber of receiver records in the document

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlogin, service_name, slot_idGet a receiver list. Returns the receiver list: description, number of records and automatic update settings.
listselectlogin, service_namex_pagination_modeList 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.
createinsertlogin, service_name, auto_update, description, slot_idCreate 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.
updateupdatelogin, service_name, slot_idUpdate a receiver list. Updates the description of the receiver list and its automatic update, which downloads the file from its URL before each sending.
deletedeletelogin, service_name, slot_idDelete a receiver list. Deletes the receiver list. It can no longer be used as the receivers of an SMS sending (receiversSlotId).
cleanexeclogin, serviceName, slotId, freemium, priceOnlyClean 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.

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"}})
loginstringThe sms user login
serviceNamestringThe internal name of your SMS offer
service_namestringThe internal name of your SMS offer (wire: serviceName)
slotIdintegerSlot number id
slot_idintegerSlot number id (wire: slotId)
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 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.users_receivers
WHERE login = '{{ login }}' -- required
AND service_name = '{{ service_name }}' -- required
AND slot_id = '{{ slot_id }}' -- required
;

INSERT examples​

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.users_receivers (
auto_update,
csv_url,
description,
document_id,
slot_id,
login,
service_name
)
SELECT
{{ auto_update }} /* required */,
'{{ csv_url }}',
'{{ description }}' /* required */,
'{{ document_id }}',
{{ slot_id }} /* required */,
'{{ login }}',
'{{ service_name }}'
RETURNING
slot_id,
auto_update,
can_auto_update,
datetime,
description,
records
;

UPDATE examples​

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.users_receivers
SET
auto_update = {{ auto_update }},
description = '{{ description }}'
WHERE
login = '{{ login }}' --required
AND service_name = '{{ service_name }}' --required
AND slot_id = '{{ slot_id }}' --required;

DELETE examples​

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.users_receivers
WHERE login = '{{ login }}' --required
AND service_name = '{{ service_name }}' --required
AND slot_id = '{{ slot_id }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

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.users_receivers.clean
@login='{{ login }}' --required,
@serviceName='{{ serviceName }}' --required,
@slotId='{{ slotId }}' --required
@@json=
'{
"freemium": {{ freemium }},
"priceOnly": {{ priceOnly }}
}'
;