SMS, e-mail & callback
The three methods that reach outside the database: sending a text message, sending a templated e-mail, and starting a call-back.
sms_send
Sends an SMS on behalf of a subscribed customer, through the SMS routing (LCR) assigned to that customer.
Who may call it: a plain user account only, and only one with SMS service active on it.
| Parameter | Required | In hash | Meaning |
|---|---|---|---|
u | Yes | — | Caller's username. |
lcr_id | Yes | 1st | Must be exactly the SMS routing already assigned to this account — you can't pick a different one through the API. |
dst | Yes | 2nd | Destination number. |
src | Yes | 3rd | Sender id / number. |
message | Yes | 4th | The text, URL-encoded if it contains special characters. |
Hash parameter order: lcr_id, dst, src, message.
curl -X POST https://api.example.com/api/sms_send \
-d "u=demo_customer" \
-d "lcr_id=12" \
-d "dst=41440000099" \
-d "src=Demo" \
-d "message=Hello%20from%20the%20API" \
-d "hash=PLACEHOLDER_HASH"<page>
<response>
<status>ok</status>
<message>
<message_id>5871</message_id>
<sms_status_code_tip>Delivered</sms_status_code_tip>
<price>0.05</price>
<currency>EUR</currency>
</message>
</response>
</page>If the message was accepted but the gateway later reports a problem, the shape changes to <page><error><message><message_id>...</message_id><sms_status_code_tip>...</sms_status_code_tip></message></error></page>. If it was rejected before sending, it's just <page><error>reason</error></page> — Bad login, Dont_be_so_smart (not a plain-user account), You are not subscribed to sms service, There is no such LCR, Dont_be_so_smart again (an lcr_id that isn't this account's assigned one), Wrong destination, Wrong source, There is no message or it is empty.
Also reachable as: /api/send_sms.
sms_send performs through the API.email_send
Sends one of the installation's saved e-mail templates to an account's registered address.
Who may call it: admin, accountant or reseller — not a plain user, not a partner.
| Parameter | Required | In hash | Meaning |
|---|---|---|---|
u | Yes | — | Caller's username — must itself have a registered e-mail address, since the template is sent as that account. |
email_name | Yes | 1st | Name of the saved e-mail template. |
email_to_user_id | No | 2nd | Recipient account id. Left out, sends to the caller's own address. A reseller can only target their own customers (or themselves). |
| anything else | No | only if the name happens to be in the shared list | Passed through as template variables — only the ones the template actually recognises get substituted. |
Hash parameter order: email_name, then email_to_user_id.
curl -X POST https://api.example.com/api/email_send \
-d "u=admin" \
-d "email_name=welcome" \
-d "email_to_user_id=3031" \
-d "hash=PLACEHOLDER_HASH"<page>
<email_sending_status>1</email_sending_status>
</page>Note the success tag sits directly under <page>, not nested in <status>. Errors are nested — <page><status><error>...</error></status></page>: Bad login, Dont_be_so_smart (wrong account type), Email not found (no such template), Your email not found (the caller's own address is missing), User not found (recipient outside scope), User email not found (recipient has no address), or whatever the mail system itself reports.
Also reachable as: /api/send_email.
email_send sends one of these saved templates by name.callback_init
Starts a call-back: the system calls src first, and once that leg answers, dials dst. Only works if the installation has switched callback on (confline CB_Active).
Who may call it: any account type, provided the device named belongs to their own scope.
| Parameter | Required | In hash | Meaning |
|---|---|---|---|
u | Yes | — | Caller's username. |
device | Yes | 1st | Numeric device id that provides the calling identity — must be in the caller's own scope. |
src | Yes | 3rd | The number called first (e.g. the customer's mobile). |
dst | Yes | 2nd | What gets dialled once src answers. There is no "ask the caller what to dial" fallback here, so this is mandatory even though earlier versions of this API could leave it out. |
callback_uniqueid | No | — | 1 asks for a generated callback id back in the response. |
Hash parameter order: device, dst, src — note the shared list puts device first and dst before src, not the order you'd read them in a sentence.
curl -X POST https://api.example.com/api/callback_init \
-d "u=demo_customer" \
-d "device=3327" \
-d "src=41440000011" \
-d "dst=41440000099" \
-d "hash=PLACEHOLDER_HASH"<page>
<Status>Ok</Status>
</page>Note the capital <Status> — that's how this one method spells it, both on this plain-success shape and on every error. The only time it's lower-case is when you pass callback_uniqueid=1: then a success answers <page><status>ok</status><callback_uniqueid>...</callback_uniqueid></page> instead.
Errors (all in capitalised <Status>): Access Denied (callback switched off, or no caller), src is missing, dst is missing (ask-IVR is not wired on this system), Device was not found, Dont_be_so_smart (device outside scope), Cannot_connect_to_asterisk_server (a literal, untranslated key).
CB_Active switch and the CallerID fields callback_init relies on.Check
For sms_send, confirm the customer account you're testing with actually shows SMS service: active and has an SMS routing assigned before calling it — both errors below that point look identical in isolation but come from different missing settings.