mhodieknowledge / palsa
Official Palsa client, generated from the OpenAPI specification. SMS, email and push from one request.
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Palsa is prepaid. Credit is reserved before anything reaches a supplier and only what a supplier
accepted is charged, so a balance cannot go below nothing. QUOTA_EXCEEDED means exactly that: the
workspace could not pay for the send, and nothing was sent.
A key belongs to one workspace, so no path here names a workspace and no key can reach another's data.
What happened to a send is reported by webhook, signed as
Palsa-Signature: t=<milliseconds>,v1=<hex>: an HMAC-SHA256 over <t>.<raw body>. Verify against the
raw body, because parsing and re-serialising it changes the bytes, and refuse a signature older than
five minutes, which is what stops an old delivery being replayed at you later. Every client library
ships a verifier, since no generator produces one.
This file is generated from nothing and generates everything. Every Palsa client library is produced from it, so an API change is a change here followed by a regeneration. It is also tested against the running server, because a specification is a claim about what the server does and a wrong claim would be inherited by every client at once.
For more information, please visit https://palsa.mhodieknowledge.workers.dev.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mhodieknowledge/palsa.git"
}
],
"require": {
"mhodieknowledge/palsa": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure Bearer authorization: bearerAuth $config = Palsa\Api\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new Palsa\Api\Api\BillingApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->getBalances(); print_r($result); } catch (Exception $e) { echo 'Exception when calling BillingApi->getBalances: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to https://palsa.mhodieknowledge.workers.dev
| Class | Method | HTTP request | Description |
|---|---|---|---|
| BillingApi | getBalances | GET /v1/balances | Prepaid balances |
| ContactsApi | createContact | POST /v1/contacts | Save a contact |
| ContactsApi | deleteContact | DELETE /v1/contacts/{id} | Erase a contact |
| ContactsApi | listContacts | GET /v1/contacts | List contacts |
| ContactsApi | registerDevice | POST /v1/devices | Register a device for push |
| NotificationsApi | describeMcp | GET /v1/mcp | What the MCP endpoint is |
| NotificationsApi | getNotification | GET /v1/notifications/{id} | One send |
| NotificationsApi | listNotifications | GET /v1/notifications | List sends |
| NotificationsApi | quoteSend | POST /v1/quotes | Price a send without making it |
| NotificationsApi | sendNotification | POST /v1/notifications | Send a notification |
| VerificationApi | checkVerification | POST /v1/verifications/{id}/check | Check a code |
| VerificationApi | startVerification | POST /v1/verifications | Send a one-time code |
Models
- Balance
- Blocker
- Channel
- CheckVerification200Response
- CheckVerificationRequest
- Contact
- ContactCreate
- CreateContact201Response
- CreateContact201ResponseData
- DeleteContact200Response
- DeleteContact200ResponseData
- DescribeMcp200Response
- DeviceRegister
- Error
- ErrorEnvelope
- GetBalances200Response
- GetBalances200ResponseData
- GetNotification200Response
- ListContacts200Response
- ListContacts200ResponseData
- ListNotifications200Response
- ListNotifications200ResponseData
- ListNotifications200ResponseMeta
- Notification
- NotificationSummary
- Quote
- QuoteHeldUntil
- QuoteSend200Response
- QuoteSms
- QuoteVariants
- QuotedRecipient
- Recipients
- RegisterDevice201Response
- RegisterDevice201ResponseData
- SendNotification202Response
- SendRequest
- SendResult
- SkippedRecipient
- StartVerification201Response
- Verification
- VerificationCheck
- VerificationRequest
Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: Bearer authentication
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0.0- Package version:
0.1.0 - Generator version:
7.14.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.
Licence
MIT. See the repository for the full text.