Download the PHP package salavati/sapak-sms-php without Composer

On this page you can find all versions of the php package salavati/sapak-sms-php. 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 sapak-sms-php

Sapak SMS PHP SDK

A modern, clean, and opinionated PHP SDK for interacting with the Sapak SMS API.

This SDK is built with developers in mind, focusing on clean code principles, strong typing, and a safe, ergonomic developer experience.

Note: This is an unofficial SDK.
The official Sapak API documentation can be found at: https://docs.sapak.me/


Table of Contents


Features


Installation

Install the package via Composer:


Quick Start: Instantiation

You only need your API key to get started.


Error Handling

This SDK abstracts all HTTP errors into specific exceptions. Always wrap your calls in a try...catch block.


Usage Examples

A. Get Account Credit

Access account information via the account() resource.

B. Send Message (One-to-Many)

Use the SendMessage DTO to prepare your request. This provides client-side validation.

C. Send Messages (Peer-to-Peer)

Create an array of SendPeerToPeer DTOs.

D. Get Message Statuses

To prevent N+1 API requests, this SDK only supports checking statuses in a batch. If you need to check only one ID, pass it as an array: getStatuses([12345]).

E. Find Received Messages (Smart Date Handling)

Pass standard DateTimeInterface objects. The SDK handles the complex Jalali conversion for you.

Note on Date Handling:
The Sapak API requires a non-standard Jalali string format (YYYY-MM-DD HH:mm:ss). Instead of forcing you to handle this, the SDK does the work. It accepts standard PHP DateTimeInterface objects (Gregorian) and automatically converts them to the required Jalali format for the request. It also converts the Jalali date strings in the response back to standard DateTimeImmutable objects.


Testing

To run the test suite, clone the repository, install dependencies, and run PHPUnit:


All versions of sapak-sms-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
guzzlehttp/guzzle Version ^7.10
morilog/jalali Version 3.*
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 salavati/sapak-sms-php contains the following files

Loading the files please wait ...