SMSPVAdevelopers
Activation V2
SMSPVA / API REFERENCE

Clear SMS

Clear the current SMS to receive another one.

SMSPVA API
PUThttps://api.smspva.com/activation/clearsms/{orderid}

This request can change an order or incur charges. The examples do not retry it automatically. Reading a newly received SMS can trigger payment, even though the method uses GET.

Authentication

NameLocationTypeRequiredDescription
apikeyheaderstringYesYour API key

Parameters

NameLocationTypeRequiredDescription
orderidpathintegerYesOrder ID

No request body is required.

How to use this method

Clear the current SMS so the order can receive another one. Keep the returned orderExpireIn. HTTP 404 with NO_SMS_TO_CLEAN does not confirm that an SMS was cleared.

Request examples

Runtime requirements and environment setup. cURL uses a POSIX shell. JavaScript and TypeScript run in Node.js. Java uses the standard HTTP client and prints raw JSON; use your application’s JSON library to inspect the body.

  • SMSPVA_ORDER_ID: orderid (required).
: "${SMSPVA_API_KEY:?Set SMSPVA_API_KEY}"
: "${SMSPVA_ORDER_ID:?Set SMSPVA_ORDER_ID to your orderid}"
curl --fail-with-body --max-time 30 --request PUT \
  --url "https://api.smspva.com/activation/clearsms/${SMSPVA_ORDER_ID}" \
  --header "apikey: $SMSPVA_API_KEY"

Responses

The examples below show the response format. Prices, stock and account values are sample data; use the API response for current values.

HTTPDescription
200Successful operation
404No SMS received, or there's unpaid SMS waiting.
405Invalid parameters
406Order not found.
501Server failed to process request.
503No SMS received, or there's unpaid SMS waiting.
HTTP 200

Successful operation

Illustrative response

{
  "statusCode": 200,
  "data": {
    "orderId": 123456,
    "orderExpireIn": 599
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
dataobjectResponse data
data.orderIdintegerOrder ID
data.orderExpireInintegerOrder expiration time in seconds
HTTP 404

No SMS received, or there's unpaid SMS waiting.

Illustrative response

{
  "statusCode": 404,
  "error": {
    "type": "NO_SMS_TO_CLEAN",
    "description": "SMS not yet received or paid."
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestringError type
error.descriptionstringError description
HTTP 405

Invalid parameters

Illustrative response

{
  "statusCode": 405,
  "error": {
    "type": "INVALID_PARAMS",
    "description": "Invalid params."
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestringError type
error.descriptionstringError description
HTTP 406

Order not found.

Illustrative response

{
  "statusCode": 406,
  "error": {
    "type": "ORDER_NOT_FOUND",
    "description": "Order not found."
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestringError type
error.descriptionstringError description
HTTP 501

Server failed to process request.

Illustrative response

{
  "statusCode": 501,
  "error": {
    "type": "SERVER_FAIL",
    "description": "Server failed to process request"
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectResponse data
error.typestringError type
error.descriptionstringError description
HTTP 503

No SMS received, or there's unpaid SMS waiting.

Illustrative response

{
  "statusCode": 503,
  "error": {
    "type": "SERVER_BUSY",
    "description": "Server overload, try later."
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestringError type
error.descriptionstringError description

If a connection fails during an order-changing request, check the order before trying again.

On this page