ユーザー

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

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

キー説明
USER_ID

The unique ID of the User.

前提条件

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.

コードを書く

get-user.sh に以下を追加する:

curl "https://api.nexmo.com/v1/users/$USER_ID" \
     -H 'Authorization: Bearer '$JWT\
     -H 'Content-Type: application/json'

全文を見る

コードを実行する

このファイルをあなたのマシンに保存し、実行する:

bash get-user.sh

試してみる

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