ThunderPhone 2.0 ਹੁਣ ਲਾਈਵ ਹੈ।ਸੈਲਫ਼-ਸਰਵਿਸ—2¢/ਮਿੰਟ ਤੋਂਐਲਾਨ ਪੜ੍ਹੋ

Getting Started

ਤੁਰੰਤ ਸ਼ੁਰੂਆਤ (API)

AI ਏਜੰਟ ਨਾਲ ਆਪਣੀ ਪਹਿਲੀ ਫ਼ੋਨ ਕਾਲ ਦਾ ਜਵਾਬ ਦਿਓ: API ਕੁੰਜੀ ਪ੍ਰਾਪਤ ਕਰੋ, ਏਜੰਟ ਬਣਾਓ, ਫ਼ੋਨ ਨੰਬਰ ਪ੍ਰੋਵਿਜ਼ਨ ਕਰੋ ਅਤੇ ਲਾਈਵ ਟੈਸਟ ਕਾਲ ਕਰੋ — ਸਭ ਕੁਝ REST API ਰਾਹੀਂ।

ਇਹ ਗਾਈਡ ਤੁਹਾਨੂੰ ਉਹਨਾਂ ਚਾਰ REST ਕਾਲਾਂ ਰਾਹੀਂ ਲੰਘਾਉਂਦੀ ਹੈ ਜਿਨ੍ਹਾਂ ਨਾਲ ਤੁਸੀਂ AI ਏਜੰਟ ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਆਪਣੀ ਪਹਿਲੀ ਫ਼ੋਨ ਕਾਲ ਦਾ ਜਵਾਬ ਦੇ ਸਕਦੇ ਹੋ।

ਕਦਮ 1: API ਕੁੰਜੀ ਪ੍ਰਾਪਤ ਕਰੋ

  1. ਲੌਗ ਇਨ ਕਰੋ

    app.thunderphone.com ਖੋਲ੍ਹੋ।

  2. ਕੁੰਜੀਆਂ ਤੇ ਜਾਓ

    ਡੈਸ਼ਬੋਰਡ ਵਿੱਚ ਸੰਗਠਨ → ਕੁੰਜੀਆਂ ਤੇ ਜਾਓ।

  3. ਕੁੰਜੀ ਬਣਾਓ

    ਕੁੰਜੀ ਬਣਾਓ ਤੇ ਕਲਿੱਕ ਕਰੋ, ਇਸਨੂੰ ਨਾਮ ਦਿਓ, ਅਤੇ sk_live_... ਮੁੱਲ ਕਾਪੀ ਕਰੋ। ਅਸਲ ਕੁੰਜੀ ਸਿਰਫ਼ ਇੱਕ ਵਾਰ ਦਿਖਾਈ ਜਾਂਦੀ ਹੈ — ਇਸਨੂੰ ਤੁਰੰਤ ਆਪਣੇ ਸੀਕਰਟ ਮੈਨੇਜਰ ਵਿੱਚ ਸਟੋਰ ਕਰੋ।

ਇਸ ਗਾਈਡ ਦੌਰਾਨ, sk_live_YOUR_API_KEY ਨੂੰ ਉਸ ਮੁੱਲ ਨਾਲ ਬਦਲੋ ਜੋ ਤੁਸੀਂ ਹੁਣੇ ਕਾਪੀ ਕੀਤਾ ਹੈ। ਕੁੰਜੀ ਤੁਹਾਡੇ ਸੰਗਠਨ ਦੀ ਆਪਣੇ ਆਪ ਪਛਾਣ ਕਰਦੀ ਹੈ, ਇਸ ਲਈ ਤੁਹਾਨੂੰ ਕਦੇ ਵੀ URLs ਵਿੱਚ ਸੰਗਠਨ id ਪਾਉਣ ਦੀ ਲੋੜ ਨਹੀਂ ਹੁੰਦੀ।

ਕਦਮ 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"

ਅਗਲੇ ਕਦਮ