SMSPVAdevelopers
Private Email Rental
SMSPVA / DOCUMENTATION

Extend rental

GET /api/rent_email.php?method=prolong_order

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

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.

This request can modify a rental or incur charges. If the response is lost, check active and archived orders before trying again: the change may already have been made. The examples do not retry automatically.

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"prolong_order"Method selector.
orderidqueryintegerYes123456Order ID from Create Order, Active Orders or Archived Orders, as appropriate for this method.
dtypequerystringYes"week"Rental period unit: day = 1 day, week = 7 days, month = 30 days.
dcountqueryintegerYes1Positive number of rental period units.

How to use this method

Extend a rental using its ID from Active orders. The cost is deducted from your balance. Use a positive dcount; day, week and month mean 1, 7 and 30 days per unit.

A configured service discount applies when the extension is at least 30 days. After success, refresh active orders to get the new expiry: this response does not include it.

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_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_EMAIL_ORDER_ID:?Set SMSPVA_EMAIL_ORDER_ID}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent_email.php" \
  --data-urlencode "method=prolong_order" \
  --data-urlencode "apikey=$SMSPVA_API_KEY" \
  --data-urlencode "orderid=$SMSPVA_EMAIL_ORDER_ID" \
  --data-urlencode "dtype=${SMSPVA_EMAIL_DTYPE:-week}" \
  --data-urlencode "dcount=${SMSPVA_EMAIL_DCOUNT:-1}"

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": 123456,
    "email": "[email protected]",
    "service": "Twitter"
  }
}

Error

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

Success

NameTypeDescription
statusinteger(enum: [1])
dataobject
data.idintegerOrder ID.
data.emailstringEmail address.
data.servicestringService display name, not a service code.

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