Services & prices
GET /api/rent_email.php?method=get_data
Send a GET request and check JSON status, even with HTTP 200: 1 means success, 0 means failure, and 2 means no mailbox was available when creating a rental. Error details may be in msg, errormsg and errorid.
Authentication
You can call this method without an API key.
Parameters
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "get_data" | Method selector. |
pcode | query | string | No | "outlookcom" | Provider code from Get Providers. Omit this parameter entirely to use all providers; do not send an empty value or null. |
How to use this method
Find services, daily prices and mailbox counts. Pass a pcode from Providers to filter by provider, or omit it for totals across enabled providers. Use the service’s scode when creating a rental.
Prices are in USD. The months_discount applies to periods of at least 30 days. Alias access is available only for Gmail. Refresh counts whenever the selected provider changes.
Request examples
Environment and dependencies. Each example encodes query values and allows 30 seconds for the request. Check HTTP and JSON status before using data. cURL prints the response for you to check; Java uses Jackson to read the JSON.
Set SMSPVA_EMAIL_PCODE to a current provider code to select it; leave it unset or empty to omit pcode entirely. Provider and service codes come from the live lists.
provider_args=()
if [ -n "${SMSPVA_EMAIL_PCODE:-}" ]; then provider_args=(--data-urlencode "pcode=$SMSPVA_EMAIL_PCODE"); fi
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent_email.php" \
--data-urlencode "method=get_data" \
"${provider_args[@]}"Responses
Check the response that matches your request. Example values and dates are illustrative. Optional fields can depend on the outcome or the response format you selected.
HTTP 200
Check status in the JSON even when HTTP is 200. Examples use illustrative values.
application/json
Success (illustrative)
{
"status": 1,
"data": [
{
"count": 40,
"scode": "twitter",
"sname": "Twitter",
"price": 0.1,
"alias_price": 0.25,
"icon": "/templates/SMSv1EN/images/ico/twitter.png",
"months_discount": 20
}
]
}Error
{
"status": 0,
"msg": "Provider not found"
}Success
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [1]) |
data | array<object> | |
data[].count | integer | Available mailbox count. |
data[].scode | string | Service code used to create an order. |
data[].sname | string | Service display name. |
data[].price | number | Daily rental price in USD. |
data[].alias_price | number | Alias access price. Aliases are supported only for Gmail. |
data[].icon | string | Service icon path. |
data[].months_discount | integer | Percentage discount for rental periods of at least 30 days. |
Required: status, data
Error
Some errors include errorid and errormsg; others contain only msg. Check all available error fields.
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [0]) |
errorid | integer | Optional structured error code. |
errormsg | string | Optional error description. |
msg | string | Error message. |