NudgeForMe REST API example in Python
Retrieve connected mailboxes and follow-up opportunities from a Python service.
Python example: read-only reporting
The script below uses the Python standard library and keeps authentication in an environment variable.
export NUDGE_BASE_URL=https://app.nudgeforme.com
export NUDGE_API_KEY=YOUR_DEVELOPER_KEY
import json
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from urllib.error import HTTPError
base = os.getenv("NUDGE_BASE_URL", "https://app.nudgeforme.com").rstrip("/")
key = os.environ["NUDGE_API_KEY"]
def nudge_get(route, **params):
url = f"{base}/api/v1/{route}"
if params:
url += "?" + urlencode(params)
request = Request(url, headers={"Authorization": f"Bearer {key}"})
try:
with urlopen(request, timeout=20) as response:
return json.load(response)
except HTTPError as error:
details = error.read().decode("utf-8", errors="replace")
raise RuntimeError(f"Nudge API HTTP {error.code}: {details}") from error
print(json.dumps(nudge_get("mailboxes"), indent=2))
print(json.dumps(nudge_get("opportunities", limit=10), indent=2))
The key needs nudge.mailboxes.read and nudge.conversations.read.
Next steps
Filter results in your reporting system to create a weekly open-opportunity digest. This script is intentionally read-only, so it cannot accidentally create drafts or change thread monitoring.
For teams, use a separate workspace-restricted key per client. Rate limit: 60 authenticated requests per minute per developer key.