Download the PHP package monovm/airalo-sdk without Composer

On this page you can find all versions of the php package monovm/airalo-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 airalo-sdk

Airalo PHP SDK

Airalo's PHP SDK provides extremely simple integration with the RESTful API and adds extra layer of security on top.
The SDK supports:

Requisites

Autoloading

We highly encourage to always use composer as a dependency managed and simply require Airalo's SDK by simply running this CLI command:

Then in your codebase you will have access to the Airalo class by having required autoload.php file already.

For legacy projects or projects which still do not use composer, please make sure to require alo.php custom autoloader from the SDK:

Initialization

EasyAccess responses

The SDK provides simple and yet powerful way to interact with the response objects.
By default you will be able to access them as an associative array or object without the need to modify them.

Example:

Methods Interface

Packages

NOTE:
Passing true to $flat parameter makes the response significantly more compact and easy to handle. However it differes than the main one returned from the endpoints. Be mindful in which occassions you will need the original and in which the compact version. Happy coding!

public function getAllPackages(bool $flat = false, $limit = null, $page = null): ?EasyAccess
Fetching all of Airalo's packages. By default the response will be the same as the one from packages REST endpoint (more here: https://partners-doc.airalo.com/#d775be27-4c08-45d1-9faa-8ec2c4f97bf5). Passing $flat as true will return package objects data in a single data object, example:

By default no limit number of packages will be applied if $limit is empty
By default it will paginate all pages (multiple calls) or if $page is provided it will be the starting pagination index.

public function getLocalPackages(bool $flat = false, $limit = null, $page = null): ?EasyAccess
Fetching local Airalo packages. By default the response will be the same as the one from packages REST endpoint (more here: https://partners-doc.airalo.com/#d775be27-4c08-45d1-9faa-8ec2c4f97bf5). Passing $flat as true will return package objects data in a single data object.
By default no limit number of packages will be applied if $limit is empty
By default it will paginate all pages (multiple calls) or if $page is provided it will be the starting pagination index.

public function getGlobalPackages(bool $flat = false, $limit = null, $page = null): ?EasyAccess
Fetching global Airalo packages. By default the response will be the same as the one from packages REST endpoint (more here: https://partners-doc.airalo.com/#d775be27-4c08-45d1-9faa-8ec2c4f97bf5). Passing $flat as true will return package objects data in a single data object.
By default no limit number of packages will be applied if $limit is empty
By default it will paginate all pages (multiple calls) or if $page is provided it will be the starting pagination index.

public function getCountryPackages(string $countryCode, bool $flat = false, $limit = null): ?EasyAccess
Fetching country specific Airalo packages. By default the response will be the same as the one from packages REST endpoint (more here: https://partners-doc.airalo.com/#d775be27-4c08-45d1-9faa-8ec2c4f97bf5). Passing $flat as true will return package objects data in a single data object.
By default no limit number of packages will be applied if $limit is empty
By default it will paginate all pages (multiple calls) or if $page is provided it will be the starting pagination index.

public function getSimPackages(bool $flat = false, $limit = null, $page = null): ?EasyAccess
Fetching Sim only Airalo packages without top ups. By default the response will be the same as the one from packages REST endpoint (more here: https://partners-doc.airalo.com/#d775be27-4c08-45d1-9faa-8ec2c4f97bf5). Passing $flat as true will return package objects data in a single data object.
By default no limit number of packages will be applied if $limit is empty
By default it will paginate all pages (multiple calls) or if $page is provided it will be the starting pagination index.

Orders

public function order(string $packageId, int $quantity, ?string $description = null): ?EasyAccess
Places an order for a given package id (fetched from any of the packages calls) and calls order endpoint of the REST API. Full response example can be found here: https://partners-doc.airalo.com/#768fbbc7-b649-4fb5-9755-be579333a2d9

public function orderBulk(array $packages, ?string $description = null): ?EasyAccess
Parameters: array $packages where the key is the package name and the value represents the desired quantity. Parallel ordering for multiple packages (up to 50 different package ids) within the same function call. Example usage:

Example response:

NOTE:
Each package id is a key in the returned response. The quantity of sims object represents the ordered quantity from the initial call.
If an error occurs in one of the parallel orders, the error REST response will be assigned to the package id key, so you must make sure to validate each response

Example:

Vouchers

public function voucher(int $usageLimit, int $amount, int $quantity, ?bool $isPaid = false, string $voucherCode = null): ?EasyAccess
calls voucher endpoint of the REST API. Full response example can be found here: https://partners-doc.airalo.com/#768fbbc7-b649-4fb5-9755-be579333a2d9

Example response:

Esim Vouchers

public function esimVouchers(array $vouchers): ?EasyAccess
calls voucher/esim endpoint of the REST API. Full response example can be found here: https://partners-doc.airalo.com/#5a48bb8d-70d1-4030-ad92-4a82eb979281

Example response:

Topups

public function topup(string $packageId, string $iccid, ?string $description = null): ?EasyAccess

Places a topup for a given package id and iccid of an eSIM and calls topups endpoint of the REST API.
Full response example can be found here: https://partners-doc.airalo.com/#e411d932-2993-463f-a548-754c47ac7c00

Sim Usage

public function simUsage(string $iccid): ?EasyAccess

Places an $iccid with user iccid and calls simUsage endpoint of the REST API.
Full response example can be found here: https://partners-doc.airalo.com/#e411d932-2993-463f-a548-754c47ac7c00

Example response can be found in the API documentation (link above).

Sim Instructions

public function getSimInstructions(string $iccid, string $language = "en"): ?EasyAccess
Places an $iccid with user iccid & $language with language like en,de. by default its en and calls getSimInstructions endpoint of the REST API. Full response example can be found here: https://partners-doc.airalo.com/#768fbbc7-b649-4fb5-9755-be579333a2d9

Example response:

Techincal notes


All versions of airalo-sdk with dependencies

PHP Build Version
Package Version
Requires phpunit/phpunit Version ^9.5||^10.5
php Version >=7.4
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 monovm/airalo-sdk contains the following files

Loading the files please wait ....