Mailbox counts
GET /api/rent_email.php?method=get_count
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_count" | 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
Check mailbox availability by service. Pass pcode for one provider, or omit it to include all enabled providers. Match entries by scode: a missing service means zero available mailboxes, and an empty data array means no stock.
Counts may be cached for 15 seconds and do not reserve a mailbox. When the provider changes, replace the old counts and ignore responses for earlier selections. Use the same provider when creating the order.
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_count" \
"${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"
},
{
"count": 38,
"scode": "fb"
}
]
}Error
{
"status": 0,
"msg": "Provider not found"
}Empty result
{
"status": 1,
"data": []
}Success
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [1]) |
data | array<object> | |
data[].count | integer | Available mailbox count. |
data[].scode | string | Service code. |
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. |