List Legs

In this building block you will see how to list Legs.

Prerequisites

Use your existing application

You will need to use an existing Application that contains a Conversation and Legs in order to be able to list Legs. See the Create Conversation building block 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 list-legs.sh:

Copy to Clipboard
curl "https://api.nexmo.com/beta/legs" \
     -H 'Authorization: Bearer '$JWT\
     -H 'Content-Type: application/json'

View full source

Run your code

Save this file to your machine and run it:

$ bash list-legs.sh

Try it out

When you run the code you will list all Legs for the Application.