Examples & setup
Every method page has examples in the same eight languages. Choose a live service and your own IDs; placeholder IDs are not runnable orders. Set only the environment variables relevant to that method.
Runtime
| Language | Environment |
|---|---|
| cURL | Bash, cURL 7.76+; inspect JSON status in the printed response |
| JavaScript / TypeScript | Node.js 22+; TypeScript 5+ with Node types |
| Python | Python 3.10+, standard library |
| PHP | PHP 8.1+ and ext-curl |
| Go | Go 1.22+, standard library |
| C# | .NET 8+, console application |
| Java | Java 11+, Jackson Databind on the classpath |
Java uses Jackson to validate JSON status. Maven dependency (Maven Central):
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.22.4</version>
</dependency># Bash / macOS / Linux
export SMSPVA_API_KEY='YOUR_API_KEY'
export SMSPVA_EMAIL_SCODE='CODE_FROM_LIVE_SERVICES'
export SMSPVA_EMAIL_ORDER_ID='YOUR_EMAIL_ORDER_ID'
export SMSPVA_EMAIL_MESSAGE_ID='ID_FROM_GET_MAILS'
export SMSPVA_EMAIL_ALIAS_ID='ID_FROM_ORDER_ALIASES'
# Optional: set SMSPVA_EMAIL_PCODE from get_providers; unset means any provider.
unset SMSPVA_EMAIL_PCODE$env:SMSPVA_API_KEY = 'YOUR_API_KEY'
$env:SMSPVA_EMAIL_SCODE = 'CODE_FROM_LIVE_SERVICES'
$env:SMSPVA_EMAIL_ORDER_ID = 'YOUR_EMAIL_ORDER_ID'
$env:SMSPVA_EMAIL_MESSAGE_ID = 'ID_FROM_GET_MAILS'
$env:SMSPVA_EMAIL_ALIAS_ID = 'ID_FROM_ORDER_ALIASES'
Remove-Item Env:SMSPVA_EMAIL_PCODE -ErrorAction SilentlyContinue| Variable | Parameter |
|---|---|
SMSPVA_EMAIL_DTYPE | dtype, default week |
SMSPVA_EMAIL_DCOUNT | dcount, default 1 |
SMSPVA_EMAIL_T | t, page size, default 50 |
SMSPVA_EMAIL_S | s, offset, default 0 |
SMSPVA_EMAIL_SQ | sq, search, example verification |
SMSPVA_EMAIL_PCODE | pcode, omitted unless non-empty |
Run the cURL examples in Bash. For Java, save the file as Example.java; for Go, use main.go; for C#, use Program.cs in a .NET console project. Compile TypeScript before running it. The other examples read your environment variables directly.
Requests use URL encoding and a 30-second timeout. Account keys go in the query string, so remove them from public request logs. Public reference methods send no key, even if one is set in your environment.
Use email IDs from your own account. The examples do not retry paid requests automatically: check the order before repeating a request whose result is uncertain.