create_test_key
Get a NOTIFY test key
Get an sk_test_ API key instantly, with no account and no human. A test key never sends a real SMS and never spends credits, so a whole integration can be built and verified with it. Pass it as `api_key` to send_message and get_message, and keep it in the application's configuration (for example NOTIFY_API_KEY), never in source code. The result also has a `claim_url` for a human: opening it lets them sign in and take over the project. Anyone who opens it, signs in and confirms becomes the owner: give it only to the person who will own the project, and do not paste it into shared logs or tickets. Real SMS need an sk_live_ key that the human creates on the dashboard (https://n0t1fy.dev/dashboard). Limited to a few keys per minute and per day for each address: reuse a key you already have.
無需輸入參數。
send_message
Send a code by SMS
Send one transactional SMS to a Georgian mobile number. The text comes from a built-in template; there is no free text.
With a test key (sk_test_) nothing is really sent: a simulator answers. These recipients simulate outcomes: +995512345671 rejected (status `failed`); +995512345672 provider unreachable (error `provider_unavailable`: nothing was sent, retry with the same idempotency_key); +995512345673 ambiguous (status `unknown`); +995512345674 accepted, then `undeliverable`. Any other valid number is accepted, then `delivered`, within about 30 seconds. With a live key it sends a real SMS and spends one credit per segment.
Read `message.status` in the result. `submitted`: the provider accepted it, which is not yet delivery to the phone. `failed`: refused; `message.error` says why. `unknown`: it may or may not have been sent, so do not send it again automatically. `replayed: true`: this idempotency_key and request were already processed, and no second SMS was sent. Call get_message to learn the final outcome.
輸入參數to必填localeapi_keytemplate必填variables必填idempotency_key必填
start_verification
Send a verification code that NOTIFY makes
Verify a Georgian mobile number: NOTIFY makes a random six-digit code and sends it by SMS with a built-in template. The code is never shown to you: ask the human for the code they received, then call check_verification. A code works for 10 minutes and 5 checks, once; a new start for the same number replaces it.
With a test key (sk_test_), only the test numbers +995512345670 to +995512345679 are accepted and their code is always 000000; nothing is sent. At most 5 starts a minute go to one number, so spread test starts over the ten test numbers. +995512345671 simulates a refused SMS (status `failed`), +995512345672 an unreachable provider (error `provider_unavailable`: nothing was sent, retry with the same idempotency_key), +995512345673 an SMS that may or may not have arrived (still `pending`). With a live key it sends a real SMS and spends one credit.
`replayed: true` means this idempotency_key and request were already processed and no second SMS was sent; the verification it shows may say `approved` by then, which is not a check result. On `too_many_verifications` (5 an hour or 10 in a rolling 24 hours to one number), tell the human when they can try again (`retry_at`), and never retry by yourself.
輸入參數to必填localeapi_keytemplateidempotency_key必填
check_verification
Check a verification code
Check the code the human typed, for the number the code was sent to. The result is the verification only when it is approved; every other outcome is a tool error with an `error.code`. Let the user in only when a check answers `200` with status `approved`; treat every other answer, a timeout and a network error as not approved.
Errors: `incorrect_code` (attempts remain), `too_many_attempts` (start a new verification), `recipient_mismatch` (`to` is not the number the code was sent to), `verification_expired`, `verification_closed` (already approved or replaced), `verification_not_found`. A wrong code costs an attempt, and five close the verification: do not retry a check by yourself; ask the human for the code again.
輸入參數to必填code必填api_keyverification_id必填
get_message
Read a message's status
Read the current state of a message sent with a key of the same project. Poll only while `status` is `queued` or `submitted`: `delivered`, `undeliverable` and `failed` are final, and `unknown` never changes. Wait about 2 seconds before the first read and double the wait each time, up to 30 seconds. Always set a time limit (two minutes is generous for a test message); when it passes, treat the message as unconfirmed and do not send it again.
輸入參數api_keymessage_id必填