ユーザー

このコードスニペットでは、Userを取得する方法を学びます。

以下の変数が、便利な方法で必要な値に設定されていることを確認してください:

キー説明
USER_ID

The unique ID of the User.

Prerequisites

You will need to use an existing Application and have a User in order to be able to get a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.

Write the code

Add the following to get-user.sh:

curl "https://api.nexmo.com/v1/users/$USER_ID" \
     -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 get-user.sh

試してみる

コードを実行すると、指定されたUserが表示されます。