新しいコールを作成する
この例では、電話をかける方法を説明します。電話をかけるには、物理的な電話またはソフトフォンが必要です。
サンプルコードの以下のプレースホルダーの値を置き換えてください:
| キー | 説明 |
|---|---|
bearer_token | OAuth トークン。 OAuthトークンについてもっと読む |
account_id | Vonage Business CommunicationsのアカウントID。 |
from_type | デスティネーションのタイプ。以下の2つの値のいずれかを指定します。 extension あるいは device |
from_destination | 目的地だ。もし from_type は extensionである。 from_destination は拡張子でなければならない。もし from_type は deviceである。 from_destination は有効なデバイスIDでなければならない。 |
to_type | 目的地のタイプ。以下の3つの値のいずれかを指定します。 extension , deviceあるいは pstn |
to_destination | 目的地だ。もし from_type は extensionである。 to_destination は拡張子でなければならない。もし from_type は deviceである。 to_destination は有効なデバイスIDでなければならない。もし from_type は pstnである。 to_destination は有効な電話番号でなければならない。 |
type | のひとつであるべきだ。 click2dial, click2dialme, odr または default |
curl --location --request POST 'https://api.vonage.com/t/vbc.prod/telephony/v3/cc/accounts/$account_id/calls' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' \ --data-raw '{ "from": { "type": "$from_type", "destination": "$from_destination" }, "to": { "type": "$to_type", "destination": "$to_destination" }, "type": "$type" }'