Skip to main content

senders

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

Overview​

Namesenders
TypeResource
Idovh.sms.senders

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
commentstringMessage sent by the moderator
descriptionstringSender description
refererstringSpecify if the sender is custom or not (custom, domain, line, nic, owner, virtual)
senderstringThe sms sender
statusstringSender status (disable, enable, refused, waitingValidation)
typestringSpecify the kind of sender (alpha, numeric, shortcode, time2chat, virtual)
validation_mediastringValidation media identifier (wire: validationMedia)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsender, service_nameGet a sender. Returns the sender: status (enable, disable, waitingValidation or refused), type, description and the comment of the moderator.
listselectservice_namex_pagination_modeList senders. Returns the senders of the account. A sender is the name or number shown to receivers, and must be validated before it can be used.
createinsertservice_name, senderCreate a sender. Creates a sender (alphanumeric or phone number). The sender is moderated before it can be used.
updateupdatesender, service_nameUpdate a sender. Updates the sender description and its status, to enable or disable a validated sender.
deletedeletesender, service_nameDelete a sender. Deletes the sender. It can no longer be used as the name or number shown to the receivers of the SMS sent.
validateexecsender, serviceName, codeValidate a sender. Validates the sender with the validation code received. Once validated, the sender can be used to send SMS.

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"}})
senderstringThe sms sender
serviceNamestringThe internal name of your SMS offer
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 sender. Returns the sender: status (enable, disable, waitingValidation or refused), type, description and the comment of the moderator.

SELECT
comment,
description,
referer,
sender,
status,
type,
validation_media
FROM ovh.sms.senders
WHERE sender = '{{ sender }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Create a sender. Creates a sender (alphanumeric or phone number). The sender is moderated before it can be used.

INSERT INTO ovh.sms.senders (
description,
reason,
sender,
service_name
)
SELECT
'{{ description }}',
'{{ reason }}',
'{{ sender }}' /* required */,
'{{ service_name }}'
;

UPDATE examples​

Update a sender. Updates the sender description and its status, to enable or disable a validated sender.

UPDATE ovh.sms.senders
SET
description = '{{ description }}',
status = '{{ status }}'
WHERE
sender = '{{ sender }}' --required
AND service_name = '{{ service_name }}' --required;

DELETE examples​

Delete a sender. Deletes the sender. It can no longer be used as the name or number shown to the receivers of the SMS sent.

DELETE FROM ovh.sms.senders
WHERE sender = '{{ sender }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Validate a sender. Validates the sender with the validation code received. Once validated, the sender can be used to send SMS.

EXEC ovh.sms.senders.validate
@sender='{{ sender }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"code": "{{ code }}"
}'
;