Clear SMS
Clear the current SMS to receive another one.
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
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
apikey | header | string | Yes | Your API key |
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
orderid | path | integer | Yes | Order 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.
| HTTP | Description |
|---|---|
| 200 | Successful operation |
| 404 | No SMS received, or there's unpaid SMS waiting. |
| 405 | Invalid parameters |
| 406 | Order not found. |
| 501 | Server failed to process request. |
| 503 | No SMS received, or there's unpaid SMS waiting. |
HTTP 200
Successful operation
Illustrative response
{
"statusCode": 200,
"data": {
"orderId": 123456,
"orderExpireIn": 599
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
data | object | Response data |
data.orderId | integer | Order ID |
data.orderExpireIn | integer | Order 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
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
error | object | Error data |
error.type | string | Error type |
error.description | string | Error description |
HTTP 405
Invalid parameters
Illustrative response
{
"statusCode": 405,
"error": {
"type": "INVALID_PARAMS",
"description": "Invalid params."
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
error | object | Error data |
error.type | string | Error type |
error.description | string | Error description |
HTTP 406
Order not found.
Illustrative response
{
"statusCode": 406,
"error": {
"type": "ORDER_NOT_FOUND",
"description": "Order not found."
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
error | object | Error data |
error.type | string | Error type |
error.description | string | Error description |
HTTP 501
Server failed to process request.
Illustrative response
{
"statusCode": 501,
"error": {
"type": "SERVER_FAIL",
"description": "Server failed to process request"
}
}Response fields
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
error | object | Response data |
error.type | string | Error type |
error.description | string | Error 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
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result status code |
error | object | Error data |
error.type | string | Error type |
error.description | string | Error description |
Related guides
If a connection fails during an order-changing request, check the order before trying again.