这份文档还在翻译中,预期年底前完成。欢迎您提供宝贵的意见及建议。
Delete a Leg
In this code snippet you learn how to delete a Leg.
Example
Ensure the following variables are set to your required values using any convenient method:
Key | Description |
---|---|
LEG_ID |
The unique ID of the Leg. |
Prerequisites
You will need to use an existing Application that contains a Conversation and Legs in order to be able to delete a Leg. See the Create Conversation code snippet for information on how to create an Application and some sample Conversations. You can create Legs within that Conversation by making a Call as outlined in the Conversation topic and our tutorial `Retrieve Conversation details for an in-progress Call.`
Write the code
Add the following to delete-leg.sh
:
curl -X "DELETE" "https://api.nexmo.com/beta/legs/$LEG_ID" \
-H 'Authorization: Bearer '$JWT\
-H 'Content-Type: application/json'
Run your code
Save this file to your machine and run it:
bash delete-leg.sh
Try it out
When you run the code you will delete the specified Leg.