SMSPVAdevelopers
Activation V2
SMSPVA / API REFERENCE

Get number

Request an activation number for a country and service.

SMSPVA API
GEThttps://api.smspva.com/activation/number/{country}/{service}

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
countrypathstringYesCountry 2 symbols name in ISO 3166-2 format, uppercase. Countries list
servicepathstringYesService code. Services list
voicequeryintegerNoNumber type: 0 - SMS, 1 - caller-ID, 2 - voice call. Defaults to 0. (enum: [0,1,2]; default: 0)

No request body is required.

How to use this method

Request a number for your chosen country and service.

Choose codes from the reference lists. Check prices, number counts and message type settings before ordering. You can also compare operator prices and prices by country.

Save data.orderId for Receive SMS and other order requests. Use data.orderExpireIn to calculate the order deadline. If the request times out, check Current orders before requesting another number: the first order may already exist.

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_API_KEY:?Set SMSPVA_API_KEY}"
curl --fail-with-body --max-time 30 --request GET \
  --url "https://api.smspva.com/activation/number/BD/opt20?voice=0" \
  --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
405Invalid parameters
407Your balance is too low to receive sms for selected country and service.
411API access limited by low karma or ratelimits
500Failed to fetch number
501Number not found
502Number not found.
503Server overload, try later.
HTTP 200

Successful operation

Illustrative response

{
  "statusCode": 200,
  "data": {
    "orderId": 123456,
    "phoneNumber": 9876544321,
    "countryCode": "BD",
    "orderExpireIn": 600
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
dataobjectResponse data
data.orderIdintegerOrder ID
data.phoneNumberintegerPhone number without country code
data.countryCodestringCountry code according ITU-T E.123 & E.164 Countries list
data.orderExpireInintegerOrder expiration time in seconds
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 407

Your balance is too low to receive sms for selected country and service.

Illustrative response

{
  "statusCode": 407,
  "error": {
    "type": "LOW_BALANCE",
    "description": "Low balance."
  }
}

Response fields

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

API access limited by low karma or ratelimits

Illustrative response

{
  "statusCode": 411,
  "error": {
    "type": "ACCESS_LIMITED",
    "description": "Access is temporary limited."
  }
}

Response fields

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

Failed to fetch number

Illustrative response

{
  "statusCode": 500,
  "error": {
    "type": "NUMBER_FETCH_FAIL",
    "description": "Failed to fetch number"
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestring
error.descriptionstring
HTTP 501

Number not found

Illustrative response

{
  "statusCode": 501,
  "error": {
    "type": "PRICE_FETCH_FAIL",
    "description": "Failed to fetch price"
  }
}

Response fields

NameTypeDescription
statusCodeintegerResult status code
errorobjectError data
error.typestringError type
error.descriptionstringFailed to fetch price
HTTP 502

Number not found.

Illustrative response

{
  "statusCode": 502,
  "error": {
    "type": "NUMBER_NOT_FOUND",
    "description": "Number not found."
  }
}

Response fields

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

Server overload, try later.

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