ThunderPhone 2.0 आता लाइव्ह आहे.स्वतःच सुरू करा—2¢/मिनिटपासून.घोषणा वाचा

Getting Started

जलद सुरुवात (API)

AI एजंटसह तुमचा पहिला फोन कॉल हाताळा: API की मिळवा, एजंट तयार करा, फोन नंबर प्रोव्हिजन करा आणि थेट चाचणी कॉल करा — हे सर्व REST API द्वारे.

हे मार्गदर्शक तुम्हाला AI एजंटद्वारे तुमचा पहिला फोन कॉल हाताळण्यासाठी लागणाऱ्या चार REST कॉल्समधून मार्गदर्शन करते.

पायरी 1: API की मिळवा

  1. लॉग इन करा

    app.thunderphone.com उघडा.

  2. की विभागात जा

    डॅशबोर्डमध्ये संस्था → की वर जा.

  3. की तयार करा

    की तयार करा वर क्लिक करा, तिला नाव द्या आणि sk_live_... मूल्य कॉपी करा. मूळ की फक्त एकदाच दाखवली जाते — ती लगेच तुमच्या सीक्रेट मॅनेजरमध्ये साठवा.

या मार्गदर्शकात सर्वत्र, sk_live_YOUR_API_KEY ऐवजी तुम्ही नुकतेच कॉपी केलेले मूल्य वापरा. की तुमची संस्था आपोआप ओळखते, त्यामुळे तुम्हाला URL मध्ये कधीही संस्था आयडी टाकण्याची गरज नाही.

पायरी 2: एजंट तयार करा

एजंट AI संभाषणे कशी हाताळते हे ठरवतो — prompt, आवाज, उत्पादन स्तर, साधने आणि विजेट पात्रता.

cURL
curl -X POST https://api.thunderphone.com/v1/agents \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name":   "Customer Support",
    "prompt": "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
    "voice":  "john",
    "product": "spark"
  }'
Python
import os, requests
 
agent = requests.post(
    "https://api.thunderphone.com/v1/agents",
    headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
    json={
        "name":   "Customer Support",
        "prompt": "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
        "voice":  "john",
        "product": "spark",
    },
).json()
print("Agent id:", agent["id"])
Node.js
const agent = await fetch("https://api.thunderphone.com/v1/agents", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.THUNDERPHONE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name:    "Customer Support",
    prompt:  "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
    voice:   "john",
    product: "spark",
  }),
}).then((r) => r.json());
console.log("Agent id:", agent.id);

पायरी 3: फोन नंबर प्रोव्हिजन करा

हा कॉल ThunderPhone कडे नंबरची विनंती करतो आणि तुमच्या नवीन एजंटला इनबाउंड हँडलर म्हणून नियुक्त करतो. (VoIP प्रदात्याकडून तुमचा स्वतःचा नंबर आणण्यासाठी, त्याऐवजी VoIP कनेक्शन पाहा.)

cURL
# First provision
curl -X POST https://api.thunderphone.com/v1/phone-numbers \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"area_code": "415"}'
 
# Then assign the agent you created in Step 2
curl -X PATCH https://api.thunderphone.com/v1/phone-numbers/<id-from-previous> \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inbound_agent_id": 12}'
Python
number = requests.post(
    "https://api.thunderphone.com/v1/phone-numbers",
    headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
    json={"area_code": "415"},
).json()
requests.patch(
    f"https://api.thunderphone.com/v1/phone-numbers/{number['id']}",
    headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
    json={"inbound_agent_id": agent["id"]},
)
print("Your ThunderPhone number:", number["number"])

तुमचा नवीन नंबर status="provisioning" मध्ये सुरू होतो आणि काही सेकंदांत active स्थितीत जातो; तुम्ही ब्राउझर बंद करेपर्यंत नंबर कॉल स्वीकारण्यासाठी तयार होतो.

पायरी 4 (ऐच्छिक): वेबहुक सेट अप करा

रिअल-टाइम इव्हेंट्ससाठी (डायनॅमिक कॉल रूटिंग, कॉलनंतरची प्रक्रिया) वेबहुक एंडपॉइंट जोडा. तुम्हाला आवश्यक असलेल्या इव्हेंट्सचेच सदस्यत्व घ्या.

curl -X POST https://api.thunderphone.com/v1/developer/webhook-endpoints \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label":  "Prod webhook",
    "url":    "https://your-server.com/thunderphone-webhook",
    "events": ["telephony.incoming", "telephony.complete"]
  }'

प्रतिसादामध्ये एकदाच वापरता येणारे secret असते — ते तुमच्या सीक्रेट मॅनेजरमध्ये कॉपी करा. येणाऱ्या विनंत्यांवरील X-ThunderPhone-Signature हेडर सत्यापित करण्यासाठी ते सीक्रेट वापरा (पाहा वेबहुकचा आढावा).

पायरी 5: तुमच्या एजंटची चाचणी करा

तुम्ही नुकताच प्रोव्हिजन केलेल्या नंबरवर कॉल करा. एजंट कॉल स्वीकारतो, स्वतःची ओळख करून देतो आणि तुमचा prompt अनुसरतो.

कॉल संपल्यानंतर त्याची तपासणी करा:

curl https://api.thunderphone.com/v1/calls \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"

ट्रान्सक्रिप्ट आणि रेकॉर्डिंग URL मिळवण्यासाठी विशिष्ट कॉलबद्दल तपशील पाहा:

curl https://api.thunderphone.com/v1/calls/{call_id}/transcript \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
curl https://api.thunderphone.com/v1/calls/{call_id}/audio \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"

पुढील पायऱ्या