Skip to main content

accounts

Creates, updates, deletes, gets or lists an accounts resource.

Overview​

Nameaccounts
TypeResource
Idovh.sms.accounts

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestring
automatic_recredit_amountintegerPack quantity automatic recredit possibilities (100, 200, 250, 500, 1000, 5000, 10000) (wire: automaticRecreditAmount)
call_backstringURL called when state of a sent SMS changes (wire: callBack)
channelstringFor what purpose this account can be used for (both, marketing, transactional)
credit_threshold_for_automatic_recreditnumberCredit threshold after which an automatic recredit is launched (wire: creditThresholdForAutomaticRecredit)
credits_hold_by_quotanumber (wire: creditsHoldByQuota)
credits_leftnumber (wire: creditsLeft)
descriptionstring
iamobjectIAM resource metadata
smppbooleanWhether the account can be used for smpp or not
sms_responseobjectA structure describing how to manage an sms Response (wire: smsResponse)
statusstringAccount status (disable, enable)
stop_call_backstringURL called when a STOP is received after a receiver replied stop to a SMS (wire: stopCallBack)
templatesobjectA structure describing all information about templates informations
user_quantity_with_quotainteger (wire: userQuantityWithQuota)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameGet an SMS account. Returns the SMS account: status, credits left, callback URLs, automatic recredit settings and channel.
listselectiam_tags, x_pagination_modeList SMS accounts. Returns the service names of the SMS accounts of the customer. Get an SMS account for its status, credits left and settings.
updateupdateservice_nameUpdate an SMS account. Updates the SMS account settings, such as the callback URLs, the templates and the automatic recredit.
estimateexecmessage, noStopClause, senderTypeEstimate a message. Returns the encoding, the length and the number of SMS parts needed to send a text message.
smpp_passwordexecserviceNameGenerates a new password for the SMPP account.
transfer_creditsexecserviceName, credits, smsAccountTargetTransfer credits. Transfers an amount of credits from this SMS account to another SMS account, given by its service name.

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"}})
serviceNamestringThe internal name of your SMS offer
service_namestringThe internal name of your SMS offer (wire: serviceName)
iam_tagsobjectFilter resources on IAM tags (wire: iamTags)
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 an SMS account. Returns the SMS account: status, credits left, callback URLs, automatic recredit settings and channel.

SELECT
name,
automatic_recredit_amount,
call_back,
channel,
credit_threshold_for_automatic_recredit,
credits_hold_by_quota,
credits_left,
description,
iam,
smpp,
sms_response,
status,
stop_call_back,
templates,
user_quantity_with_quota
FROM ovh.sms.accounts
WHERE service_name = '{{ service_name }}' -- required
;

UPDATE examples​

Update an SMS account. Updates the SMS account settings, such as the callback URLs, the templates and the automatic recredit.

UPDATE ovh.sms.accounts
SET
automatic_recredit_amount = {{ automatic_recredit_amount }},
call_back = '{{ call_back }}',
credit_threshold_for_automatic_recredit = {{ credit_threshold_for_automatic_recredit }},
description = '{{ description }}',
sms_response = '{{ sms_response }}',
stop_call_back = '{{ stop_call_back }}',
templates = '{{ templates }}'
WHERE
service_name = '{{ service_name }}' --required;

Lifecycle Methods​

EXEC variables use wire (API) names.

Estimate a message. Returns the encoding, the length and the number of SMS parts needed to send a text message.

EXEC ovh.sms.accounts.estimate
@@json=
'{
"message": "{{ message }}",
"noStopClause": {{ noStopClause }},
"senderType": "{{ senderType }}"
}'
;