SMSPVAdevelopers
Private Email Rental
SMSPVA / DOCUMENTATION

Alias messages

GET /api/rent_email.php?method=get_mails_by_alias

SMSPVA API
GEThttps://smspva.com/api/rent_email.php?method=get_mails_by_alias

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

Send apikey as a required query parameter.

Parameters

NameLocationTypeRequiredExampleDescription
apikeyquerystringYesSMSPVA_API_KEYAccount API key. Reading messages and managing a rental require the order owner's key.
methodquerystringYes"get_mails_by_alias"Method selector.
orderidqueryintegerYes123456Order ID from Create Order, Active Orders or Archived Orders, as appropriate for this method.
aliasidqueryintegerYes88Existing alias ID from aliases in Active Orders. orderid must identify its parent order.
tqueryintegerNo50Page size.
squeryintegerNo0Pagination offset.
sqquerystringNo"verification"Search string. URL-encode this value.

How to use this method

Read messages for an existing Gmail alias. Get both IDs from Active orders: orderid is the parent rental ID, and aliasid identifies the alias. Buy access with Buy alias access first.

Use t, s and sq as in Messages. To retrieve a full message, send the parent orderid and its message ID as emailid to Message body.

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.

  • SMSPVA_EMAIL_ORDER_ID: orderid.
  • SMSPVA_EMAIL_ALIAS_ID: aliasid.
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_EMAIL_ORDER_ID:?Set SMSPVA_EMAIL_ORDER_ID}"
: "${SMSPVA_EMAIL_ALIAS_ID:?Set SMSPVA_EMAIL_ALIAS_ID}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent_email.php" \
  --data-urlencode "method=get_mails_by_alias" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "orderid=$SMSPVA_EMAIL_ORDER_ID" \
  --data-urlencode "aliasid=$SMSPVA_EMAIL_ALIAS_ID" \
  --data-urlencode "t=${SMSPVA_EMAIL_T:-50}" \
  --data-urlencode "s=${SMSPVA_EMAIL_S:-0}" \
  --data-urlencode "sq=${SMSPVA_EMAIL_SQ:-verification}"

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": [
    {
      "id": 6,
      "sender": "[email protected]",
      "subject": "Verification code",
      "preview": "Your code: 12345",
      "addedAt": "2026-10-22T10:00:00.000Z"
    }
  ]
}

Error

{
  "status": 0,
  "msg": "Incorrect apikey"
}

Empty result

{
  "status": 1,
  "data": []
}

Success

NameTypeDescription
statusinteger(enum: [1])
dataarray<object>
data[].idintegerMessage ID. Pass this as emailid to get_mail_body.
data[].senderstringSender address.
data[].subjectstringMessage subject.
data[].previewstringMessage preview.
data[].addedAtstringMessage timestamp. (format: "date-time")

Required: status, data

Error

Some errors include errorid and errormsg; others contain only msg. Check all available error fields.

NameTypeDescription
statusinteger(enum: [0])
erroridintegerOptional structured error code.
errormsgstringOptional error description.
msgstringError message.

On this page