代理店にキャリアを追加
チャネルマネージャAPIを使用してエージェントにキャリアを追加するには、このエンドポイントを使用します。 既存のRCSエージェントにキャリアを追加します。
例
各コード・スニペットで使用されているすべての変数の説明を以下に示します:
| キー | 説明 |
|---|---|
CHANNEL_MANAGER_RCS_AGENT_ID | The ID of the RCS agent. |
VONAGE_API_KEY | Your Vonage API key (see it on your dashboard). |
VONAGE_API_SECRET | Your Vonage API secret (also available on your dashboard). |
CHANNEL_MANAGER_RCS_AGENT_CARRIER_ID | The ID of the carrier to be added. |
Prerequisites
If you do not have an application you can create one. Make sure you also configure your webhooks.
Write the code
Add the following to add-carriers-to-agent.sh:
curl -X POST https://api.nexmo.com/v1/channel-manager/rcs/agents/${CHANNEL_MANAGER_RCS_AGENT_ID}/carriers \
-u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d $'{
"carriers": [
"'${CHANNEL_MANAGER_RCS_AGENT_CARRIER_ID}'"
]
}'Run your code
Save this file to your machine and run it:
bash add-carriers-to-agent.sh