46elks: Send SMS
Sends a text message through 46elks, for the alert that has to reach someone who isn’t looking at a screen.
- Kind:
46elks.send_sms - Palette: Integrations, under 46elks
- Credential: a credential of kind
basic, named incredential - Other 46elks actions: Send SMS (dry run, nothing sent)
When to use
Section titled “When to use”- Paging a person about a production failure.
- A notification to someone with no chat app, such as a customer’s delivery update.
46elks answers a rejected sender, a malformed number, bad auth or an empty balance with a 4xx,
and that fails the step. Turning fail_on_error_status off here buys a success report for a
message nobody received. The API has no idempotency key, so a retried step, or one run again
after its agent lost its lease, can send a second text.
Connection (with)
Section titled “Connection (with)”| Field | Required | Description |
|---|---|---|
from |
yes | Who the text appears to come from: up to 11 letters and digits starting with a letter, or one of your 46elks numbers in E.164 form. A number is needed for the recipient to be able to reply. For example: Hyperspool or +46700000000. |
Input (input)
Section titled “Input (input)”| Field | Type | Required | Description |
|---|---|---|---|
to |
string | yes | Recipient in E.164 form, country code included: +46700000000. |
message |
string | yes | The text. Longer than 160 characters (70 if it carries an emoji or other non-GSM character) is split into parts and charged per part. |
Settings
Section titled “Settings”Beside with and input in the node’s config.
| Field | Type | Required | Description |
|---|---|---|---|
credential |
string | yes | Name of the project credential the action authenticates with. |
fail_on_error_status |
boolean | no | Treat any 4xx/5xx as a failure. On by default: an action either did its job or did not. Default true. |
optional_when_untrusted |
boolean | no | Run without the credential when the run is untrusted (a fork pull request), instead of failing. The credential is still withheld. |
retry_on |
array | no | Status codes that fail the node instead of returning, so its retry: policy applies (e.g. [429, 503]). |
Output
Section titled “Output”The HTTP response. The reply is under body: nodes.<id>.output.body.<field>.
| Field | Type | Description |
|---|---|---|
status |
integer | The HTTP status code. |
headers |
object | The response headers. |
body |
object | The response body, parsed as JSON when it is JSON. |
body.cost |
integer | In 10000ths of the account currency. |
body.id |
string | The message id. |
body.parts |
integer | How many messages the text was split into. |
body.status |
string | created, sent, failed or delivered. |
How it runs
Section titled “How it runs”- On an agent with the
connectorcapability. The managed environments have one, so this needs no agent of your own. - One
POSTrequest toapi.46elks.com. - Any 4xx or 5xx fails the step, unless
fail_on_error_statusisfalse.retry:asks again after a 5xx, a 401, 408, 409, 423, 425 or 429, or a 4xx withRetry-After, and not after any other 4xx, which would get the same answer.
Example
Section titled “Example”version: hyperspool-graph/v1nodes: - id: on_failure type: trigger config: { event: run.failed } - id: page_me type: 46elks.send_sms config: credential: elks with: { from: Hyperspool } input: to: "+46700000000" message: { $expr: "('Run failed: ' + input.payload.error).truncate(150)" }edges: - { from: on_failure, to: page_me }The credential is the API username and password: spool credential set elks --kind basic --username <api user>, which prompts for the password. A message over 160 characters (70 with
an emoji) is split and charged per part, so cap text you don’t control, as message does here.
Build against send_sms_dryrun first to see the price without
sending.
See Connectors for credentials and versions, and the node reference for every other node.