Official Python SDK for the SMS Platform Public API. Send SMS, manage contacts, and receive delivery webhooks against the brand-scoped /public/v1/* surface.
Project description
sms-platform-sdk
REST API for external backends (CRMs, e-commerce, custom apps) to send SMS, manage contacts, and receive delivery webhooks. Authenticated with a brand-scoped API key issued from the brand-admin portal. See https://docs.labzbz.com/public-api for the full developer guide, HMAC signing spec, and webhook payload reference.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.21.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.9+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import sms_platform_sdk
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import sms_platform_sdk
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import sms_platform_sdk
from sms_platform_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = sms_platform_sdk.Configuration(
host = "http://localhost"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: PublicApiKey
configuration.api_key['PublicApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['PublicApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with sms_platform_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sms_platform_sdk.PublicAdvancedApi(api_client)
var_from = 'var_from_example' # str | ISO date (optional)
to = 'to_example' # str | (optional)
bucket = 'day' # str | hour | day | week (optional)
try:
# Message counts bucketed by time
api_instance.advanced_message_timeseries(var_from=var_from, to=to, bucket=bucket)
except ApiException as e:
print("Exception when calling PublicAdvancedApi->advanced_message_timeseries: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PublicAdvancedApi | advanced_message_timeseries | GET /public/v1/analytics/messages | Message counts bucketed by time |
| PublicAdvancedApi | advanced_search_contacts | GET /public/v1/contacts/search | Search brand contacts by phone or externalId |
| PublicBlacklistApi | blacklist_add | POST /public/v1/blacklist | Add a phone to the brand blacklist |
| PublicBlacklistApi | blacklist_remove | DELETE /public/v1/blacklist/{phone} | Remove a phone from the brand blacklist |
| PublicCampaignsApi | campaigns_create | POST /public/v1/campaigns | Create and launch a campaign |
| PublicCampaignsApi | campaigns_find_one | GET /public/v1/campaigns/{id} | Get campaign status |
| PublicContactsApi | contacts_bulk | POST /public/v1/segments/{id}/contacts/bulk | Upsert many contacts |
| PublicContactsApi | contacts_get_segment | GET /public/v1/segments/{id} | Get a segment |
| PublicContactsApi | contacts_list_contacts | GET /public/v1/segments/{id}/contacts | List contacts in a segment |
| PublicContactsApi | contacts_list_segments | GET /public/v1/segments | List all segments (contact lists) |
| PublicContactsApi | contacts_remove | DELETE /public/v1/segments/{id}/contacts/{cid} | Remove a contact from a segment |
| PublicContactsApi | contacts_upsert | POST /public/v1/segments/{id}/contacts | Upsert a contact into a segment |
| PublicEventsApi | events_stream | GET /public/v1/events/stream | Stream brand events (SSE) |
| PublicMessagesApi | messages_bulk | POST /public/v1/messages/bulk | Send up to 1000 messages in one call |
| PublicMessagesApi | messages_cancel | DELETE /public/v1/messages/{id} | Cancel a queued or scheduled message |
| PublicMessagesApi | messages_find_one | GET /public/v1/messages/{id} | Retrieve message status |
| PublicMessagesApi | messages_list | GET /public/v1/messages | List messages (paginated) |
| PublicMessagesApi | messages_send | POST /public/v1/messages | Send a single SMS |
| PublicOtpApi | otp_send | POST /public/v1/otp/send | Send an OTP code |
| PublicOtpApi | otp_verify | POST /public/v1/otp/verify | Verify an OTP code |
| PublicReadsApi | reads_allowances | GET /public/v1/allowances | Get brand sending allowances + key rate limit |
| PublicReadsApi | reads_analytics_summary | GET /public/v1/analytics/summary | Daily brand stats between two dates |
| PublicReadsApi | reads_blacklist_check | GET /public/v1/blacklist/check | Check if a number is blacklisted |
| PublicReadsApi | reads_budget | GET /public/v1/budget | Get remaining budget across scopes |
| PublicReadsApi | reads_dnd_check | GET /public/v1/dnd/check | Check if a number is currently in a quiet-hours window |
| PublicReadsApi | reads_sender_ids | GET /public/v1/sender-ids | List approved sender IDs |
| PublicReadsApi | reads_templates | GET /public/v1/templates | List brand message templates |
| PublicWebhooksApi | webhooks_create | POST /public/v1/webhooks | Register a new webhook endpoint |
| PublicWebhooksApi | webhooks_deliveries | GET /public/v1/webhooks/{id}/deliveries | List delivery attempts |
| PublicWebhooksApi | webhooks_find_one | GET /public/v1/webhooks/{id} | Get a webhook endpoint |
| PublicWebhooksApi | webhooks_list | GET /public/v1/webhooks | List webhook endpoints |
| PublicWebhooksApi | webhooks_list_events | GET /public/v1/webhooks/events | List all subscribable events |
| PublicWebhooksApi | webhooks_remove | DELETE /public/v1/webhooks/{id} | Delete a webhook endpoint |
| PublicWebhooksApi | webhooks_rotate | POST /public/v1/webhooks/{id}/rotate-secret | Rotate the signing secret for this endpoint |
| PublicWebhooksApi | webhooks_update | PUT /public/v1/webhooks/{id} | Update a webhook endpoint |
Documentation For Models
- ApiKeyCreateDto
- ApiKeyUpdateDto
- BlacklistAddDto
- ContactUpsertDto
- ContactsBulkUpsertDto
- CreateBrandDto
- CreateGatewayDto
- CreateUserDto
- DisableTwoFactorDto
- LoginDto
- OtpSendDto
- SendBulkDto
- SendCampaignDto
- SendMessageDto
- SendOtpDto
- SetLimitDto
- SmsSegmentsDto
- TwoFactorDto
- UpdateBrandDto
- UpdateGatewayDto
- UpdateUserDto
- VerifyOtpDto
- WebhookEndpointCreateDto
- WebhookEndpointUpdateDto
Documentation For Authorization
Authentication schemes defined for the API:
PublicApiKey
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labzbz_sms_sdk-0.1.0.tar.gz.
File metadata
- Download URL: labzbz_sms_sdk-0.1.0.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9890bd07543e58b75207289a8396e5f9518db58b53d2f6b3957ee1341612b881
|
|
| MD5 |
2bf631c0cfdcec93e7f246dc2c933aaa
|
|
| BLAKE2b-256 |
0b988b4da2fefb67f00540c490707f92ee0505370d88e9b357d21a7e33c55ee8
|
File details
Details for the file labzbz_sms_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: labzbz_sms_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 85.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc1d0ec50871491a1f2f7f044c686dd1155d4550583aa122be786f7ce750c50e
|
|
| MD5 |
867972791d1748b831cef95c8e30b4da
|
|
| BLAKE2b-256 |
9c93a49bb04438c534697eb194e983b52b58ced3a90b5af02b5b95c4804bc6d8
|