Skip to main content

users_jobs

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

Overview​

Nameusers_jobs
TypeResource
Idovh.sms.users_jobs

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idinteger
creation_datetimestring (date-time) (wire: creationDatetime)
creditsnumber
delivered_atstring (date-time) (wire: deliveredAt)
delivery_receiptinteger (wire: deliveryReceipt)
differed_deliveryinteger (wire: differedDelivery)
messagestring
message_lengthinteger (wire: messageLength)
number_of_smsinteger (wire: numberOfSms)
pttinteger
receiverstring
senderstring
sent_atstring (date-time) (wire: sentAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, login, service_nameGet a pending job. Returns the SMS waiting to be sent: receiver, message, number of SMS parts and credits.
listselectlogin, service_namex_pagination_modeList pending jobs. Returns the identifiers of the SMS waiting to be sent. Get a pending job for its receiver, message, number of SMS parts and credits.
createinsertlogin, service_name, messageSend SMS. Sends an SMS to one or several receivers, given as a list, a CSV document URL or a receiver list. Sending can be delayed, and a validity period drops the message if it is not delivered in time.
deletedeleteid, login, service_nameDelete a pending job. Cancels the sending of an SMS that is still waiting to be sent, such as a delayed SMS. Sent SMS are in the sent SMS history.

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"}})
idintegerId of the object
loginstringThe sms user login
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 pending job. Returns the SMS waiting to be sent: receiver, message, number of SMS parts and credits.

SELECT
id,
creation_datetime,
credits,
delivered_at,
delivery_receipt,
differed_delivery,
message,
message_length,
number_of_sms,
ptt,
receiver,
sender,
sent_at
FROM ovh.sms.users_jobs
WHERE id = '{{ id }}' -- required
AND login = '{{ login }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Send SMS. Sends an SMS to one or several receivers, given as a list, a CSV document URL or a receiver list. Sending can be delayed, and a validity period drops the message if it is not delivered in time.

INSERT INTO ovh.sms.users_jobs (
charset,
class,
coding,
differed_period,
message,
no_stop_clause,
priority,
receivers,
receivers_document_url,
receivers_slot_id,
sender,
sender_for_response,
tag,
validity_period,
login,
service_name
)
SELECT
'{{ charset }}',
'{{ class }}',
'{{ coding }}',
{{ differed_period }},
'{{ message }}' /* required */,
{{ no_stop_clause }},
'{{ priority }}',
'{{ receivers }}',
'{{ receivers_document_url }}',
'{{ receivers_slot_id }}',
'{{ sender }}',
{{ sender_for_response }},
'{{ tag }}',
{{ validity_period }},
'{{ login }}',
'{{ service_name }}'
RETURNING
credits_left,
ids,
invalid_receivers,
tag,
total_credits_removed,
valid_receivers
;

DELETE examples​

Delete a pending job. Cancels the sending of an SMS that is still waiting to be sent, such as a delayed SMS. Sent SMS are in the sent SMS history.

DELETE FROM ovh.sms.users_jobs
WHERE id = '{{ id }}' --required
AND login = '{{ login }}' --required
AND service_name = '{{ service_name }}' --required
;