Skip to main content

Official Python SDK for the Pilot Status public API.

Project description

pilot-status (Python SDK)

Official Python SDK for the Pilot Status public API.

Installation

pip install pilot-status

Quickstart

Create an API key in the dashboard and use it only on the backend.

import os

from pilot_status import PilotStatusClient

client = PilotStatusClient(
    api_key=os.environ["PILOT_STATUS_API_KEY"],
)

accepted = client.messages.send(
    {
        "templateId": "onboarding-test",
        "destinationNumber": "+5511999999999",
        "variables": {"name": "John"},
    }
)

message = client.messages.get(accepted["id"])
print(message["status"])

Opt-in check (destination authorization)

In LIVE, sending may require opt-in when using the Pilot Status WhatsApp number. You can check whether a destination is already authorized for your project:

opt_in = client.messages.check_opt_in("+5511999999999")
if not opt_in["authorized"]:
    raise Exception(f"Missing opt-in: {opt_in['reason']}")

Analytics

stats = client.analytics.get_dashboard_stats(tz="America/Sao_Paulo")
print(stats["totalSent"], stats["failureRate"])

Webhooks (parse / validation)

from pilot_status import parse_customer_webhook

def handler(payload: dict):
    event = parse_customer_webhook(payload)

    if event["event"] == "message.failed":
        print(event["data"]["errorMessage"])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pilot_status-0.1.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pilot_status-0.1.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file pilot_status-0.1.1.tar.gz.

File metadata

  • Download URL: pilot_status-0.1.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pilot_status-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5eddddfcc56c552d5a22ec8c9651eaae240313c45d043cb3cd15f3cd1e3356ba
MD5 efd8e33540307d76f6ef7bf328955aad
BLAKE2b-256 2e7017827bac35e694422213333977917244332ef5173106862c50ae7e796ebc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilot_status-0.1.1.tar.gz:

Publisher: publish-pypi.yml on oismaelash/pilot-status-nextjs-typescript-frontend-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pilot_status-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pilot_status-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pilot_status-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7089be2897534c38d65557ee6601bb90f563276c59cd758bf4013b9c71a354d
MD5 fa4da6796ef6a41459154c6debbec57a
BLAKE2b-256 df6dd9d997532b27026bffa15677e02c947a200189c9a32db73babf93b4f90f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilot_status-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on oismaelash/pilot-status-nextjs-typescript-frontend-backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page