Metadata-Version: 2.4
Name: labzbz-sms-sdk
Version: 0.1.0
Summary: Official Python SDK for the SMS Platform Public API. Send SMS, manage contacts, and receive delivery webhooks against the brand-scoped /public/v1/* surface.
Home-page: https://docs.labzbz.com/public-api
Author: labzbz
Author-email: labzbz <support@labzbz.com>
License: MIT
Project-URL: Homepage, https://docs.labzbz.com/public-api
Project-URL: Documentation, https://apisms.labzbz.com/public/v1/docs
Project-URL: Repository, https://gitlab.com/freshandsunny/sms-back-office
Project-URL: Issues, https://gitlab.com/freshandsunny/sms-back-office/-/issues
Keywords: sms,labzbz,messaging,public-api,openapi,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2.11
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# 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](https://openapi-generator.tech) 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:

```sh
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:
```python
import sms_platform_sdk
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import sms_platform_sdk
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

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**](docs/PublicAdvancedApi.md#advanced_message_timeseries) | **GET** /public/v1/analytics/messages | Message counts bucketed by time
*PublicAdvancedApi* | [**advanced_search_contacts**](docs/PublicAdvancedApi.md#advanced_search_contacts) | **GET** /public/v1/contacts/search | Search brand contacts by phone or externalId
*PublicBlacklistApi* | [**blacklist_add**](docs/PublicBlacklistApi.md#blacklist_add) | **POST** /public/v1/blacklist | Add a phone to the brand blacklist
*PublicBlacklistApi* | [**blacklist_remove**](docs/PublicBlacklistApi.md#blacklist_remove) | **DELETE** /public/v1/blacklist/{phone} | Remove a phone from the brand blacklist
*PublicCampaignsApi* | [**campaigns_create**](docs/PublicCampaignsApi.md#campaigns_create) | **POST** /public/v1/campaigns | Create and launch a campaign
*PublicCampaignsApi* | [**campaigns_find_one**](docs/PublicCampaignsApi.md#campaigns_find_one) | **GET** /public/v1/campaigns/{id} | Get campaign status
*PublicContactsApi* | [**contacts_bulk**](docs/PublicContactsApi.md#contacts_bulk) | **POST** /public/v1/segments/{id}/contacts/bulk | Upsert many contacts
*PublicContactsApi* | [**contacts_get_segment**](docs/PublicContactsApi.md#contacts_get_segment) | **GET** /public/v1/segments/{id} | Get a segment
*PublicContactsApi* | [**contacts_list_contacts**](docs/PublicContactsApi.md#contacts_list_contacts) | **GET** /public/v1/segments/{id}/contacts | List contacts in a segment
*PublicContactsApi* | [**contacts_list_segments**](docs/PublicContactsApi.md#contacts_list_segments) | **GET** /public/v1/segments | List all segments (contact lists)
*PublicContactsApi* | [**contacts_remove**](docs/PublicContactsApi.md#contacts_remove) | **DELETE** /public/v1/segments/{id}/contacts/{cid} | Remove a contact from a segment
*PublicContactsApi* | [**contacts_upsert**](docs/PublicContactsApi.md#contacts_upsert) | **POST** /public/v1/segments/{id}/contacts | Upsert a contact into a segment
*PublicEventsApi* | [**events_stream**](docs/PublicEventsApi.md#events_stream) | **GET** /public/v1/events/stream | Stream brand events (SSE)
*PublicMessagesApi* | [**messages_bulk**](docs/PublicMessagesApi.md#messages_bulk) | **POST** /public/v1/messages/bulk | Send up to 1000 messages in one call
*PublicMessagesApi* | [**messages_cancel**](docs/PublicMessagesApi.md#messages_cancel) | **DELETE** /public/v1/messages/{id} | Cancel a queued or scheduled message
*PublicMessagesApi* | [**messages_find_one**](docs/PublicMessagesApi.md#messages_find_one) | **GET** /public/v1/messages/{id} | Retrieve message status
*PublicMessagesApi* | [**messages_list**](docs/PublicMessagesApi.md#messages_list) | **GET** /public/v1/messages | List messages (paginated)
*PublicMessagesApi* | [**messages_send**](docs/PublicMessagesApi.md#messages_send) | **POST** /public/v1/messages | Send a single SMS
*PublicOtpApi* | [**otp_send**](docs/PublicOtpApi.md#otp_send) | **POST** /public/v1/otp/send | Send an OTP code
*PublicOtpApi* | [**otp_verify**](docs/PublicOtpApi.md#otp_verify) | **POST** /public/v1/otp/verify | Verify an OTP code
*PublicReadsApi* | [**reads_allowances**](docs/PublicReadsApi.md#reads_allowances) | **GET** /public/v1/allowances | Get brand sending allowances + key rate limit
*PublicReadsApi* | [**reads_analytics_summary**](docs/PublicReadsApi.md#reads_analytics_summary) | **GET** /public/v1/analytics/summary | Daily brand stats between two dates
*PublicReadsApi* | [**reads_blacklist_check**](docs/PublicReadsApi.md#reads_blacklist_check) | **GET** /public/v1/blacklist/check | Check if a number is blacklisted
*PublicReadsApi* | [**reads_budget**](docs/PublicReadsApi.md#reads_budget) | **GET** /public/v1/budget | Get remaining budget across scopes
*PublicReadsApi* | [**reads_dnd_check**](docs/PublicReadsApi.md#reads_dnd_check) | **GET** /public/v1/dnd/check | Check if a number is currently in a quiet-hours window
*PublicReadsApi* | [**reads_sender_ids**](docs/PublicReadsApi.md#reads_sender_ids) | **GET** /public/v1/sender-ids | List approved sender IDs
*PublicReadsApi* | [**reads_templates**](docs/PublicReadsApi.md#reads_templates) | **GET** /public/v1/templates | List brand message templates
*PublicWebhooksApi* | [**webhooks_create**](docs/PublicWebhooksApi.md#webhooks_create) | **POST** /public/v1/webhooks | Register a new webhook endpoint
*PublicWebhooksApi* | [**webhooks_deliveries**](docs/PublicWebhooksApi.md#webhooks_deliveries) | **GET** /public/v1/webhooks/{id}/deliveries | List delivery attempts
*PublicWebhooksApi* | [**webhooks_find_one**](docs/PublicWebhooksApi.md#webhooks_find_one) | **GET** /public/v1/webhooks/{id} | Get a webhook endpoint
*PublicWebhooksApi* | [**webhooks_list**](docs/PublicWebhooksApi.md#webhooks_list) | **GET** /public/v1/webhooks | List webhook endpoints
*PublicWebhooksApi* | [**webhooks_list_events**](docs/PublicWebhooksApi.md#webhooks_list_events) | **GET** /public/v1/webhooks/events | List all subscribable events
*PublicWebhooksApi* | [**webhooks_remove**](docs/PublicWebhooksApi.md#webhooks_remove) | **DELETE** /public/v1/webhooks/{id} | Delete a webhook endpoint
*PublicWebhooksApi* | [**webhooks_rotate**](docs/PublicWebhooksApi.md#webhooks_rotate) | **POST** /public/v1/webhooks/{id}/rotate-secret | Rotate the signing secret for this endpoint
*PublicWebhooksApi* | [**webhooks_update**](docs/PublicWebhooksApi.md#webhooks_update) | **PUT** /public/v1/webhooks/{id} | Update a webhook endpoint


## Documentation For Models

 - [ApiKeyCreateDto](docs/ApiKeyCreateDto.md)
 - [ApiKeyUpdateDto](docs/ApiKeyUpdateDto.md)
 - [BlacklistAddDto](docs/BlacklistAddDto.md)
 - [ContactUpsertDto](docs/ContactUpsertDto.md)
 - [ContactsBulkUpsertDto](docs/ContactsBulkUpsertDto.md)
 - [CreateBrandDto](docs/CreateBrandDto.md)
 - [CreateGatewayDto](docs/CreateGatewayDto.md)
 - [CreateUserDto](docs/CreateUserDto.md)
 - [DisableTwoFactorDto](docs/DisableTwoFactorDto.md)
 - [LoginDto](docs/LoginDto.md)
 - [OtpSendDto](docs/OtpSendDto.md)
 - [SendBulkDto](docs/SendBulkDto.md)
 - [SendCampaignDto](docs/SendCampaignDto.md)
 - [SendMessageDto](docs/SendMessageDto.md)
 - [SendOtpDto](docs/SendOtpDto.md)
 - [SetLimitDto](docs/SetLimitDto.md)
 - [SmsSegmentsDto](docs/SmsSegmentsDto.md)
 - [TwoFactorDto](docs/TwoFactorDto.md)
 - [UpdateBrandDto](docs/UpdateBrandDto.md)
 - [UpdateGatewayDto](docs/UpdateGatewayDto.md)
 - [UpdateUserDto](docs/UpdateUserDto.md)
 - [VerifyOtpDto](docs/VerifyOtpDto.md)
 - [WebhookEndpointCreateDto](docs/WebhookEndpointCreateDto.md)
 - [WebhookEndpointUpdateDto](docs/WebhookEndpointUpdateDto.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="PublicApiKey"></a>
### PublicApiKey

- **Type**: API key
- **API key parameter name**: X-Api-Key
- **Location**: HTTP header


## Author




