Skip to content

TheSMSWorks/smsw-python-sdk

Repository files navigation

openapi-client

The SMS Works provides a low-cost, reliable SMS API for developers. Pay only for delivered texts, all failed UK messages are refunded.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.9.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://thesmsworks.co.uk/contact

Requirements.

Python 3.7+

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 openapi_client

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 openapi_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thesmsworks.co.uk/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
    host = "https://api.thesmsworks.co.uk/v1"
)

# 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: JWT
configuration.api_key['JWT'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['JWT'] = 'Bearer'


# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = openapi_client.BatchMessagesApi(api_client)
    messages = None # object | An array of messages

    try:
        api_response = api_instance.batch_any_post(messages)
        print("The response of BatchMessagesApi->batch_any_post:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BatchMessagesApi->batch_any_post: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.thesmsworks.co.uk/v1

Class Method HTTP request Description
BatchMessagesApi batch_any_post POST /batch/any
BatchMessagesApi batch_batchid_get GET /batch/{batchid}
BatchMessagesApi batch_schedule_post POST /batch/schedule
BatchMessagesApi batch_send_post POST /batch/send
BatchMessagesApi batches_schedule_batchid_delete DELETE /batches/schedule/{batchid}
CreditsApi credits_balance_get GET /credits/balance
MessagesApi message_schedule_post POST /message/schedule
MessagesApi message_send_post POST /message/send
MessagesApi messages_failed_post POST /messages/failed
MessagesApi messages_inbox_post POST /messages/inbox
MessagesApi messages_messageid_delete DELETE /messages/{messageid}
MessagesApi messages_messageid_get GET /messages/{messageid}
MessagesApi messages_post POST /messages
MessagesApi messages_schedule_get GET /messages/schedule
MessagesApi messages_schedule_messageid_delete DELETE /messages/schedule/{messageid}
MessagesApi send_flash_message POST /message/flash
OneTimePasswordApi otp_messageid_get GET /otp/{messageid}
OneTimePasswordApi otp_send_post POST /otp/send
OneTimePasswordApi otp_verify_post POST /otp/verify
UtilsApi utils_errors_errorcode_get GET /utils/errors/{errorcode}
UtilsApi utils_test_get GET /utils/test

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

[email protected]

About

Python client SDK for The SMS Works API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published