Download the PHP package virtualsmslabs/php-sdk without Composer

On this page you can find all versions of the php package virtualsmslabs/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-sdk

VirtualSMS PHP SDK

PHP SDK for the VirtualSMS Consumer API — SMS verification, phone number rental, and activation management.

Packagist CI PHP

Requirements

Installation

Quick Start

API Reference

Client Constructor

Methods

Account

getBalance(): BalanceResponse

Returns the current account balance.

Information & Pricing

getCountries(?string $poolProvider = null): array

Returns all available countries.

getServicesList(?int $country = null, ?string $lang = null): array

Returns available services for a country.

getOperators(int $country, ?string $poolProvider = null): array

Returns available mobile operators for a country.

getPrices(?string $service = null, ?int $country = null, ?string $poolProvider = null): array

Returns pricing data organized by country and service.

getPricesExtended(?string $service, ?int $country, ?bool $freePrice, ?string $poolProvider): array

Returns extended pricing with price tiers.

getPricesVerification(?string $service = null, ?string $poolProvider = null): array

Returns pricing in inverted format (service → country).

getNumbersStatus(int $country, ?string $operator = null, ?string $poolProvider = null): array

Returns available phone quantity per service.

getTopCountriesByService(string $service): array

Returns top 10 countries for a service, ranked by purchase share and success rate.

Ordering Numbers

getNumber(string $service, int $country, ...$options): NumberResponse

Orders a phone number. Returns text format response.

Options:

Parameter Type Description
maxPrice float Maximum price willing to pay
operator string Mobile operator filter
phoneException string Phone prefixes to exclude (comma-separated)
forward bool Enable call forwarding
activationType int Activation type: 0=SMS, 1=number, 2=voice
language string Language for voice activation
useCashBack bool Use cashback balance first
userId string End-user ID for tracking
ref string Referral ID
poolProvider string Pool provider: alpha, prime, gamma, zeta
getNumberV2(string $service, int $country, ...$options): array

Same as getNumber but returns JSON with additional fields. Supports orderId for idempotency.

Activation Management

setStatus(int $id, int $status): string

Changes activation status.

getStatus(int $id): StatusResponse

Returns activation status in text format.

getStatusV2(int $id): array

Returns activation status in JSON format with SMS/call details.

getActiveActivations(): array

Returns all currently active activations.

checkExtraActivation(int $id): array

Checks if a number is available for reactivation.

getExtraActivation(int $id): NumberResponse

Creates an extra activation on a previously used number.

Notifications

getNotifications(): array

Returns user notifications including penalties, low balance alerts, and admin messages.

Constants

ActivationStatus

PoolProvider

Error Handling

The SDK throws typed exceptions for all API errors. Each error code maps to a specific exception class:

Error Code Reference

Error Code Exception Description
BAD_KEY AuthenticationException Invalid API key
BANNED AuthenticationException (HTTP 403) / RateLimitException (HTTP 429) Account banned / Rate limited
PURCHASE_RESTRICTED AuthenticationException User restricted from purchasing
SERVICE_RESTRICTED AuthenticationException Service restricted for account
NO_BALANCE InsufficientBalanceException Insufficient balance
NO_NUMBERS NoNumbersException No numbers available
WRONG_SERVICE ValidationException Invalid service code
WRONG_COUNTRY ValidationException Invalid country ID
BAD_ACTION ValidationException Invalid action
BAD_STATUS ValidationException Invalid status code
NO_PRICES ValidationException No pricing data available
INVALID_PROVIDER ValidationException Invalid pool provider
NO_ACTIVATION ActivationException Activation not found
WRONG_ACTIVATION_ID ActivationException Invalid activation ID
EARLY_CANCEL_DENIED ActivationException Cannot cancel within 5 minutes
RENEW_ACTIVATION_NOT_AVAILABLE ActivationException Number not available for reactivation
CONCURRENT_LIMIT RateLimitException Too many concurrent activations
ERROR_SQL ServerException Internal server error

Tracking Headers

The SDK sends anonymous tracking headers with every request for analytics and debugging:

Header Value Privacy
X-SDK-Version 1.1.0 SDK version string
X-SDK-Language php SDK language
X-SDK-Machine-Id SHA-256 hash of php_uname() + PHP SAPI (truncated to 32 chars) Irreversible hash — no hostname or IP exposed
X-SDK-Timestamp ISO 8601 UTC timestamp Request time

No personally identifiable information is transmitted. The machine ID is a one-way hash and cannot be reversed to identify the source machine.

Rate Limiting

The API enforces rate limits and returns X-RateLimit-Limit and X-RateLimit-Remaining headers on every response. The SDK captures these automatically.

Checking Rate Limit Status

getRateLimitInfo() returns null before any request has been made, or if the API did not send rate-limit headers.

Handling Rate Limit Errors (HTTP 429)

When the rate limit is exceeded, the API returns HTTP 429 with a Retry-After header. The SDK throws a RateLimitException:

Property Type Description
$retryAfter int Seconds to wait before retrying (0 if not provided)
$rateLimitLimit ?int Maximum requests allowed in the window (null if absent)
$rateLimitRemaining ?int Remaining requests in the window (null if absent)

The last successful getRateLimitInfo() is also available after a RateLimitException is caught, reflecting the rate-limit headers from the 429 response itself.

Custom Transport

By default, the SDK uses cURL for HTTP requests. You can provide your own transport implementation:

Examples

See the examples/ directory:

Testing

License

MIT — see LICENSE.

Links


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package virtualsmslabs/php-sdk contains the following files

Loading the files please wait ...