Message body
GET /api/rent_email.php?method=get_mail_body
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
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
apikey | query | string | Yes | SMSPVA_API_KEY | Account API key. Reading messages and managing a rental require the order owner's key. |
method | query | string | Yes | "get_mail_body" | Method selector. |
orderid | query | integer | Yes | 123456 | Order ID from Create Order, Active Orders or Archived Orders, as appropriate for this method. |
emailid | query | integer | Yes | 6 | Message ID returned by a message-list method. |
How to use this method
Read the full message using its emailid from Messages or Alias messages. Also send the parent rental’s orderid.
The body may contain HTML from the sender. Treat it as untrusted content and sanitize it before displaying it in your application.
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_MESSAGE_ID:emailid.
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_EMAIL_ORDER_ID:?Set SMSPVA_EMAIL_ORDER_ID}"
: "${SMSPVA_EMAIL_MESSAGE_ID:?Set SMSPVA_EMAIL_MESSAGE_ID}"
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent_email.php" \
--data-urlencode "method=get_mail_body" \
--data-urlencode "apikey=$SMSPVA_API_KEY" \
--data-urlencode "orderid=$SMSPVA_EMAIL_ORDER_ID" \
--data-urlencode "emailid=$SMSPVA_EMAIL_MESSAGE_ID"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",
"body": "<p>Your code: 12345</p>",
"addedAt": "2026-10-22T10:00:00.000Z"
}
}Error
{
"status": 0,
"msg": "Incorrect apikey"
}Success
| Name | Type | Description |
|---|---|---|
status | integer | (enum: [1]) |
data | object | |
data.id | integer | Message ID. |
data.sender | string | Sender address. |
data.subject | string | Message subject. |
data.body | string | Message body, which may contain HTML. Treat it as untrusted content when rendering. |
data.addedAt | string | Message timestamp. (format: "date-time") |
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. |