accounts
Creates, updates, deletes, gets or lists an accounts resource.
Overview​
| Name | accounts |
| Type | Resource |
| Id | ovh.sms.accounts |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | |
automatic_recredit_amount | integer | Pack quantity automatic recredit possibilities (100, 200, 250, 500, 1000, 5000, 10000) (wire: automaticRecreditAmount) |
call_back | string | URL called when state of a sent SMS changes (wire: callBack) |
channel | string | For what purpose this account can be used for (both, marketing, transactional) |
credit_threshold_for_automatic_recredit | number | Credit threshold after which an automatic recredit is launched (wire: creditThresholdForAutomaticRecredit) |
credits_hold_by_quota | number | (wire: creditsHoldByQuota) |
credits_left | number | (wire: creditsLeft) |
description | string | |
iam | object | IAM resource metadata |
smpp | boolean | Whether the account can be used for smpp or not |
sms_response | object | A structure describing how to manage an sms Response (wire: smsResponse) |
status | string | Account status (disable, enable) |
stop_call_back | string | URL called when a STOP is received after a receiver replied stop to a SMS (wire: stopCallBack) |
templates | object | A structure describing all information about templates informations |
user_quantity_with_quota | integer | (wire: userQuantityWithQuota) |
SMS details
| Name | Datatype | Description |
|---|---|---|
name | string | |
automatic_recredit_amount | integer | Pack quantity automatic recredit possibilities (100, 200, 250, 500, 1000, 5000, 10000) (wire: automaticRecreditAmount) |
call_back | string | URL called when state of a sent SMS changes (wire: callBack) |
channel | string | For what purpose this account can be used for (both, marketing, transactional) |
credit_threshold_for_automatic_recredit | number | Credit threshold after which an automatic recredit is launched (wire: creditThresholdForAutomaticRecredit) |
credits_hold_by_quota | number | (wire: creditsHoldByQuota) |
credits_left | number | (wire: creditsLeft) |
description | string | |
iam | object | IAM resource metadata |
smpp | boolean | Whether the account can be used for smpp or not |
sms_response | object | A structure describing how to manage an sms Response (wire: smsResponse) |
status | string | Account status (disable, enable) |
stop_call_back | string | URL called when a STOP is received after a receiver replied stop to a SMS (wire: stopCallBack) |
templates | object | A structure describing all information about templates informations |
user_quantity_with_quota | integer | (wire: userQuantityWithQuota) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | Get an SMS account. Returns the SMS account: status, credits left, callback URLs, automatic recredit settings and channel. | |
list | select | iam_tags, x_pagination_mode | List SMS accounts. Returns the service names of the SMS accounts of the customer. Get an SMS account for its status, credits left and settings. | |
update | update | service_name | Update an SMS account. Updates the SMS account settings, such as the callback URLs, the templates and the automatic recredit. | |
estimate | exec | message, noStopClause, senderType | Estimate a message. Returns the encoding, the length and the number of SMS parts needed to send a text message. | |
smpp_password | exec | serviceName | Generates a new password for the SMPP account. | |
transfer_credits | exec | serviceName, credits, smsAccountTarget | Transfer 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.
| 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) |
iam_tags | object | Filter resources on IAM tags (wire: iamTags) |
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 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
;
List SMS accounts. Returns the service names of the SMS accounts of the customer. Get an SMS account for its status, credits left and settings.
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 iam_tags = '{{ iam_tags }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
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
- smpp_password
- transfer_credits
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 }}"
}'
;
Generates a new password for the SMPP account.
EXEC ovh.sms.accounts.smpp_password
@serviceName='{{ serviceName }}' --required
;
Transfer credits. Transfers an amount of credits from this SMS account to another SMS account, given by its service name.
EXEC ovh.sms.accounts.transfer_credits
@serviceName='{{ serviceName }}' --required
@@json=
'{
"credits": {{ credits }},
"smsAccountTarget": "{{ smsAccountTarget }}"
}'
;