リスト会話

このコード・スニペットでは、すべての会話をリストアップする方法を学びます。

Prerequisites

You will need to use an existing Application that contains Conversations in order to receive some results here. See the Create Conversation code snippet for information on how to create an Application and some sample Conversations.

Write the code

Add the following to list-conversations.sh:

# Gets a list of conversations from an application ID (app ID is in the JWT).
curl "https://api.nexmo.com/v1/conversations" \
     -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-conversations.sh

試してみる

このコードを実行すると、すべての会話のリストが取得されます。