Metadata-Version: 2.4
Name: nsupp-rest
Version: 0.1.0
Summary: Typed, dependency-free client for the nsupp /cof/v1 REST API.
License-Expression: Apache-2.0
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Dynamic: license-file

# nsupp REST SDK — Python

Typed, dependency-free client for the **nsupp `/cof/v1` REST API** (Python 3.8+, stdlib only).

Handles HTTP Basic auth + `X-Cof-Tier`, unwraps the `{ error, data }` envelope, raises `NsuppError` on failures, and gives you a website-scoped helper. Every endpoint is reachable — common ones as methods, the rest via `request()`.

## Install

```bash
pip install nsupp-rest
```

## Quickstart

```python
from nsupp import Client, NsuppError

nsupp = Client(
    identifier="nsupp_pk_…",
    secret="…",
    tier="plugin",
    website_id="8f3c1d…",
    # base_url="https://api.nsupp.com/cof",
)

site = nsupp.website()

website = site.get()
convos = site.list_conversations(page=1)
site.send_message("session_1", "Hi 👋 — how can we help?")

# Connected-channel delivering replies (ticket / mail / marketplace / review):
site.email_reply("session_1", "Thanks — your order ships today.")
site.marketplace_reply("session_2", "It ships within 24 hours.")
site.review_reply("session_3", "Thank you for the feedback!")

try:
    site.get_conversation("missing")
except NsuppError as e:
    print(e.status, e.code, str(e))

# Escape hatch — any endpoint:
site.request("POST", "/helpdesk/article/a_1/alternate", body={"alternate_article_id": "a_2"})
```

Run the self-test: `python3 -m unittest discover -s tests`.

## License

Licensed under the [Apache License 2.0](./LICENSE).

"nsupp" and the nsupp logo are trademarks of Asindie, Inc. The license grants no trademark rights — see the
[trademark policy](https://github.com/asindie-dev/nsupp/blob/main/TRADEMARK.md) for what use is permitted.
